0

我正在使用 WIX 创建一个 MSI,它需要特定版本的 MS VC 2008 x64 Redistributable。MSI 也适用于基于 x64 的产品。

vcredist_setup.exe我有我需要的 64 位版本的可再发行组件的 Microsoft (我将其重命名vc90redist_x64.exe为我自己的参考)。

这是我用来定义二进制文件的 WiX XML:

<Binary Id='_VC_X64_REDIST_' SourceFile='redist\vc90redist_x64.exe' />

自定义操作

<CustomAction Id='_INSTALL_REDIST_'
              BinaryKey='_VC_X64_REDIST_'
              ExeCommand='/q /l c:\temp\vc.log'
              Execute='deferred'
              Return='asyncWait' />

注意:我添加了“/lc:\temp\vc.log”以查看 EXE 文件是否已达到尝试安装的程度。

注意:我已经尝试过Return='check'Execute='Immediate'.

并调用自定义操作..

<InstallExecuteSequence>
    <Custom Action='_INSTALL_REDIST_' After='InstallFiles'>
        NOT Installed
    </Custom>
</InstallExecuteSequence>

注意:我尝试了各种 After/Before 值,上面的一个似乎在日志文件中给了我最好的结果!但是还是没有安装。

当我运行安装 MSI 文件时,我的产品被安装,但可再发行组件没有(也就是说,C:\temp\vc.txt没有创建。如果我之后手动运行可再发行组件,它会提示我安装;“删除程序”中没有条目' 列表)。

使用上述设置运行时,我得到以下信息

'msiexec /i my.msi /l*v log.txt'

这是日志的摘录(向右滚动以查看完整的行):

Action ended 10:54:27: InstallFiles. Return value 1.
MSI (s) (64:E8) [10:54:27:655]: Doing action: _INSTALL_REDIST_
MSI (s) (64:E8) [10:54:27:655]: Note: 1: 2205 2:  3: ActionText
Action start 10:54:27: _INSTALL_REDIST_.
Action ended 10:54:27: _INSTALL_REDIST_. Return value 1.
...
MSI (s) (64:E8) [10:54:50:905]: Executing op: ActionStart(Name=_INSTALL_REDIST_,,)
MSI (s) (64:E8) [10:54:51:233]: Executing op: CustomActionSchedule(Action=_INSTALL_REDIST_,ActionType=1154,Source=BinaryData,Target=/q /l c:\temp\vc.log,)
...
MSI (s) (64:E8) [10:54:51:889]: Executing op: ActionStart(Name=PublishFeatures,Description=Publishing Product Features,Template=Feature: [1])
MSI (s) (64:E8) [10:54:51:889]: Executing op: FeaturePublish(Feature=Complete,,Absent=2,Component=<VERY LONG BINARY ASCII LOOKING THING>
   ...  1: _INSTALL_REDIST_ 2: 1631
...

这是日志中最后一次提到_INSTALL_REDIST_。

我该如何解决这个问题?

(我搜索了 Stack Overflow 和大多数WiX参考资料和博客,但我没有设法做到这一点)

4

0 回答 0