这个'运行可执行'Wix xml代码有什么问题?

时间:2015-06-04 10:18:09

标签: wix windows-installer installer

我正在尝试使用 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>

1 个答案:

答案 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

另见Start application after installation