2016-07-27 210 views
0

我已經構建了一個使用WiX的安裝程序,它允許用戶將當前安裝升級到下一個版本並更改安裝文件夾的位置。這可以在使用.msi文件時起作用,但在使用msiexec靜默運行時,我的設置INSTALLDIR將在稍後的安裝過程中被覆蓋。通過靜默安裝WiX安裝程序更改升級位置

我看了一下日誌,它正在用當前安裝目錄寫下來。我有一個屬性,它在註冊表中搜索當前安裝位置,並將INSTALLDIR設置爲該值。

我想在.msi UI值中,事情按照正確的順序運行,但通過靜默安裝,它們不是。

MSI (s) (A0:90) [09:47:34:315]: PROPERTY CHANGE: Modifying INSTALLDIR property. Its current value is 'C:\SpecifiedInSilentInstall'. Its new value: 'C:\CurrentInstallDirectoryFromRegistry\'. 

有什麼方法可以指定CustomAction或其他?

回答

0

如果您使用的是像這樣

<CustomAction Id="SetInstallDir" Property="INSTALLDIR" Value="[YourInstallDir]" /> 

自定義操作,你可以在時間它在你的<InstallExecuteSequence>節這樣

<Custom Action="SetInstallDir" Before="CostFinalize" /> 

在這裏,您可以時間BeforeAfter您的活動。這些事件按特定順序(從FIREGIANT拍攝)

  • AppSearch
  • LaunchConditions
  • ValidateProductID
  • CostInitialize
  • FileCost
  • CostFinalize
  • InstallValidate
  • InstallInitialize
  • ProcessComponents
  • UnpublishFeatures
  • RemoveShortcuts
  • RemoveFiles
  • InstallFiles
  • CreateShortcuts
  • RegisterUser
  • RegisterProduct
  • PublishFeatures
  • 個PublishProduct
  • InstallFinalize
  • RemoveExistingProducts

對於財產INSTALLDIR在合適的情況下將其設置爲生效(無論您的需求)是很重要的。對我來說Before=CostFinalize改變了我想要的路徑。

相關問題