Windows Installer无法找到注册表项

时间:2023-02-05 02:49:54

I'm building a multi-instance installer with InstallShield 2014 Premier and adding a key to the registry (from the Registry table):

我正在使用InstallShield 2014 Premier构建一个多实例安装程序,并在注册表中添加一个密钥(来自Registry表):

Registry   | Root | Key                                                    | Name | Value | Component           | ISAttributes
Registry34 | 2    | SOFTWARE\MyCompany\MyProduct\[InstanceId]\InstanceData | ENV  | [ENV] | ISRegistryComponent | 0

Key from registry after install:

安装后注册表中的键:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyCompany\MyProduct\0\InstanceData
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyCompany\MyProduct\1\InstanceData

Both contain the values I am expecting. However, when I search for them, I don't seem to be finding them (RegLocator table):

两者都包含我期望的值。但是,当我搜索它们时,我似乎没有找到它们(RegLocator表):

Signature     | Root | Key                                                    | Name | Type
NewSignature1 | 2    | SOFTWARE\MyCompany\MyProduct\[InstanceId]\InstanceData | ENV  | 18

Appsearch table has ENV | NewSignature1

Appsearch表有ENV | NewSignature1

I've tried on various occasions with and without the 64 bit search flag set (2 vs 18 in the Type).

无论是否设置了64位搜索标志,我都尝试了各种场合(Type中2 vs 18)。

From the install Log after uninstall, you will see the ENV property is not being set with the value from the registry ('PROD' is the default value of the ENV property):

从卸载后的安装日志中,您将看到未使用注册表中的值设置ENV属性('PROD'是ENV属性的默认值):

Action start 16:58:38: INSTALL.
MSI (s) (5C:C8) [16:58:38:080]: Running ExecuteSequence
MSI (s) (5C:C8) [16:58:38:080]: Doing action: AppSearch
Action start 16:58:38: AppSearch.
MSI (s) (5C:C8) [16:58:38:080]: Note: 1: 2262 2: Signature 3: -2147287038 
MSI (s) (5C:C8) [16:58:38:081]: PROPERTY CHANGE: Adding IISROOTFOLDER property. Its value is 'C:\inetpub\wwwroot\'.
MSI (s) (5C:C8) [16:58:38:081]: Note: 1: 2262 2: Signature 3: -2147287038 
MSI (s) (5C:C8) [16:58:38:081]: PROPERTY CHANGE: Adding DOTNETVERSION40FULL property. Its value is '#1'.
MSI (s) (5C:C8) [16:58:38:081]: Note: 1: 2262 2: Signature 3: -2147287038 
MSI (s) (5C:C8) [16:58:38:081]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\MyProduct\1\InstanceData 3: 2 
MSI (s) (5C:C8) [16:58:38:081]: Note: 1: 2262 2: Signature 3: -2147287038 
MSI (s) (5C:C8) [16:58:38:081]: PROPERTY CHANGE: Adding IIS_VERSION property. Its value is '#8'.
MSI (s) (5C:C8) [16:58:38:082]: Doing action: UpdateProductName_setProp
Action ended 16:58:38: AppSearch. Return value 1.
MSI (s) (5C:C8) [16:58:38:082]: PROPERTY CHANGE: Modifying ProductName property. Its current value is 'MyCompany MyProduct Server Components'. Its new value: 'MyCompany MyProduct Server Components - PROD'.
Action start 16:58:38: UpdateProductName_setProp.

What am I doing wrong?

我究竟做错了什么?

1 个解决方案

#1


1  

The following line in the log file has the information what you should be looking at:

日志文件中的以下行包含您应该查看的信息:

MSI (s) (5C:C8) [16:58:38:081]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\MyProduct\1\InstanceData 3: 2

MSI(s)(5C:C8)[16:58:38:081]:注意:1:1402 2:HKEY_LOCAL_MACHINE \ SOFTWARE \ MyCompany \ MyProduct \ 1 \ InstanceData 3:2

The above line is interpreted as follows: Windows installer error code of 1402, which the MSI SDK defines as follows: Could not open key: [2]. System error [3].

以上行解释如下:Windows安装程序错误代码1402,MSI SDK定义如下:无法打开密钥:[2]。系统错误[3]。

System error code of 2 indicates:ERROR_FILE_NOT_FOUND

系统错误代码2表示:ERROR_FILE_NOT_FOUND

The log file clearly indicates that the registry key was not found. I am assuming that the snippet of the log is when the 64 bit search flag was set in the RegLocator table. However, your registry entries are created in the 32 bit hive(Wow6432Node).

