0

I want to add a shortcut in my program menu. i tried:

<Component Id='myId' Guid='E4DED108-0129-4a5b-83FE-C9D1E3025B00'> <File Id='MyFileID' Name='Prog.exe' DiskId='1' Source='.\Prog.exe' KeyPath='yes'> <Shortcut Id='myShortcut' Name='Prog' Icon='MyIcon.exe' IconIndex='0' Directory='ProgramMenuDir' Advertise='yes' /> </File> </Component> but the installer add the shortcut in a subfolder in the program menu! Why and what can i do to avoid this?

Thanks Micha

4

1 回答 1

2

您可以尝试将 Directory='ProgramMenuDir' 更改为 Directory='ProgramMenuFolder',否则制作单独的快捷方式组件;

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramMenuFolder">
    <Component Id="Shortcuts"  Guid="{}">
      <Shortcut Id='myShortcut' Name='Prog' Icon='MyIcon.exe' IconIndex='0' Directory='ProgramMenuFolder' WorkingDirectory='INSTALLDIR' Target="[INSTALLDIR]Prog.exe" />
      <RegistryValue Root='HKCU' Key='SOFTWARE\prog\prog' Type='string' Value='1' KeyPath='yes' />
    </Component>
  </Directory>

  <!-- other files -->
</Directory>
于 2010-09-19T18:31:47.147 回答