jlavery
Posts: 27
Joined: Tue Oct 14, 2008 4:56 pm

Parameter not being set from VBS

Hi there,
We need to allow the user to specify the environment on which they're installing, and set installation parameters accordingly.

To this end I've done the following.
  • 1. Created a new DatabaseServer installation parameter, [DatabaseServer], with a default value of 'MyDbServer'
    2. Created a dialog, Choose EnvironmentDialog, on which they can select the environment using a ComboBox, and which sets the [SELECTED_ENV] parameter
    3. Created a vbs script which uses Session.Property to test [SELECTED_ENV] and set it appropriately.
    4. Created an Attached Custom Action of my VBS file, and attached it to my ChooseEnvironmentDialog.
    5. Created a text replacement for *.ini to replace <DatabaseServer> with the [DatabaseServer] parameter
I'm setting the property in the VBS with:

Code: Select all

Session.Property("DatabaseServer") = "NewServer"
The problem I'm seeing is that my code is being executed (I've put MsgBox statements in) to set the DatabaseServer, but the resulting replacement is with the value 'MyDbServer', not 'NewServer' - i.e. the updated value is not being used.

Any pointers as to what may be going wrong?

Thanks a lot,

James
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Parameter not being set from VBS

Hi James,

Try using a public property, for example DATABASE_SERVER. Private properties switch to their default values when used in InstallExecuteSequence.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jlavery
Posts: 27
Joined: Tue Oct 14, 2008 4:56 pm

Re: Parameter not being set from VBS

Hi Cosmin,
Thanks a lot - this solved my problem.

Return to “Common Problems”