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

Check, copy and paste keys in registry

Hello,

I'm new to both Installshield and development, and I need a hand with a task I thought was fairly simple.
I'm looking for a simple way (or perhaps not so) to perform the following actions during setup:
- check the value of a registry key
- If the value is 1, copy the key and three others
- paste (or create) the keys in another hive of the registry

I have to insert this "custom action" (not too sure there) in the installation sequence before creating and stating a service.

Has anyone got a tip, please?
Labels (1)
0 Kudos
(3) Replies
KathyMorey
Level 10

What type of project are you using?

In a Basic MSI, you can check and save the value of a registry key using the System Search view (which populates the AppSearch and related tables). You can install the other registry keys based on the property created during AppSearch. (Take a look in the help for "conditional components".)

In an InstallScript project, you can do all of this with scripting.
0 Kudos
bplivard
Level 4

Hello Kathy,

Thank you for taking the time to reply 🙂
To answer your initial question, I'm working on an Installshield MSI project, and it seems I'll have to learn Installscript....

Actually, what has to be checked is whether Internet Explorer Proxy is enabled for the user who installs the product, and if positive, copy this value along with a few others to the local machine hive, so the product will function properly.
I'll have to insert this as a custom action in the sequence before I create and launch a service.

So far, I have found out about several functions such as RegDBSetDefaultRoot, RegDBGetKeyValueEx, RegDBCopyValues, but I'm not too sure how to proceed next.
0 Kudos
KathyMorey
Level 10

In an InstallScript MSI project, you can still do this in the MSI, and choosing to do it there makes for cleaner installs and less problems in repairs, updates, etc., in my experience.

Create System Search items for the Internet Explorer Proxy key you need to check and for the keys whose values you want to save. Enter property names of your choice in all caps to save the values in.

Create components (or a component) and put in it the registry entries you want to write, using the property names from above as the values.

Condition this component on the presence of the property from the Internet Explorer Proxy search - if the property exists, the key was found.

This assumes, of course, that there aren't any other ramifications from moving a single user's settings to the HKLM hive in the first place...
0 Kudos