cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
z_efrati
Level 4

Reading data from the registry.

Hi,

I would like an installation kit to reboot if a a certain Registry Key contains a certain value. To do that, I guess I have to first read a value from the Registry.

In order to read from the Registry, I did the following:

1. I declared a public property named EXAMPLE_PROP.
2. I added a record to AppSearch table {EXAMPLE_PROP, registry_sig}
3. I added a record to RegLocator table {registry_sig, 2, Software\Microsoft\Windows NT\CurrentVersion, RegisteredOwner, 2}

I wanted to confirm that the reading actually took place, so I did the following:

4. I added a record to Registry table {Registry10, 2, SYSTEM\CurrentControlSet\Example, ExampleProp, [EXAMPLE_PROP], comp.exe, 0}

I built the installation kit, and ran it, but EXAMPLE_PROP didn't seem to get the value from the registry.

Where did I went wrong?

Thanks
Labels (1)
0 Kudos
(3) Replies
RobertDickau
Flexera Alumni

To try to narrow the problem: If you create an MSI log file (or add [EXAMPLE_PROP] to, say, a text field on the InstallWelcome dialog box), is the property being populated?

(Using the System Search Wizard instead of populating the AppSearch and related tables directly can help avoid some errors in getting things connected...)
0 Kudos
z_efrati
Level 4

I got:

=== Logging started: 12/22/2008 11:49:36 ===
Action 11:49:36: INSTALL.
Action start 11:49:36: INSTALL.
Action 11:49:36: AppSearch. Searching for installed applications
Action start 11:49:36: AppSearch.
AppSearch: Property: ABCD, Signature: registry_sig
Info 1314.The specified path #0 is unavailable.
Action ended 11:50:04: AppSearch. Return value 1.

Error 1314, if that is in fact the problem, means that "A required privilege is not held by the client.".

Is there any thing I can do from within the installation exe, or must I read that Registry key from an external DLL?

Thanks
0 Kudos
RobertDickau
Flexera Alumni

A similar example seems to work at this end; if you view the search in the System Search view (right-click and choose Modify), does it look okay there? Does it work if you read from a different key? Delete EXAMPLE_PROP from the Property Manager?
0 Kudos