VBS Custom Action - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

PeTeC
Posts: 1
Joined: Thu Feb 18, 2010 12:23 pm

VBS Custom Action

Hi,
Can anyone help me configure a VBS custom action.

I am having trouble passing information into the script as I am unclear as to whether the information is passed as a command line argument or by passing a value directly into the function.

i.e. I have a simple function called INSTALL

code 1

Function INSTALL(value)
code.....
End Function

or Code 2

Function INSTALL()
value = args.Item(0)
code....
End Function

Once I know this how do I format the function call in Advanced Installer. I would like to pass the path of the install into the script
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: VBS Custom Action

Hi,

The easiest way to pass a parameter to a function in VBS is to use the installer's public properties.
For example if you wish to retrieve the installation path of your package you can write something like this:

Code: Select all

Dim installPath
installPath = Session.Property("APPDIR")
This code will set the variable "installPath" to the value retrieved from the public property APPDIR, in our case the installation path.
Here is another example of using VBScript into a custom action.

Please let me know if you have any questions.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”