Question

I am trying to create a Start Menu shortcut. This is the code I'm using:

<Fragment>
    <SetProperty Id="MIFOLDER" Value="[INSTALLFOLDER]\MI" Before="CostFinalize"></SetProperty>
    <!-- Start menu -->
    <Icon Id="iconCMD" SourceFile="$(var.SharedComponents.ProjectDir)Images\Icons\cmd.ico" />
    <DirectoryRef Id="STARTMENUFOLDER">
      <Component Id="cmp211060161C737F50377C120FF39D7623" Guid="{E7B9FB15-4A1D-4E3E-BCDE-EB2E5638C452}" Win64="yes">
        <Shortcut Id="shrtct211060161C737F50377C120FF39D7623" Name="Management Interface (MI)"
          Target="[System64Folder]\cmd.exe" Icon="iconCMD" Arguments='/k "title Managment Command Line Interface (MI)"' WorkingDirectory="MIFOLDER" />
        <RegistryValue Root="HKCU" Key="Software\$(var.Manufacturer)\VB\Installer\$(var.ProductName)\MI"
          Name="MI" Type="string" Value="$(var.VersionNumber)" KeyPath="yes" />
        <RemoveFolder Id="rem211060161C737F50377C120FF39D7623" On="uninstall"/>
      </Component>
    </DirectoryRef>
  </Fragment>

I want this shortcut to run Command Line Interface and start it in installation folder.

When running the setup normally, it indeed works fine and all well.

When I'm installing with /q (unattended), and after installation I click the shortcut, and it leads to Windows\system32 directory and not working directory. When I look at shortcut properties, I see that it set to start at \MI as SetProperty action doesn't take place.

Any help and ideas why?

Was it helpful?

Solution

InstallUISequence will be skipped in silent installation. Use Sequenceattribute to run the SetProperty action as per your requirement(both or first).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top