解决方法
以下是我们使用的代码示例,我们实际上并没有在编译时设置URL,而是在MSI后期构建中更新属性,因此这可能看起来有点“过度设计”.我们使用WiX
ShellExec 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>