PDA

View Full Version : How to capture install path for Registry key



lsramos
10-31-2008, 06:23 PM
I am trying to build an installer for a customer such that our Registry items will be stored in the correct keys within the customer's product hive.

They store their install path in HKLM\software\CompanyA in a string called InstallDir, whose value might be:
D:\EZsoft

The values we want to add to the Registry must be placed into a key which embeds the install dir name, for example:
HKLM\software\CompanyA\D:/EZsoft
that is, the string "D:/EZsoft" is the sub-key into which the new registry values will be stored.

My question is, how can I extract the install path, then convert it into a string that gets added as a sub-key? I know how to use Windows Installer Properties to do this, but can't think of a way to make such a custom string. We use InstallShield Express 2009.

If this cannot be done with ISX, is their another product that has such a capability? The installation itself will be pretty simple, once we can get the path-as-subkey problem solved.

TIA,
Scott

tglynx
11-01-2008, 05:11 AM
Hi Isramos,

as per my understanding you want to create a registry key during installation which is named by the installation directory you choose during installation.

The installation directory ist stored in the [InstallDir] string. The Problem will be, that D:\EXsoft can not be stored in the registry a s a key because '\' is not allowed there.

You described that you would convert it to D:/EZsoft ...
I would say that is not possible in ISX 2009.

You could create a custom action and pass [InstallDir] to that custom action and let the custom action write the key to the registry.

Does that help?

Regards,
Michael

lsramos
11-04-2008, 03:17 PM
Michael,

Yes, that is what we want to do. The customer's software created the key with the directory path using forward slashes for the reason that you state: that keys cannot contain backslashes. It is now our task to add new items to that registry key, but to do so we have to know how to recreate the string in the key name. I was hoping for someone to have an ingenious solution to this task, but I think you are right that we will have to write a special custom action to do this.

Thanks,
Scott