Similiar問題:Reusing WIX components to speed up candle/light在維克斯如何使用ReuseCabinetCache安裝
我的項目有非常相同的問題,因爲一個參考;每次需要構建時,一個非常大的靜態數據庫永遠不會更改壓縮到msi中。我想這樣做的問題是:重新使用預壓縮的cab文件來加快構建時間。
我開始按照答案的建議使用cabCache屬性。我添加了以下到.wixproj:
<CabinetCachePath>cabs</CabinetCachePath>
<ReuseCabinetCache>True</ReuseCabinetCache>
我再分隔的靜態數據裝入一個片段:
<Fragmet>
<Media Id="2" Cabinet="static.cab" EmbedCab="no" />
<Component Id="staticCab" Guid="..." >
Files ...
</Component>
並將該片段中的特徵引用:
<ComponentRef Id="staticCab" />
這創建了cab文件,但保留爲空。我的下一個想法是使用合併模塊。我創建模塊:
<Module Id="StaticModule" Language="1033" Version="1.0.0.0" >
<Package ...>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="MergeRedirectFolder" Name=".">
<Component Id="StaticFiles" Guid="...">
Files...
</ -- End all XML Tags
然後它合併:
<Directory Id="StaticDir" Name="static">
<Merge Id="StaticModule" Language="1033" src="..\Static\bin\Release\static.msm" />
</Directory>
<Feature ...>
<MergeRef Id="StaticModule"/>
</Feature>
即使在這一切之後,CabinetCache仍在重建每次。
我想我的問題是什麼是使用ReuseCabinetCache的正確方法。我仍然在學習WIX,所以如果答案很明顯,我很抱歉。我只是不確定如何使用它。
編輯: MergeModule不會很理想,因爲不需要與其他msi共享該邏輯。這對於單個開發團隊的這個單一項目是有用的。