covarubias
Posts: 6
Joined: Fri Feb 01, 2008 3:38 pm
Location: Germany

get return value from custom action (VBScript file)

Hello,

i want to know if it's possible to get and use a return value (in my case it's a string) from a custom action that is called during the install process.

with a vbscript i want to do the following:
in the registry entries i want to check if my program is already installed at the user's pc. if so, i want to return this original program path and let it be the default installation path.
that's why i need to return a string to the installation itself.

can anyone help me?
thanks in advance,
covarubias
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

This can be done with the Property property of the Session object:
http://msdn2.microsoft.com/en-us/librar ... S.85).aspx

For example, the value of the APPDIR property (used by the "Application Folder" directory in the "Files and Folders" page) can be set to a string like this:

Code: Select all

Session.Property("APPDIR")="string"
To read the value of the APPDIR property you can use:

Code: Select all

string_variable=Session.Property("APPDIR")

Note that you can also use the "Search" page to search the registry. After this, you can use a "Property set with formatted" custom action to set the APPDIR property to the result of the search.

You can read more about the "Search" page here:
http://www.advancedinstaller.com/user-guide/search.html

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
covarubias
Posts: 6
Joined: Fri Feb 01, 2008 3:38 pm
Location: Germany

thanks alot, it works :-)

Return to “Common Problems”