wix,安装文件并运行bat文件

时间:2012-12-06 08:58:15

标签: wix

我在使用wix构建msi安装程序时遇到问题,这将安装一些bat文件并运行它。我在互联网上找到了一些例子,但我无法使其工作:/这是我的wix源文件

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="44A8F987-6B89-422B-B41F-1364AE1EF0D5" Name="my_name" Language="1033" Version="1.11.5164" Manufacturer="company" UpgradeCode="BD8652F4-1C1A-4825-9799-7DFB499B9F12">
        <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="CONFIGURE.BAT" DiskId="1" Guid="041ED78B-3D42-4EBD-8DAE-29D94DEFFC20">
                         <File KeyPath="yes" Id="file_configure.bat" Name="configure.bat" Source="C:\Documents and Settings\root\Desktop\some_path\configure.bat" />
                  </Component>  
                </Directory>
            </Directory>
        </Directory>
        <Feature Id="MainFeature" Title="Main Feature" Level="1">
                   <ComponentRef Id="CONFIGURE.BAT" />
        </Feature>
        <UI />
        <UIRef Id="WixUI_Minimal" />

        <CustomAction Id="BatchCmd" Property="BatchRun" Value="&quot;[#file_configure.bat]&quot;" Execute="immediate">
        </CustomAction>
        <CustomAction Id="BatchRun" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="yes">
        </CustomAction>
        <InstallExecuteSequence>
            <Custom Action="BatchCmd" Before="BatchRun">NOT Installed</Custom>
            <Custom Action="BatchRun" After="InstallFiles">NOT Installed</Custom>
        </InstallExecuteSequence>  
    </Product>
</Wix>

Configure.bat文件已正确安装,但在安装期间不会运行。 Plz帮助

0 个答案:

没有答案