2017-03-15 63 views
0

我创建了c#应用程序的安装程序。现在我想添加一个桌面快捷方式:我已经遵​​循了WiX官方文档以及本网站上的其他建议答案,但是我的安装程序仍然没有创建快捷方式。 编译过程中没有错误发生。我.wsx文件如下:WiX工具 - 无法添加桌面快捷方式

<Directory Id="TARGETDIR" Name="SourceDir"> 
    <Directory Id="ProgramFilesFolder"> 
    <Directory Id="APPLICATIONROOTDIRECTORY" Name="Myapp"> 
     <Component Id="Trojan2CostCalculator.exe" Guid="*"> 
     <File Id="Myapp.exe" Source="$(var.Myapp.TargetPath)" KeyPath="yes" Checksum="yes"/> 
     </Component> 
      <Directory Id="DesktopFolder" Name="Desktop"> 
     <Component Id="ApplicationShortcutDesktop" Guid="*"> 
      <Shortcut Id="ApplicationDesktopShortcut" 
        Name="Myapp" 
        Description="Made by me" 
        Target="$(var.Myapp.TargetPath)Myapp.exe" 
        WorkingDirectory="APPLICATIONROOTDIRECTORY" /> 
      <RemoveFolder Id="DesktopFolder" On="uninstall"/> 
      <RegistryValue 
        Root="HKCU" 
        Key="Software\Myapp" 
        Name="installed" 
        Type="integer" 
        Value="1" 
        KeyPath="yes" /> 
     </Component> 
     </Directory> 

...

,我添加的组件:

<Feature Id="MainApplication" Title="Main Application" Level="1"> 
    <ComponentRef Id="ApplicationShortcutDesktop"/> 
    </Feature> 

安装成功地完成,但没有创建快捷方式。我错过了什么?

回答

0

我认为你的捷径的'目标'是错误的。您将构建时间源路径传递给它。它应该像“[APPLICATIONROOTDIRECTORY] Myapp.exe”。参见 - wixtoolset.org/documentation/manual/v3/xsd/wix/shortcut.html

相关问题