PDA

View Full Version : How get [INSTALLDIR] in custom action ?



MBalen
02-21-2011, 12:28 PM
Hello,

I have to do some tasks in a .vbs script.
The script have to modify some files installed and these files was installed in [INSTALLDIR].
How can I pass the [INSTALLDIR] value to the custom action ?
I have see that the property "InstallDir" is not valid if I starts the script "after file transfer" !

Thanks

weakness
02-24-2011, 09:50 PM
Generally, you can get INSTALLDIR by using the line.

Session.Property("INSTALLDIR")

In Deferred, Commit, and Rollback Custom Actions, you need some step.

http://helpnet.flexerasoftware.com/robo/projects/installshield17helplib/AccessingProps-DeferredCAs.htm

stephanerolland
03-14-2011, 05:57 AM
I have a similar question but concerning the use of JScript

Associated to a custom action, I have a *.js file, and I wiish I could write something in this spirit:

function doInstall()
{
installDir = InstallShieldObject.INSTALLDIR // <= this is what I'd like to do
var comandUpdateRegistry = "regedit /s" + installDir + "registryScript.reg"

oShell = WScript.CreateObject( "WScript.Shell" );
oShell.Run( updateRegistryScriptCommand );

return true;
}


or Should I give up and use VBScript ?