我正在尝试使用 your.exe 执行 my.exe 。它没有按预期工作。
以下是代码段:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="my_name" Language="1033" Version="1.11.5164"
Manufacturer="company" UpgradeCode="PUT-GUID-HERE">
<Package Description="Test file in a Product" Comments="Simple test"
InstallerVersion="200" Compressed="yes" />
<Media Id="1" Cabinet="simple.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Name="my_folder" Id="MY_FOLDER">
<Component Id="your.EXE" DiskId="1" Guid="*">
<File KeyPath="yes" Id="your.exe" Name="your.exe"
Source="your.exe" />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="MainFeature" Title="Main Feature" Level="1">
<ComponentRef Id="your.EXE" />
</Feature>
<CustomAction Id="StartAppOnExit" Property="StartAppOnExit" ExeCommand="[SystemFolder]cmd.exe /C your.exe my.exe " Execute="immediate" Return="asyncNoWait" />
<InstallExecuteSequence>
<Custom Action="StartAppOnExit" After="InstallFinalize">NOT Installed</Custom>
</InstallExecuteSequence>
</Product>
</Wix>
答案 0 :(得分:0)
自定义操作StartAppOnExit
无法找到 your.exe 。尝试使用Directory
属性而不是Property
属性:
<CustomAction Id="StartAppOnExit" Directory="MY_FOLDER" ExeCommand="[SystemFolder]cmd.exe /C your.exe my.exe " Execute="immediate" Return="asyncNoWait" />
<InstallExecuteSequence>
<Custom Action="StartAppOnExit" After="InstallFinalize">NOT Installed</Custom>
</InstallExecuteSequence>
这应该运行 your.exe 传递参数 my.exe 。