我正在使用Wix为wpf应用程序创建MSI安装程序。我正在创建两个项目,一个是Wix设置项目,另一个是Bootstrapper。在设置项目中有一个名为product.wxs的文件,在Bootstrapper项目中有一个Bundle.wxs。我正在product.wxs文件中创建快捷方式,如下所示。我已经在Bootstrapper中引用了设置项目。我可以在开始菜单中看到这个快捷方式。当我运行这个快捷方式时,它会从之前安装的c:\应用程序中删除它。但它仍然显示在控制面板(添加或删除程序)中。当我使用Bootstrapper项目创建的Exe时,会出现这种情况。但是当我使用设置项目创建的安装程序时,它可以正常工作。控制面板中的条目也被删除了。我无法弄清楚Bootstrapper项目发生了什么。以下是我的Product.wxs代码:
以下是来自启动程序项目的Bundle.wxs代码:
<Directory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuSubfolder" Name="Vizitech Solutions">
<Component Id="ApplicationShortcuts" Guid="*">
<Shortcut Id="ApplicationShortcut1" Name="Consenus Sweeper"
Description="Consensus"
Target="[INSTALLFOLDER]ConsenusSweeper.exe"
WorkingDirectory="INSTALLFOLDER">
<Icon Id="MyAppShortCutIcon" SourceFile="Consensus_128.ico"/>
</Shortcut>
<Shortcut Id="UninstallProductStartMenu"
Name="Uninstall Consensus Sweeper"
Target="[System64Folder]msiexec.exe"
Arguments="/x [ProductCode]"
Description="Uninstalls Consensus Sweeper"
>
<Icon Id="MyAppUninstallShortCutIcon" SourceFile="Consensus_128.ico"/>
</Shortcut>
<RegistryValue Root="HKCU" Key="Software\Vizitech\ConsensusSweeper"
Name="installed" Type="integer" Value="1" KeyPath="yes" />
<RemoveFolder Id="ProgramMenuSubfolder" On="uninstall"/>
<RemoveFolder Id="INSTALLFOLDER" On="uninstall"/>
</Component>
</Directory>
</Directory>
以下是来自启动程序项目的Bundle.wxs代码:
<Bundle Name="Consensus Sweeper" Version="1.0.0.2"
UpgradeCode="PUT-GUID-HERE"
IconSourceFile="$(var.SolutionDir)Libs\Resources\Consensus_128.ico">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" >
<bal:WixStandardBootstrapperApplication LicenseFile="License.rtf"
LogoFile="FTB.bmp" LogoSideFile="FTB.bmp" />
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id="NetFx45Web"/>
<MsiPackage Id="MyApplication" SourceFile="$(var.ConsensusSweeper.TargetPath)"
Visible="no">
<MsiProperty Name="ALLUSERS" Value="1"></MsiProperty>
</MsiPackage>
</Chain>
</Bundle>
[ProductCode]
就是那个ID。 @edit我的意思是,如果您有Id =“*”
或Id=“Your_guid”
?我的代码是相同的,我甚至不知道是否正确,因为你说卸载正在工作,但仅在控制面板中保留... - Buzka91