在WiX中执行EXE文件

paw*_*lek 3 installer windows-installer wix

我尝试从WiX中的MSI文件执行EXE文件,但在执行InitializeSetup时出现1603错误.

Action ended 12:09:54: InstallValidate. Return value 1.
Action start 12:09:54: InstallInitialize.
Action ended 12:09:54: InstallInitialize. Return value 3.
Action ended 12:09:54: INSTALL. Return value 3.
Run Code Online (Sandbox Code Playgroud)

这个WiX脚本有什么问题?

 <Product Name='something' Id='11934d63-12d1-4792-829e-046de3bb987e'
  UpgradeCode='{a101616a-365c-44a7-bfcb-fafb356c2ea1}'
  Language='1033' Version='8.3.4' Manufacturer='something2'>

    <Package Id='*' InstallerVersion='200' Compressed='yes' />

    <Binary Id="Instalator.exe" SourceFile="d:\Instalator.exe"/>
    <CustomAction Id="LaunchFile" BinaryKey="Instalator.exe" ExeCommand="" Execute='deferred' Return='asyncNoWait' Impersonate='no'/>
    <InstallExecuteSequence>
        <Custom Action='LaunchFile' Before='InstallFinalize'/>
    </InstallExecuteSequence>
 </Product>
Run Code Online (Sandbox Code Playgroud)

我不知道为什么,但是当我添加:

<Directory Id='TARGETDIR' Name='SourceDir'>
        <Component Id='MainExecutable' Guid='1193cd63-12d1-4792-829e-046de3bb987e'>
        </Component>
</Directory>

<Feature Id='Complete' Level='1'>
  <ComponentRef Id='MainExecutable' />
</Feature>
Run Code Online (Sandbox Code Playgroud)

在包节点 - >然后它工作正常.我需要找出原因......

Chr*_*ter 5

我还有其他一些关于你在这里做什么的担忧,但是如果你真的需要退出EXE来完成你的安装,那么我建议使用Quiet Execution Custom Action.

你应该知道,由于种种原因,这不是一个好习惯.1)它不是声明性的,2)它不支持回滚.还有其他人,但那些是最大的IMO.

顺便说一句,WiX不是"脚本".了解这一点,你就会明白为什么不给EXE打电话.