How to set $TARGETDIR$ value from registry?

Got a problem you cannot solve? Try here.
Post Reply
mhammady
Posts: 15
Joined: Wed Dec 14, 2011 10:01 am

How to set $TARGETDIR$ value from registry?

Post by mhammady »

Hi, I would like to set the $TARGETDIR$ value according to a stored path value in the registry. In IS, we used to run a VB script before install begin to read and setup this variable, but i don't know how to do that in IA.

Can any one please help?


Thx
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: How to set $TARGETDIR$ value from registry?

Post by FrancescoT »

Dear User,

Simply use the command "Read Registry " in your script.

For example:
Read Registry Key HKLM\\ into TARGETDIR

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
mhammady
Posts: 15
Joined: Wed Dec 14, 2011 10:01 am

Re: How to set $TARGETDIR$ value from registry?

Post by mhammady »

Thanks, but where exactly i need to put this script. I use the IA 2012 RAD studio edition...
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: How to set $TARGETDIR$ value from registry?

Post by FrancescoT »

Dear User,

by defalut InstallAware intialize TARGETDIR in the project Main script, as below:

DEFINE REGION: Setup User Interview
if Variable MAINTENANCE Equals TRUE
GoTo Label: Maintenance
else
[compiler if Variable BUILDMODE not Equals PATCH]
Comment: First Time Install
Set Variable TARGETDIR to $PROGRAMFILES$\$TITLE$
Set Variable STARTMENU to $TITLE$
[compiler end]
end

So you could replace "Set Variable TARGETDIR to $PROGRAMFILES$\$TITLE$" ... or dependig on your needs somewhere else.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply