【发布时间】:2020-06-16 01:18:37
【问题描述】:
我正在使用 wix 工具集创建一个 MSI 安装程序。
我的 MSI 将在自定义操作中运行 powershell 脚本。 然后,powershell 脚本(MYSCRIPT.ps1)将为依赖项执行安装程序。让我们将此依赖项命名为 D。
当我运行我的 powershell 脚本时,D 会完美地安装在我的系统中。
但是
当我运行从 wix 创建的 MSI 时,powershell 脚本运行但它无法安装 D。 为什么会这样。
我怀疑 Windows 不允许同时运行多个安装程序(我从 wix 生成的 MSI 和从 powershell 脚本执行的 D 安装程序)。
如何避免。
以下是我的 product.wxs 文件的一部分
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define Manufacturer="DWJIDWJDJ"?>
<Product Id="*" Name="JDCA" Language="1033" Version="0.0.0.0" Manufacturer="$(var.Manufacturer)" UpgradeCode="dad416b3-034d-49eb-9407-0b681e5108c3">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Property Id="ARPNOREPAIR" Value="yes" Secure="yes" />
<Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
<Feature Id="ProductFeature" Title="WDJNIDJDJW" Level="1">
<ComponentGroupRef Id="InstallScriptsGroup" />
<ComponentGroupRef Id="ResourcesGroup" />
</Feature>
<CustomAction Id="ComponentsInstallAction" Property="WixShellExecTarget" Directory="INSTALLFOLDER" ExeCommand ='"$(env.SystemRoot)\system32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass -NonInteractive -NoProfile -Command ./MYSCRIPT.ps1' Execute="deferred" Impersonate="no" Return="check" />
<InstallExecuteSequence>
<Custom Before="InstallFinalize" Action="ComponentsInstallAction">Not Installed or REINSTALL</Custom>
</InstallExecuteSequence>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="CommonAppDataFolder">
<Directory Id="IhmDir" Name="IHM">
<Directory Id="INSTALLFOLDER" Name="IhmZebraComponents" />
</Directory>
</Directory>
</Directory>
<ComponentGroup Id="InstallScriptsGroup" Directory="INSTALLFOLDER">
<Component Id="ComponentsInstallerScript" Guid="72cef904-4426-470d-a2d0-9545d0127f0a">
<File Id="ComponentsInstallerSscript" Source="MYSCRIPT.ps1" KeyPath="yes" Checksum="yes"/>
</Component>
</ComponentGroup>
<ComponentGroup Id="ResourcesGroup" Directory="INSTALLFOLDER">
CONTINUED
安装D的powershell脚本中的代码是
$Argument = "-S -f1`"$InstallResponseFile`""
$InstallProcess = Start-Process -Wait -FilePath $SetupFile -Argument $Argument -PassThru
LogWrite("| INFO | Completed execution of $SetupFile")
提前感谢您的帮助
【问题讨论】:
标签: wix windows-installer wix3.5 wix3