安装成功后如何执行文件?

发布于 2024-10-31 13:23:49 字数 87 浏览 1 评论 0原文

安装成功后如何执行外部文件?它位于 Windows\System32 文件夹中。 安装程序不应等待执行完成。

How can I execute external file after a successful installation? It's located in the Windows\System32 folder. Installer should not wait for execution finish.

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

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

发布评论

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

评论(3

紫罗兰の梦幻 2024-11-07 13:23:50

查看 WiX 教程的 干得好 部分,它解释了如何添加成功安装后启动应用程序的复选框。

Check out Well Done section of the WiX Tutorial, it explains how to add Checkbox to launch application after successful installation.

巴黎夜雨 2024-11-07 13:23:49

您可以定义一个自定义操作来描述您希望执行的应用程序,如下所示:

<CustomAction Id="LaunchApplication" FileKey="YourAppExe" ExeCommand="param1" Execute="immediate" Return="asyncNoWait" />

然后您可以使用以下命令将其绑定到您的安装执行序列中:

<InstallExecuteSequence>
  <Custom Action="LaunchApplication" After="InstallFinalize" />
</InstallExecuteSequence>

You can define a custom action that describes the application you wish to execute as follows:

<CustomAction Id="LaunchApplication" FileKey="YourAppExe" ExeCommand="param1" Execute="immediate" Return="asyncNoWait" />

You can then tie this into your installation execute sequence using the following:

<InstallExecuteSequence>
  <Custom Action="LaunchApplication" After="InstallFinalize" />
</InstallExecuteSequence>
忘东忘西忘不掉你 2024-11-07 13:23:49

要在用户单击“安装成功”对话框上的完成按钮时启动应用程序,可以使用以下代码(其中 LaunchOnExit.exe 指的是您安装的已安装文件的 ID)想要启动)

<Fragment>
    <CustomAction Id="SetLaunchApplicationTarget" Property="WixShellExecTarget" Value="[#LaunchOnExit.exe]" />
    <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="no" />

    <UI Id="LaunchApplication">
        <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="SetLaunchApplicationTarget">
            <![CDATA[NOT Installed]]>
        </Publish>
        <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">
            <![CDATA[NOT Installed]]>
        </Publish>
    </UI>
</Fragment>

如果您想在静默安装或 MSI 推出期间启动应用程序,请参阅 @Naishy 的答案。

To launch an application when the user clicks the Finish button on "Installation Successful" dialog, the following code will work (Where LaunchOnExit.exe refers to ID of installed file that you want to launch)

<Fragment>
    <CustomAction Id="SetLaunchApplicationTarget" Property="WixShellExecTarget" Value="[#LaunchOnExit.exe]" />
    <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="no" />

    <UI Id="LaunchApplication">
        <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="SetLaunchApplicationTarget">
            <![CDATA[NOT Installed]]>
        </Publish>
        <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">
            <![CDATA[NOT Installed]]>
        </Publish>
    </UI>
</Fragment>

If you're wanting to launch an application even during a silent installation or MSI rollout, refer @Naishy's answer.

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