无法从WIX安装运行默认浏览器

时间:2014-12-17 16:42:55

标签: wix windows-installer wix3.8

From tutorial

<Property Id="BROWSER">
  <RegistrySearch Id='DefaultBrowser' Type='raw' Root='HKCR' Key='http\shell\open\command' />
</Property>

<CustomAction Id='LaunchBrowser' Property='BROWSER' ExeCommand='www.something.com' Return='asyncNoWait' />

<InstallExecuteSequence>
  ...
  <Custom Action='LaunchBrowser' After='InstallFinalize'>NOT Installed</Custom>
</InstallExecuteSequence>

正如我从安装跟踪中看到的,属性BROWSER正确计算:

  

属性(S):BROWSER =“C:\ Program Files(x86)\ Internet   Explorer \ iexplore.exe“ - nohome

但安装后浏览器未打开。

  

MSI(88:90)[18:38:30:331]:采取行动:LaunchBrowser MSI(s)   (88:90)[18:38:30:331]:注意:1:2205 2:3:ActionText动作开始   18:38:30:LaunchBrowser。行动结束18:38:30:安装。返回值   1.行动结束18:38:30:LaunchBrowser。返回值1631.
  ...
  MSI(c)(64:6C)[18:38:30:409]:产品:WebPrintingService - 安装成功完成。

可能有什么不对?

Windows 7。 UAC - 默认。

更新:
作为一种解决方法,可以使用以下代码(但我不确定它是一个很好的解决方法):

<Property Id="BROWSER">
  <RegistrySearch Id='DefaultBrowser' Type='raw' Root='HKCR' Key='http\shell\open\command' />
</Property>

<CustomAction Id="LaunchBrowser" Directory="INSTALLDIR" Impersonate="no" Execute="deferred" ExeCommand='[BROWSER] "test.html"' Return="check"/>

<InstallExecuteSequence>
  <Custom Action='LaunchBrowser' Before='InstallFinalize'>NOT Installed</Custom>
</InstallExecuteSequence>

1 个答案:

答案 0 :(得分:0)

我没有制作一个可以在安装后运行默认浏览器的安装程序,但我已经使用WiX安装了启动已安装应用程序的安装程序。据我所知,ExeCommand属性必须包含可执行文件的文件路径。它可以是您计算机上的路径,也可以是您定义的包含文件路径的字符串属性。也许你可以告诉程序它应该打开的文件,在你的情况下是一个网站。

我希望这会有所帮助。