0

我有一个 WIX 安装程序,它可以从外部 CAB 文件安装一些未版本控制的文件。

我的问题是我被告知在 InstallInitialize 之前我需要 RemoveExistingProducts 才能正确升级未版本化的文件。但是,它似乎被外部 cab 文件吓坏了,并不断给我一个错误,即该文件不在 CAB 文件中(即使它在)。

如果 RemoveExistingProducts 在 InstallExecute 之后,它第一次使用 CAB 文件正确安装,但在升级过程中不会升级文件

以下是一些片段:

<Media Id="2" Cabinet="Videos.cab" EmbedCab="no" CompressionLevel="none" />

...

<Component Id="Video01" Guid="{FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF}" DiskId="2" >
    <File Id="Video01.wmv"  DiskId="2" Vital="no" Source="BLAH.wmv" Name="Video01.wmv"/>
</Component>

...

<InstallExecuteSequence>
    <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWERPRODUCTFOUND</Custom>
    <!--<RemoveExistingProducts  After="InstallExecute" />-->
    <RemoveExistingProducts  Before="InstallInitialize" />
</InstallExecuteSequence>
4

1 回答 1

0

尝试为文件设置 DefaultVersion 属性并在 InstallExecute 之后添加 RemoveExisingProducts。如 MSDN 中所述:

Versioned Files Win—A versioned file gets installed over a nonversioned file.
于 2012-02-24T07:33:59.570 回答