日志文件清楚地表明找不到注册表项。我假设日志的片段是在RegLocator表中设置64位搜索标志的时候。但是,您的注册表项是在32位配置单元(Wow6432Node)中创建的。

To fix this issue, this is what you should be doing:

要解决此问题,您应该这样做:

-Set the value under the Type column in the RegLocator table to 2. This would ensure that the registry search is performed in the 32 bit hive.

- 将RegLocator表中Type类型下的值设置为2.这将确保在32位配置单元中执行注册表搜索。

-Add the property ENV to the list of SecureCustomProperties.

- 将属性ENV添加到SecureCustomProperties列表中。

Probably, what is happening here is that , the value of the property ENV is not passed into the Execute sequence. For the value of the property to be passed to the execute sequence, you need to secure the property ie. add the ENV property to SecureCustomProperties in the Property table.

可能这里发生的是,ENV属性的值不会传递给Execute序列。对于要传递给执行序列的属性的值,您需要保护属性,即。将ENV属性添加到Property表中的SecureCustomProperties。

Once you do this, you code snippet should start working.

执行此操作后,代码段应该开始工作。

In general, under normal circumstances, the values of public properties are passed from the UI sequence to the execute sequence. However, there could be lockdown conditions where the property needs to be explicitly added to the SecureCustomProperties list in the Property table for the value to propogate to the Execute sequence.

通常,在正常情况下,公共属性的值从UI序列传递到执行序列。但是,可能存在锁定条件,其中属性需要显式添加到Property表中的SecureCustomProperties列表中,以便传递给Execute序列。

Hope this helps.

希望这可以帮助。

Regards,

问候,

Kiran Hegde

基兰赫格德

#1


1  

The following line in the log file has the information what you should be looking at:

日志文件中的以下行包含您应该查看的信息:

MSI (s) (5C:C8) [16:58:38:081]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\MyProduct\1\InstanceData 3: 2

MSI(s)(5C:C8)[16:58:38:081]:注意:1:1402 2:HKEY_LOCAL_MACHINE \ SOFTWARE \ MyCompany \ MyProduct \ 1 \ InstanceData 3:2

The above line is interpreted as follows: Windows installer error code of 1402, which the MSI SDK defines as follows: Could not open key: [2]. System error [3].

以上行解释如下:Windows安装程序错误代码1402,MSI SDK定义如下:无法打开密钥:[2]。系统错误[3]。

System error code of 2 indicates:ERROR_FILE_NOT_FOUND

系统错误代码2表示:ERROR_FILE_NOT_FOUND

The log file clearly indicates that the registry key was not found. I am assuming that the snippet of the log is when the 64 bit search flag was set in the RegLocator table. However, your registry entries are created in the 32 bit hive(Wow6432Node).

日志文件清楚地表明找不到注册表项。我假设日志的片段是在RegLocator表中设置64位搜索标志的时候。但是,您的注册表项是在32位配置单元(Wow6432Node)中创建的。

To fix this issue, this is what you should be doing:

要解决此问题,您应该这样做:

-Set the value under the Type column in the RegLocator table to 2. This would ensure that the registry search is performed in the 32 bit hive.

- 将RegLocator表中Type类型下的值设置为2.这将确保在32位配置单元中执行注册表搜索。

-Add the property ENV to the list of SecureCustomProperties.

- 将属性ENV添加到SecureCustomProperties列表中。

Probably, what is happening here is that , the value of the property ENV is not passed into the Execute sequence. For the value of the property to be passed to the execute sequence, you need to secure the property ie. add the ENV property to SecureCustomProperties in the Property table.

可能这里发生的是,ENV属性的值不会传递给Execute序列。对于要传递给执行序列的属性的值,您需要保护属性,即。将ENV属性添加到Property表中的SecureCustomProperties。

Once you do this, you code snippet should start working.

执行此操作后,代码段应该开始工作。

In general, under normal circumstances, the values of public properties are passed from the UI sequence to the execute sequence. However, there could be lockdown conditions where the property needs to be explicitly added to the SecureCustomProperties list in the Property table for the value to propogate to the Execute sequence.

通常,在正常情况下,公共属性的值从UI序列传递到执行序列。但是,可能存在锁定条件,其中属性需要显式添加到Property表中的SecureCustomProperties列表中,以便传递给Execute序列。

Hope this helps.

希望这可以帮助。

Regards,

问候,

Kiran Hegde

基兰赫格德