在包链执行结束时运行 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>

在此先感谢您的帮助

解决方法

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

  1. 创建可以处理所有事情的 msi。

您可以按照 here

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

在这里您可以找到great article about it (C#)。你也可以很容易地找到如何使用 C++ 来做到这一点。