PDA

View Full Version : getting [INSTALLDIR] from the registry



reganJohnson
10-20-2004, 10:42 AM
I am having a problem that is beginning to really frustrate me with InstallShield Express X.

I want to create an optional action to run my application when the computer is turned on. To do this, I believe need to create a registry key holding the path to the program in:
HKEY_CURRENT_USER/SOFTWARE/Software/Microsoft/Windows/CurrentVersion/Run

so, it have key and values something like:
myProgram c:\program files\aDirectory\myProgram.exe

this is nice, and it works, except that if the user places the executable somewhere else, it will not work.

When I was discovering this, I saw a help link on the left hand of my registry editing screen (in installshield) that was called "How can I enter variable data types into my registry information?". This described exactly what I wanted! instead of a complete path to myProgram.exe, I just needed to put [INSTALLDIR]\myProgram.exe, and define "HKEY_CLASSES_ROOT/Installation Location" to have key and value:
My Installation Location [INSTALLDIR]

Well, I tried all this, and it didn't help. the path to the program in the registry value didn't change to the installation directory, it stayed as [INSTALLDIR]\myProgram.exe and the stuff in "HKEY_CLASSES_ROOT/Installation Location" stayed as [INSTALLDIR]


Help!! What did I do wrong?

TsungH
10-20-2004, 11:59 AM
Can you post a screenshot of the Registry view, showing HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Run, in Express IDE?

reganJohnson
10-20-2004, 12:13 PM
Ok, I've attached projectAssist (with HKEY_CURRENT_USER/SOFTWARE/Software/Microsoft/Windows/CurrentVersion/Run and projectAssist1 (with HKEY_CLASSES_ROOT/Installation Location) for good measure.

TsungH
10-20-2004, 01:06 PM
The entry looks correct. I don't have InstallShield X Express Edition handy, I can't create a simple project for verification. You will want to examine Registry table in the project file as well as in the MSI using Orca. If you are not comfortable with Orca, you can open a support request with mySupport (http://mysupport.installshield.com/).

reganJohnson
10-20-2004, 02:10 PM
what is this orca?

TsungH
10-20-2004, 02:42 PM
Orca is a MSI table editor available from Microsoft.

Leones
10-22-2004, 02:47 AM
Hi Regan,

I think you should try out to set a custom action. To do this, create a VBS in which you put in:


on error resume next

Dim WSHShell
Set WshShell = CreateObject("WScript.Shell")

WSHShell.RegWrite "HKLM\SOFTWARE\YOURNAME\PROGRAMNAME", Session.TargetPath("INSTALLDIR") + "\" + "companyname\myProgram.exe"


After creating the VBS you can set in: "Setup requirements" > "After Destination Folder dialog", a new VBS script.

I hope this is what you wanted and helps,

Léon