1

我有以下 WIX (3.7) 代码(通用)问题是当我添加超过 1 个快捷方式时,在安装过程中只创建了最后一个。我检查了日志,它只执行了一个 CreateShortcut 实例......

 <Directory Id="ProgramMenuFolder">
                <Directory Id="company_StartMenu" Name="company">
                    <Component Guid="FBF1EE90-789F-4891-BF3D-C73E6E786BA3" Id="comapny_StartMenu">
                        <CreateFolder />
                        <RemoveFolder Id="company_StartMenu" On="uninstall" />
                    </Component>
                    <Directory Id="AppDir_StartMenu" Name="app">
                        <Component Guid="93ECCEED-C0B6-46B5-ADA6-3E45BD0A1B2C" Id="AppDir_StartMenu">
                            <CreateFolder />
                            <RemoveFolder Id="AppDir_StartMenu" On="uninstall" />
                            <Shortcut Id="__radDD6BE_STARTSHORTCUT" Name="app" Description="Start app"  Target="runtime.exe" Advertise="no">
                                <Icon Id="___radDD6BE_STA" SourceFile="C:\path\appicon.ico" />       </Shortcut>
                            <Shortcut Id="__rad5206D_openfolder"    Name="Open folder"   Description="Open install folder " Target="[INSTALLDIR]" Advertise="no"></Shortcut>
                        </Component>
                    </Directory>
                </Directory>
            </Directory>
4

1 回答 1

0

使用此示例代码,我可以在安装时添加两个快捷方式

A)应用程序的快捷方式
B)快捷方式链接到安装文件夹

<DirectoryRef Id="ApplicationProgramsFolder">
  <Component Id="ApplicationShortCutA" Guid="{D5318419-F1C2-4D4A-9F21-7DD8C9916426}">

    <Shortcut  Id="AppShortCutA" Name="!(wix.Product)"
              Description="!(wix.ProductDesc)"
              Target="[INSTALLDIR]SomeFileA.txt"
              WorkingDirectory="INSTALLDIR" />


    <RegistryKey Root="HKCU" Key="!(wix.Manufacturer)\!(wix.Product)" Action="createAndRemoveOnUninstall">
      <RegistryValue Name="ShortCutA" Type="integer" Value="1" KeyPath="yes"  />
    </RegistryKey>

    <RemoveFolder Id="ApplicationShortCutA" On="uninstall"/>
  </Component>

  <Component Id="OpenFolderShortCut" Guid="{5596B2C5-A460-439d-838E-4B134EE6FDD1}">
    <CreateFolder />
    <Shortcut Id="OpenFolderLink" Name="Open Folder"
              Description="Open install Folder" Target="[INSTALLDIR]"
              Advertise="no" WorkingDirectory="INSTALLDIR" />

    <RegistryKey Root="HKCU" Key="!(wix.Manufacturer)\!(wix.Product)" Action="createAndRemoveOnUninstall">
      <RegistryValue Name="OpenInstallFolder" Type="integer" Value="1" KeyPath="yes" />
    </RegistryKey>

    <RemoveFolder Id="OpenFolderShortCut" On="uninstall"/>
  </Component>
</DirectoryRef>

HTH
PS 未验证卸载 ;)

于 2012-11-27T02:56:31.533 回答