2016-03-15 29 views
0

我想設置在WiX的快捷方式目標路徑播發快捷 這是現在創建shorcut代碼:設置快捷TARGETPATH維克斯

<Component Id="APP_EXE" Directory="INSTALLDIR" DiskId="1" Guid="XXXX-XXXX"> 
<File Id="AppExe" Name="app.exe" Source="$(var.ComponentSourceDir)\$(var.ExeName)" KeyPath="yes"> 
    <Shortcut Id="desktopShortcut" Advertise="yes" Directory="DesktopFolder" Name="$(var.VersionedName)" WorkingDirectory="INSTALLDIR" Icon="MainIcon.exe" IconIndex="0" /> 
    </File> 
</Component> 

在快捷方式的屬性窗口中的目標是隻讀的,現在,它顯示應用程序名稱。我無法改變它。

回答

0

我創建了一個新組件,在其中創建快捷方式。我刪除了前一個。

<Component Id="APP_EXE" Directory="INSTALLDIR" DiskId="1" Guid="XXXX-XXXX"> 
<File Id="AppExe" Name="app.exe" Source="$(var.ComponentSourceDir)\$(var.ExeName)" KeyPath="yes"> 
    </File> 
</Component> 
<Component Id="APP_SHORTCUT" Directory="INSTALLDIR" DiskId="1" Guid="XXXX_XXXXX"> 
    <RegistryValue Root="HKCU" Key="Software\APP\Installer" Name="desktopShortcut" Value="KeyPath" KeyPath="yes" Type="string" /> 
    <Shortcut Id="desktopShortcut" Directory="DesktopFolder" Name="$(var.VersionedName)" WorkingDirectory="INSTALLDIR" Icon="MainIcon.exe" IconIndex="0" Target="[INSTALLDIR]app.exe"/> 
</Component>