当用户卸载应用程序时,我想运行 WIX CustomAction 时遇到问题。
这是我的 XML
http://schemas.microsoft.com/wix/2006/wi'>
<Package Description='pak' InstallerVersion='200' Compressed='yes' />
<Media Id='1' Cabinet='setup.cab' EmbedCab='yes' />
<Property Id='ARPSYSTEMCOMPONENT'>1</Property>
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id="TempFolder">
<Directory Id="INSTALLLOCATION" Name="~_tmpdir">
<Component Id='MyComponent' DiskId='1' Guid=''>
<File Id="File0" Name="Runtime.exe" Source="Runtime.exe" />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id='InstallFeature' Title='Install Feature' Level='1'>
<ComponentRef Id='MyComponent' />
</Feature>
<CustomAction Id="RunInstall" Return="ignore" Execute="deferred" FileKey="File0" ExeCommand="Runtime.exe" HideTarget="no" Impersonate="no" />
<CustomAction Id="RunUninstall" Return="ignore" Execute="deferred" FileKey="File0" ExeCommand="Runtime.exe" HideTarget="no" Impersonate="no" />
<InstallExecuteSequence>
<Custom Action="RunInstall" Before="InstallFinalize">NOT REMOVE~="ALL"</Custom>
<Custom Action="RunUninstall" Before="InstallFinalize">REMOVE~="ALL"</Custom>
</InstallExecuteSequence>
Runtime.exe 在安装应用程序时按预期启动,但在我卸载时出现错误“安装程序在安装此软件包时遇到意外错误。这可能表明此软件包有问题。错误代码为 2753”。
查看事件查看器可以更清楚地了解问题,它包含以下“安装程序在安装此软件包时遇到意外错误。这可能表明此软件包有问题。错误代码是 2753。参数是:File0 , , "。
所以,它似乎找不到 Runtime.exe 但我不知道为什么。该文件捆绑在 MSI 中,它在安装时运行,但我不知道为什么它在卸载时不运行。
非常感谢