我使用的是Wix3。当用户卸载产品时,我需要打开一个网页。
有什么想法可以做到吗?
谢谢。
发布于 2009-12-01 05:59:59
这是我们使用的代码示例,我们实际上并不在编译时设置URL,而是在MSI后期构建中更新属性,因此这看起来有点“过度设计”。我们使用WiXShellExec CA,并有一个附加条件,以便网页仅在卸载期间显示,而不在主要升级期间显示。
<Fragment>
<Property Id="MyURL"><![CDATA[http://www.blah.blah.blah/]]></Property>
<CustomAction Id="SetOpenURL" Property="WixShellExecTarget" Value="[MyURL]" />
<CustomAction Id="OpenURL" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" Return="ignore" />
<InstallExecuteSequence>
<!-- Launch webpage during full uninstall, but not upgrade -->
<Custom Action="SetOpenURL" After="InstallFinalize"><![CDATA[REMOVE ~= "ALL" AND NOT UPGRADINGPRODUCTCODE]]></Custom>
<Custom Action="OpenURL" After="SetOpenURL"><![CDATA[REMOVE ~= "ALL" AND NOT UPGRADINGPRODUCTCODE]]></Custom>
</InstallExecuteSequence>
</Fragment>发布于 2009-11-30 23:29:41
将这些XML元素添加到您的<Product>元素下:
<CustomAction Id="LaunchBrowser"
ExeCommand="explorer.exe http://www.google.com"
Directory="INSTALLDIR"
Return="asyncNoWait" >
REMOVE="ALL"
</CustomAction>
<InstallExecuteSequence>
<Custom Action="LaunchBrowser" After="InstallValidate"/>
</InstallExecuteSequence>REMOVE="ALL"条件将确保仅当产品被完全删除时才执行自定义操作。
After="InstallValidate"确保在知道REMOVE property值之后立即执行自定义操作。
发布于 2018-02-03 17:47:01
FireGiant Launch the Internet提供的示例对我不起作用,但它激励我提出自己的解决方案,如下所示。
条件NOT Installed表示新安装,而Installed表示仅在卸载时触发。
<CustomAction Id="LaunchBrowser" Directory="INSTALLDIR" Return="asyncNoWait" ExeCommand="explorer.exe http://www.google.com/" />
<InstallExecuteSequence>
<Custom Action="LaunchBrowser" After="InstallFinalize">Installed</Custom>
</InstallExecuteSequence>https://stackoverflow.com/questions/1819686
复制相似问题