2012-11-26 35 views
1

我有以下WIX(3.7)代碼(一般化)問題是當我添加多個快捷方式時,只有最後一個在安裝過程中創建。爲App
B)安裝正在創建WIX只有最後一個目錄中的快捷方式

A)快捷方式,當我檢查日誌,它只有執行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> 

回答

0

有了這個代碼示例我可以同時添加快捷方式快捷方式鏈接到安裝文件夾

<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未得到驗證卸載;)

+0

剛剛卸載的工作正常 – CheGueVerra

+0

它看起來像將每個快捷方式放在它自己的組件中有訣竅。整個樣本非常有用。謝謝。 –

+0

請接受我的回答;)幫助他人<哨聲不祥> – CheGueVerra