【发布时间】:2015-06-14 11:08:22
【问题描述】:
我在 Google 或 Stackoverflow 上没有发现任何类似的问题。我很难让安装程序工作,安装程序是使用InnoSetup 创建的,然后使用MSIWrapper 包装到 .msi。我创建了安装程序并安装了程序,但它总是返回 1603 错误代码(我需要它才能成功进行自动安装)。似乎安装程序在注册表中找不到我的应用程序,或者至少找不到卸载密钥,我尝试更改密钥,创建全新安装,设置标志以显式创建卸载密钥等,我快用完了想法...
这是安装日志的一小部分:
-- CUSTOM ACTION -- Modify registry
-- CUSTOM ACTION -- ModifyRegistry: Start.
-- CUSTOM ACTION -- ModifyRegistry for application id {660F88C6-D271-4A56-81C5-8965E5E5144D}
-- CUSTOM ACTION -- ReadRegStr: Key=SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{660F88C6-D271-4A56-81C5-8965E5E5144D}, ValueName=UninstallString, 32 bit
-- CUSTOM ACTION -- ReadRegStr: Unable to open key.
-- CUSTOM ACTION -- ReadRegStr: Key=SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{660F88C6-D271-4A56-81C5-8965E5E5144D}, ValueName=UninstallString, 64 bit
-- CUSTOM ACTION -- ReadRegStr: Unable to open key.
-- CUSTOM ACTION -- ReadRegStr: Key=SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{660F88C6-D271-4A56-81C5-8965E5E5144D}, ValueName=UninstallString, default
-- CUSTOM ACTION -- ReadRegStr: Unable to open key.
-- CUSTOM ACTION -- ModifyRegistry: Error getting UninstallString value from registry.
-- CUSTOM ACTION -- Error modifying registry.
CustomAction bz.EarlyInstallFinish2 returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 8:48:10: InstallFinalize. Return value 3.
注意:即使我卸载应用并尝试全新安装也会发生这种情况...
整个日志:link
【问题讨论】:
-
Windows 会将 UninstallString 放入注册表仅供参考,因为它不会使用它来卸载产品。我不知道你想要那个字符串做什么,但你不需要它来执行卸载 - 只需使用 msiexec /x 命令或调用相关 API,例如 MsiConfigureProduct() 或等效的。
-
安装程序运行时返回错误(错误代码 1603)导致找不到密钥...
-
严格来说,安装程序会抛出 1603,因为自定义操作失败。根据自定义操作日志,它只假设是因为它找不到密钥。如果不查看自定义操作源,很难确定原因。
-
我们都明白问题是key还不存在,导致代码crash,返回1603。我要说的一点是,如果您希望获得此值,对其进行更改,然后将其写回注册表(作为人们尝试的一个示例),那么这是没有意义的,因为 Windows 不使用 UninstallString 来卸载 Windows Installer包裹。即使你得到这个工作,你在做什么也可能没有意义。另请注意,如果您知道软件包的 ProductCode,则无论如何都不需要知道 UninstallString。
标签: installation windows-installer