PDA

View Full Version : VBScript Questions



IanBrooke
01-25-2012, 07:08 PM
Hi,
I'm very new to Installshield Express and have 2 questions on vbScript custom actions which I am hoping you can help with:

1. atm I am getting the value of a registry key using

Set objShell = CreateObject("WScript.Shell")
value=objShell.RegRead(key)
is this the 'prefered' (best) way of getting a registry value or is there something better?

2. Having got the value of that registry key how do I set the installer's default INSTALLDIR to that value?

Many thanks
Ian

weakness
01-26-2012, 01:46 AM
Hello.

Do you know this setting?

Setting INSTALLDIR from the Registry
http://kb.flexerasoftware.com/doc/Helpnet/isxhelp18/ExpressTaskSettingINSTALLDIRfromReg.htm

It maybe will do.

IanBrooke
01-26-2012, 11:23 AM
Hello.

Do you know this setting?

Setting INSTALLDIR from the Registry
http://kb.flexerasoftware.com/doc/Helpnet/isxhelp18/ExpressTaskSettingINSTALLDIRfromReg.htm

It maybe will do.

Thanks for your reply.
I had not seen this before but I've now tried it out. The problem is that some users will have the setting and some will not. When the registry key exists this method works fine but when it does not the default Installdir is set to C:\[productname] - not what I want at all!

Ian

weakness
01-30-2012, 03:42 AM
Hello.

In this case, I guess you have to create VBScript custom action or something in order to set INSTALLDIR value.

If you can retrieve a value from registory using VBScript, then you can also set INSTALLDIR value as follows VBScript code.

Session.Property("INSTALLDIR") = < PATH >