2014-02-24 70 views
2

我試圖爲我的應用程序實現以下自更新機制:如果有更新可用,我的應用程序將下載(WiX生成的)MSI包並將其寫入其具有任意名稱的AppData文件夾。然後,應用程序通過調用Windows安裝程序錯誤1316.安裝程序查找錯誤的文件名

msiexec /fvomus "<ArbitraryName>.msi" /qn /L "<ArbitraryName>.msi.log" REINSTALL=ALL REINSTALLMODE=vomus 

有了這個,我得到一個錯誤開始更新過程1316並安裝,然後用錯誤狀態1603

微星的原始文件名是CCWirelessServer.msi,終止但正如我所說之前,我的應用程序使用任意名稱編寫安裝程序包,例如ba17b82d-0ab8-4fc9-aea8-62830042d49f.msi。現在我注意到Windows Installer出於某種原因正在尋找CCWirelessServer.msi文件,而不是正確的臨時文件名。你可以在下面的日誌中看到這個。

爲什麼Windows Installer不使用通過命令行提供的文件名?這是我的命令行參數還是安裝程序包的問題?

這裏是日誌:

=== Logging started: 24.02.2014 09:16:30 === 
Action start 09:16:30: INSTALL. 
Action start 09:16:30: FindRelatedProducts. 
Action ended 09:16:30: FindRelatedProducts. Return value 0. 
Action start 09:16:30: ValidateProductID. 
Action ended 09:16:30: ValidateProductID. Return value 1. 
Action start 09:16:30: CostInitialize. 
Action ended 09:16:30: CostInitialize. Return value 1. 
Action start 09:16:30: FileCost. 
Action ended 09:16:30: FileCost. Return value 1. 
Action start 09:16:30: CostFinalize. 
Action ended 09:16:30: CostFinalize. Return value 1. 
Action start 09:16:30: MigrateFeatureStates. 
Action ended 09:16:30: MigrateFeatureStates. Return value 0. 
Action start 09:16:30: InstallValidate. 
Action ended 09:16:30: InstallValidate. Return value 1. 
Action start 09:16:30: RemoveExistingProducts. 
Action ended 09:16:30: RemoveExistingProducts. Return value 0. 
Action start 09:16:30: InstallInitialize. 
Action ended 09:16:30: InstallInitialize. Return value 1. 
Action start 09:16:30: ProcessComponents. 
Action ended 09:16:30: ProcessComponents. Return value 1. 
Action start 09:16:30: UnpublishFeatures. 
Action ended 09:16:30: UnpublishFeatures. Return value 1. 
Action start 09:16:30: RemoveRegistryValues. 
Action ended 09:16:30: RemoveRegistryValues. Return value 1. 
Action start 09:16:30: RemoveShortcuts. 
Action ended 09:16:30: RemoveShortcuts. Return value 1. 
Action start 09:16:30: CAUninstallAsService. 
Action ended 09:16:30: CAUninstallAsService. Return value 1. 
Action start 09:16:30: RemoveFiles. 
Action ended 09:16:30: RemoveFiles. Return value 1. 
Action start 09:16:30: InstallFiles. 
Action ended 09:16:30: InstallFiles. Return value 1. 
Action start 09:16:30: CAInstallAsServiceRollback. 
Action ended 09:16:30: CAInstallAsServiceRollback. Return value 1. 
Action start 09:16:30: CAInstallAsService. 
Action ended 09:16:30: CAInstallAsService. Return value 1. 
Action start 09:16:30: CreateShortcuts. 
Action ended 09:16:30: CreateShortcuts. Return value 1. 
Action start 09:16:30: WriteRegistryValues. 
Action ended 09:16:30: WriteRegistryValues. Return value 1. 
Action start 09:16:30: RegisterUser. 
Action ended 09:16:30: RegisterUser. Return value 0. 
Action start 09:16:30: RegisterProduct. 
MSI (s) (4C:50) [09:16:30:406]: Product: Wireless Server -- Error 1316. A network error occurred while attempting to read from the file: C:\ProgramData\MyCompanyName\Wireless Server\Updates\CCWirelessServer.msi 

Error 1316. A network error occurred while attempting to read from the file: C:\ProgramData\MyCompanyName\Wireless Server\Updates\CCWirelessServer.msi 
Action ended 09:16:30: RegisterProduct. Return value 3. 
Action ended 09:16:30: INSTALL. Return value 3. 
MSI (s) (4C:50) [09:16:30:419]: Windows Installer reconfigured the product. Product Name: Wireless Server. Product Version: 1.0.0.0. Product Language: 1033. Manufacturer: MyCompanyName. Reconfiguration success or error status: 1603. 

=== Logging stopped: 24.02.2014 09:16:30 === 

編輯1:

只是爲了驗證這個問題是我已經嘗試過的原文件名寫更新程序包的任意文件名安裝程序,它的工作原理!

回答

3

不支持嘗試更改MSI的文件名並執行次要升級。請參閱:

Windows Installer Best Practices

存包名稱和包裝代碼一致。

的.msi文件可以給予幫助用戶識別 包的任何名字,但這個名字應該不無也改變 產品代碼被改變。

•給您的.msi文件一個用戶友好的名稱,使用戶能夠 標識Windows Installer軟件包的內容。

•產品代碼是應用程序 的主要標識,必須在對 應用程序進行全面更新時進行更改。有關信息,請參閱產品代碼和更改產品代碼 。更改應用程序的.msi文件的名稱被認爲是 全面更改,並始終要求相應更改 產品代碼以保持一致性。

•軟件包代碼是安裝程序用於 的主要標識符,用於搜索並驗證給定安裝的正確軟件包。 沒有兩個不同的.msi文件應該具有相同的軟件包代碼。 如果在不更改包代碼的情況下更改包,則 安裝程序可能不會使用較新的包,前提是安裝程序仍然可以訪問 。軟件包代碼存儲在摘要信息流的摘要屬性的修訂號 中。

•請注意,產品代碼和包裝代碼GUID中的字母必須全部爲 大寫。

Changing the Product Code

如有以下爲 是真正的更新產品代碼必須改變:

•在 同一系統上兩個原裝產品和更新產品的共存安裝必須成爲可能。

•.msi文件的名稱已更改。

•現有組件的組件代碼已更改。

•將組件從現有功能中刪除。

•現有功能已被製作爲現有 功能的子功能。

•現有子功能已從其父功能中刪除。

Why does changing the name of your MSI file require a Major Upgrade?