Windows Installer XML(WIX)帮助:无法通过execomand执行shell命令

Windows Installer XML(WIX)帮助:无法通过execomand执行shell命令,wix,windows-installer,Wix,Windows Installer,下面是我的代码。我需要在执行MSI文件后安装.inf和.cer文件。我试着参考各种wix资源,但什么也找不到。我正在虚拟机上测试安装程序,但它似乎不起作用。我是wix的新手,需要通过查看代码并指出我的错误来获得帮助 <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="*" Name="Cal" Lang

下面是我的代码。我需要在执行MSI文件后安装.inf和.cer文件。我试着参考各种wix资源,但什么也找不到。我正在虚拟机上测试安装程序,但它似乎不起作用。我是wix的新手,需要通过查看代码并指出我的错误来获得帮助

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*" Name="Cal" Language="1033" Version="1.0.0.0" Manufacturer="Cal" UpgradeCode="my-code">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />




    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate EmbedCab="yes" />


    <Feature Id="ProductFeature" Title="Cal" Level="1">
      <ComponentGroupRef Id="ProductComponents" />

    </Feature>
    <!--<CustomActionRef Id="InstallAction1" />-->
  </Product>

  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLFOLDER" Name="Cal" />
        <Directory Id="SilInst" Name="BackInst">
        </Directory>
      </Directory>
    </Directory>
  </Fragment>

  <Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">

      <Component Id="P2">
        <File Source="C1.sys" />
      </Component>


      <Component Id="P6">
        <File Source="C1.inf" />
      </Component>
      <Component Id="P7">
        <File Source="C1.cer" />
      </Component>

    </ComponentGroup>
  </Fragment>
  <Fragment>
    <CustomAction Id='InstallAction1' Directory='INSTALLFOLDER' ExeCommand='RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 C1.inf' Execute='deferred'
                      Return='check'/>
    <CustomAction Id='InstallAction2' Directory='INSTALLFOLDER' ExeCommand='certutil -addstore C1.cer -s -r localMachine trustedpublisher' Execute='deferred'
                     Return='check'/>


    <InstallExecuteSequence>
      <Custom Action="InstallAction2" After='InstallFiles'/>
     <Custom Action="InstallAction1" After='InstallAction2'/>
    </InstallExecuteSequence>
  </Fragment>
</Wix>

要进行故障排除,请创建安装日志,然后搜索自定义操作id。
在计算机上安装驱动程序和证书通常需要提升权限。因此,对自定义操作使用
Impersonate=“no”
。请参阅

在ORCA或InStAdDIT中打开MSI,如果您的自定义操作在其中,请在SturialExtExeSeQueNice表中检查。对于驱动程序安装,您应该考虑使用DIFXAPP扩展: