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!

Nathalie
Posts: 8
Joined: Wed Jan 24, 2007 8:42 pm

Passing Parameters To VbScript

Hi ,

I am currently encountering an issue. I have created a custom action that is calling a vbscript and will create a database on install. I trying to pass parameters to that vbScript...I get a Object Required: Session Error. Now I am wondering , should there be a session created with the installer when you run an install??? I would like to verify with you the steps I did to create that custom action. and see if I did not do a mistake in the creation .

To test I wrote a message to see if I receive my value in my script
DATABASECONFIG3EDIT_346_PROP is the property of my text field.

MsgBox Session.Property"DATABASECONFIG3EDIT_346_PROP")

I created a UI custom action by going on add predefine Custom Action -> Launch file or open URL. In the General properties. here is what I have entered:

for Source path : <viewer.exe>
Source Type : Executable
Command Line : "[#Creatingdb.vbs]" "[DATABASECONFIG3EDIT_346_PROP]"

I added my script to the files and folder. Under Local Application Folder/Scripts

The script runs . its just that it seems to not be able to reach the session variable. What is the step I am missing to be able to see that variable from my script...
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Nathalie,

You don't need to pass the property as argument. You can directly access a Windows Installer property in a VBS custom action using this code:

Code: Select all

strValue = Session.Property("DATABASECONFIG3EDIT_346_PROP")
Best Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Nathalie
Posts: 8
Joined: Wed Jan 24, 2007 8:42 pm

Thank you for repliying to my question I finally figured it out , it was in the way I was creating my custom action. I created one of type .vbs and it worked!

Return to “Common Problems”