[英]WiX upgrade question - file's major version was incremented, but revision is lower, now old file removed, yet new file is not copied during upgrade
我根據目錄(它是一個Web應用程序)為我的安裝程序自動生成一個WiX文件,它包含對以下3個.Net程序集的引用:
以下是生成的WiX片段:
<Fragment>
<DirectoryRef Id="bin">
<Component Id="bin.Migrator.dll" Guid="*">
<File Id="bin.Migrator.dll" Name="Migrator.dll" KeyPath="yes" Source="..\WebApplication\bin\Migrator.dll" />
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="bin">
<Component Id="bin.Migrator.Framework.dll" Guid="*">
<File Id="bin.Migrator.Framework.dll" Name="Migrator.Framework.dll" KeyPath="yes" Source="..\WebApplication\bin\Migrator.Framework.dll" />
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="bin">
<Component Id="bin.Migrator.Providers.dll" Guid="*">
<File Id="bin.Migrator.Providers.dll" Name="Migrator.Providers.dll" KeyPath="yes" Source="..\WebApplication\bin\Migrator.Providers.dll" />
</Component>
</DirectoryRef>
</Fragment>
我們一直使用相同的基本安裝程序結構一年左右,但最近我們將Migrator.Net庫更新為一個新的內部構建,看到版本號和程序集標題/描述屬性發生了變化(從Orca中轉出)
在升級庫之后:
雖然次要版本較高,但修訂版現在為1而不是1317。
從那時起,我們發現升級到新版本導致這3個文件沒有被復制(因此升級過程會刪除舊文件,但不會安裝新文件)。
這是否與更改程序集的版本號有關,如果有,是否有任何方法可以覆蓋此行為(我們只想刪除所有內容,然后將所有內容復制到新的,無論版本如何)。
有趣的是,如果你安裝,然后重新運行安裝程序並進行“修復”它會復制新文件 - 我認為這是因為修復文件時不再存在,所以文件版本檢查邏輯不適用?
關於它如何工作以及如何避免我們所遇到的升級問題的任何提示將不勝感激。
如鏈接問題所示,您可以嘗試重新安排RemoveExistingProducts,以便在安裝任何新文件之前刪除舊產品,如下所示:
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallValidate" />
<!-- other actions -->
</InstallExecuteSequence>
另一種選擇是修改REINSTALLMODE
屬性,並用a
替換e
模式,這意味着它的值將是amus
。 這樣就可以重新安裝所有文件,操作需要更長時間,但更可靠。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.