首页 > 解决方案 > 在捆绑链执行结束时运行 PowerShell 脚本

问题描述

我正在使用 Wix Bootstrapper 创建一个 exe 安装程序。

在捆绑链中,我正在安装一些 exe 文件。

最后我想执行一个 PowerShell 脚本来做一些额外的任务。这怎么可能

这是捆绑链,我已经提到要在哪里执行 PowerShell 脚本。

   <Bundle Name="sample" Version="0.0.0.0" Manufacturer="$(var.Manufacturer)" UpgradeCode="fsfsddssdsdsd">
        <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
        <Chain>

            <ExePackage
                SourceFile="something.exe"
                InstallCommand="/install /quiet /norestart"
                PerMachine="yes" >
            </ExePackage>

            <ExePackage
                SourceFile="anything.exe"
                InstallCommand="/install /quiet /norestart"
                PerMachine="yes" >
            </ExePackage>


            **EXECUTE POWERSHELL SCRIPT HERE**
            
        </Chain>
    </Bundle>

提前感谢您的帮助

标签: wixwindows-installerwix3.5bootstrapperwix3.7

解决方案


我现在可以看到两个选项:

  1. 创建正在做所有事情的 msi。

您可以按照此处所述运行 powershell 脚本

  1. 创建您自己的引导程序应用程序,该应用程序将在安装所有 exe 后运行脚本。我记得这个案子有一个特殊的事件。

在这里您可以找到关于它的精彩文章 (C#)。你也可以很容易地找到如何使用 C++ 来做到这一点。


推荐阅读