Windows 安装程序自定义操作错误 1631

发布于 2024-11-14 09:58:27 字数 467 浏览 2 评论 0原文

我正在为产品创建 msi 安装程序,安装后需要在浏览器中启动 web url。我使用 WIX 3.5 创建安装程序(但这可能并不重要)。 我在 http://www.tramontana.co.hu/wix/ 中找到的示例Lesson5.php#5.2 不起作用 - 安装程序日志说

“操作于 15:27:30 结束:LaunchBrowser。返回值 1631。”。

我看到了很多关于这个问题在互联网上,但没有人提供解决方案(有人在多语言中发现问题,有人联系微软来解决这个问题)。

我只能猜测问题出在 Windows 7 安全性的某个地方(我遇到了问题)。也许Windows安装程序被禁止启动exe文件(我尝试了许多其他带有其他exe文件的示例,但都得到了相同的结果)。

有人有通用的解决方案吗?

I'm creating msi-installer for a product and I need to launch web url in browser after installation. I use WIX 3.5 to create installer (but this probably doesn't important).
The example I found in http://www.tramontana.co.hu/wix/lesson5.php#5.2 not work - installer log say's

"Action ended 15:27:30: LaunchBrowser. Return value 1631.".

I saw many posts about this problem in the internet but nobody provides solution (somebody found problem in multilanguage, somebody contacted Microsoft to solve that).

I can only guess that the problem is somewhere in security of Windows 7 (I encountered problem with it). Maybe windows installer is forbidden to launch exe-files (I tried many other examples with other exe-s but all had the same result).

Has anybody a general solution?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

赏烟花じ飞满天 2024-11-21 09:58:27

我认为问题确实在于 UAC 安全性。
要给予自定义 Actinon 管理权限,我们应该使其延迟,如下所示:

<CustomAction Id="LaunchBrowser" Directory="TARGETDIR" Impersonate="no" Execute="deferred" ExeCommand="[BrowserExePath] [LaunchingUrl]" Return="check"/>

我强烈推荐 这篇关于自定义操作的博客文章 - 它完全改变了我对它们的看法。

I suppose the problem was really with UAC security.
To give a custom actinon administrative permissions we should make it deffered, like this:

<CustomAction Id="LaunchBrowser" Directory="TARGETDIR" Impersonate="no" Execute="deferred" ExeCommand="[BrowserExePath] [LaunchingUrl]" Return="check"/>

And I would highly recommend this blog post about custom actions - it completely changed my vision of them.

清醇 2024-11-21 09:58:27

这是我对安装和卸载所做的操作。

起初我也得到了“返回值 1631”,并花了很多时间在 UAC 安全、提升权限、Impersonate="yes" 和 Execute="deferred" 上,但这些都不起作用。

但最终当我正确设置 Directory="TARGETDIR" 而不是 BinaryKey="WixCA" 时,它就被非常简单地修复了

<Product>

...

<CustomAction Id="LaunchBrowserInstall" Directory="TARGETDIR" Execute="immediate" Impersonate="yes" Return="asyncNoWait" ExeCommand="explorer.exe https://www.example.com/post_install/" />

    <CustomAction Id="LaunchBrowserUninstall" Directory="TARGETDIR" Execute="immediate" Impersonate="yes" Return="asyncNoWait" ExeCommand="explorer.exe https://www.example.com/post_uninstall/" />

    <InstallExecuteSequence>
        <Custom Action="LaunchBrowserInstall" After="InstallFinalize">NOT Installed AND NOT REMOVE</Custom>
        <Custom Action="LaunchBrowserUninstall" After="InstallFinalize">REMOVE ~= "ALL"</Custom>
    </InstallExecuteSequence>

...

</Product>

Here is what I did for both install and uninstall.

At first I also got "Return value 1631" and spent a lot of time with UAC security, elevating privileges, Impersonate="yes" and Execute="deferred" which didn't work.

But in the end it was fixed very simply when I correctly set Directory="TARGETDIR" rather than BinaryKey="WixCA"

<Product>

...

<CustomAction Id="LaunchBrowserInstall" Directory="TARGETDIR" Execute="immediate" Impersonate="yes" Return="asyncNoWait" ExeCommand="explorer.exe https://www.example.com/post_install/" />

    <CustomAction Id="LaunchBrowserUninstall" Directory="TARGETDIR" Execute="immediate" Impersonate="yes" Return="asyncNoWait" ExeCommand="explorer.exe https://www.example.com/post_uninstall/" />

    <InstallExecuteSequence>
        <Custom Action="LaunchBrowserInstall" After="InstallFinalize">NOT Installed AND NOT REMOVE</Custom>
        <Custom Action="LaunchBrowserUninstall" After="InstallFinalize">REMOVE ~= "ALL"</Custom>
    </InstallExecuteSequence>

...

</Product>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文