Windows Installer Error 1316. Installer looks for wrong filename

陌路散爱 提交于 2019-12-13 14:14:37

问题


I'm trying to implement the following self-update mechanism for my application: If an update is available, my application downloads the (WiX generated) MSI package and writes it to its AppData folder with an arbitrary name. The application then initiates the update process by calling

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

With this I get an error 1316 and the installation then terminates with error status 1603.

The original filename of the MSI is CCWirelessServer.msi, but as I said before, my application writes the installer package with an arbitrary name, for example ba17b82d-0ab8-4fc9-aea8-62830042d49f.msi. Now what I noticed is that Windows Installer is for some reason looking for a CCWirelessServer.msi file and not for the correct temporary filename. You can see this in the log below.

Why is Windows Installer not using the filename I provided via command line? Is it a problem with my command line arguments or with the installer package?

Here is the log:

=== 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 ===

Edit 1:

Just to verify that the problem is with the arbitrary filename I tried write the update package with the original filename of the installer, and it works!


回答1:


Trying to change the filename of the MSI and performing a minor upgrade is not supported. See:

Windows Installer Best Practices

Keep package names and package codes consistent.

The .msi file can be given any name that helps users identify the package, but the name should not be changed without also changing the product code.

•Give your .msi file a user-friendly name that enables the user to identify the contents of the Windows Installer package.

•The product code is the principal identification of an application and must change whenever there is a comprehensive update to the application. For information, see ProductCode and Changing the Product Code. Changing the name of the application's .msi file is considered a comprehensive change and always requires a corresponding change of the product code to maintain consistency.

•The package code is the primary identifier used by the installer to search for and validate the correct package for a given installation. No two nonidentical .msi files should ever have the same package code. If a package is changed without changing the package code, the installer may not use the newer package if both are still accessible to the installer. The package code is stored in the Revision Number Summary Property of the Summary Information Stream.

•Note that letters in product code and package code GUIDs must all be uppercase.

Changing the Product Code

The product code must be changed if any of the following are true for the update:

•Coexisting installations of both original and updated products on the same system must be possible.

•The name of the .msi file has been changed.

•The component code of an existing component has changed.

•A component is removed from an existing feature.

•An existing feature has been made into a child of an existing feature.

•An existing child feature has been removed from its parent feature.

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



来源:https://stackoverflow.com/questions/21982496/windows-installer-error-1316-installer-looks-for-wrong-filename

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!