我的安装程序的32位和64位版本(几乎)具有完全相同的代码和版本。自定义操作序列(只有与此问题无关的细微差别)
我希望我的安装程序检测它是否已经安装过,在这种情况下运行我自己的代码而不是显示默认的Windows Installer错误:
此产品的另一个版本已安装。安装 这个版本无法继续。配置或删除现有的 如果是本产品的版本,请使用“控制面板”上的“添加/删除程序”。
我的32位安装程序运行完全正常,因为如果我在安装产品时运行安装程序,它运行我的自定义代码,但相同的代码和我的64位安装程序中的自定义操作无法正常工作,并始终显示不需要的错误信息。
CheckPreviousVersion是第一个在UI序列中被称为自定义动作的函数,我尝试将它放在不同的位置,比如在InstallValidate之后,但没有任何作用。
我已经检查了详细的日志文件,但我找不到任何可能解释此行为的内容,这里是日志的一部分:
=== Verbose logging started: 05/03/2013 16:27:20 Build type: SHIP UNICODE 5.00.7601.00 Calling process: C:\Windows\system32\msiexec.exe
===
MSI (c) (0C:94) [16:27:20:331]: Machine policy value 'Debug' is 0 MSI (c) (0C:94) [16:27:20:331]: ******* RunEngine:
******* Product: foo.msi
******* Action:
******* CommandLine: ********** MSI (c) (0C:94) [16:27:21:546]: Machine policy value 'DisableUserInstalls' is 0 MSI (c) (0C:94) [16:27:21:557]: SOFTWARE RESTRICTION POLICY: Verifying package --> 'C:\Builds\.msi' against software restriction policy MSI (c) (0C:94) [16:27:21:557]: Note: 1: 2262 2: DigitalSignature 3:
-2147287038 MSI (c) (0C:94) [16:27:21:557]: SOFTWARE RESTRICTION POLICY: C:\Builds\.msi is not digitally signed MSI (c) (0C:94) [16:27:21:558]: SOFTWARE RESTRICTION POLICY: C:\Builds.msi is permitted to run at the 'unrestricted' authorization level. MSI (c) (0C:94) [16:27:21:584]: Cloaking enabled. MSI (c) (0C:94) [16:27:21:584]: Attempting to enable all disabled privileges before calling Install on Server MSI (c) (0C:94) [16:27:21:586]: End dialog not enabled MSI (c) (0C:94) [16:27:21:586]: Original package ==> C:\Builds\....msi MSI (c) (0C:94) [16:27:21:586]: Package we're running from ==> C:\Builds\.....msi MSI (c) (0C:94) [16:27:21:589]: APPCOMPAT: Uninstall Flags override found. MSI (c) (0C:94) [16:27:21:589]: APPCOMPAT: Uninstall VersionNT override found. MSI (c) (0C:94) [16:27:21:589]: APPCOMPAT: Uninstall ServicePackLevel override found. MSI (c) (0C:94) [16:27:21:589]: APPCOMPAT: looking for appcompat database entry with ProductCode '{B8CBA92E-2140-48AB-B4EA-A4C3FF10295B}'. MSI (c) (0C:94) [16:27:21:589]: APPCOMPAT: no matching ProductCode found in database. MSI (c) (0C:94) [16:27:21:599]: MSCOREE not loaded loading copy from system32 MSI (c) (0C:94) [16:27:21:608]: Machine policy value 'DisablePatch' is 0 MSI (c) (0C:94) [16:27:21:608]: Machine policy value 'AllowLockdownPatch' is 0 MSI (c) (0C:94) [16:27:21:608]: Machine policy value 'DisableLUAPatching' is 0 MSI (c) (0C:94) [16:27:21:608]: Machine policy value 'DisableFlyWeightPatching' is 0 MSI (c) (0C:94) [16:27:21:609]: APPCOMPAT: looking for appcompat database entry with ProductCode '{}'. MSI (c) (0C:94) [16:27:21:609]: APPCOMPAT: no matching ProductCode found in database. MSI (c) (0C:94) [16:27:21:609]: Transforms are not secure. MSI (c) (0C:94) [16:27:21:609]: PROPERTY CHANGE: Adding MsiLogFileLocation property. Its value is 'C:\Builds\Angoss\Products\Workstation\single-exec\INSTALL64.LOG'. MSI (c) (0C:94) [16:27:21:609]: Command Line: CURRENTDIRECTORY=C:\Builds\Angoss\Products\Workstation\single-exec CLIENTUILEVEL=0 CLIENTPROCESSID=7948 MSI (c) (0C:94) [16:27:21:609]: PROPERTY CHANGE: Adding PackageCode property. Its value is '{}'. MSI (c) (0C:94) [16:27:21:609]: Product Code passed to Engine.Initialize: '' MSI (c) (0C:94) [16:27:21:609]: Product Code from property table before transforms: '{}' MSI (c) (0C:94) [16:27:21:609]: Product Code from property table after transforms: '{}' MSI (c) (0C:94) [16:27:21:609]: Product registered: entering maintenance mode MSI (c) (0C:94) [16:27:21:609]: Determined that existing product (either this product or the product being upgraded with a patch) is installed per-machine. MSI (c) (0C:94) [16:27:21:609]: PROPERTY CHANGE: Adding ProductState property. Its value is '5'. MSI (c) (0C:94) [16:27:21:609]: PROPERTY CHANGE: Adding ProductToBeRegistered property. Its value is '1'. MSI (c) (0C:94) [16:27:21:609]: Entering CMsiConfigurationManager::SetLastUsedSource. MSI (c) (0C:94) [16:27:21:609]: Specifed source is already in a list. MSI (c) (0C:94) [16:27:21:609]: User policy value 'SearchOrder' is 'nmu' MSI (c) (0C:94) [16:27:21:609]: Machine policy value 'DisableBrowse' is 0 MSI (c) (0C:94) [16:27:21:609]: Machine policy value 'AllowLockdownBrowse' is 0 MSI (c) (0C:94) [16:27:21:609]: Adding new sources is allowed. MSI (c) (0C:94) [16:27:21:609]: PROPERTY CHANGE: Adding PackagecodeChanging property. Its value is '1'. Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel.
答案 0 :(得分:6)
此消息通常仅在开发阶段出现,而不是在最终用户计算机上出现。出现该消息是因为您只修改了包中的资源并重建它,而不增加版本号,因此Windows Installer发现在计算机上有一个包含相同产品代码和名称的包,但是一个不同的包裹代码。
您的用户永远不会收到此消息,因为我假设您在发布包时会增加版本号。这也取决于您的功能名称,即“CheckPreviousVersion”。
如果您希望在计算机上找到旧版本时出现自定义消息,请确保首先安装旧版本,但您当前安装了最新版本,但使用其他先前构建的软件包(即不同的软件包代码)
答案 1 :(得分:4)
如果您使用的是BasicMSI安装程序,则可以创建一个系统搜索来检查以下注册表项:
HKEY_LOCAL_MACHINE \ SOFTWARE \(Wow6432Node)\微软\的Windows \ CurrentVersion \卸载\ YOURPRODUCTCODE
如果此密钥可用,则计算机上会安装旧版本的安装程序。现在创建一个自定义操作,放在“CheckPreviousVersion”之前运行您的代码。通过系统搜索将此自定义操作的条件设置为属性。
这应该可以解决问题。