Pass parameter to vbscript function - 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!

davidesharpe
Posts: 56
Joined: Fri Jul 01, 2011 4:56 am

Pass parameter to vbscript function

assuming i have a function

Function doSomething ()
.
.
.

Then I can call this correctly by setting Function Name to 'doSomething'

but if i have a function

Function doSomething ( sFileName )
.
.
.

Then I dont appear to be able to pass that sFileName parameter through (I have tried 'doSomething ("file")' in Function Name but get error )

how do i achieve this ?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Pass parameter to vbscript function

Hello,

There is no need to pass parameters from the installer. Simply use public properties:

Code: Select all

' read
value = Session.Property("PROPERTY_NAME")

' write
Session.Property("PROPERTY_NAME") = value
All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
davidesharpe
Posts: 56
Joined: Fri Jul 01, 2011 4:56 am

Re: Pass parameter to vbscript function

As a programmer, it just seemed to be a more elegant way of passing a parameter in a function rather than a 'global' property
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Pass parameter to vbscript function

Hi,

This is how Windows Installer engine work, you cannot use any other method for passing a parameter to a function from a VBS
file. This also allows you to have parameters passed between different custom actions, called in different moments of the install process.

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

Return to “Common Problems”