Parameter in VB Script - 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!

dudedolf
Posts: 14
Joined: Mon Aug 10, 2009 5:18 pm

Parameter in VB Script

Hi,

I have a simple test vb script

if Wscript.Arguments.Count > 0 then
MsgBox(Wscript.Arguments(0))
else
MsgBox("None")
end if

I have tried to get advanced installer to run this as a Custom Action however i am getting a failure error. Here is Error log

"MSI (s) (00:60) [15:27:47:298]: Note: 1: 2318 2: C:\Program Files\Your Company\Your Application\ParamTest.vbs
MSI (s) (00:60) [15:27:47:298]: Executing op: CacheSizeFlush(,)
MSI (s) (00:60) [15:27:47:329]: Executing op: InstallProtectedFiles(AllowUI=1)
MSI (s) (00:60) [15:27:47:344]: Executing op: ActionStart(Name=VBS,,)
Action 15:27:47: VBS.
MSI (s) (00:60) [15:27:47:407]: Executing op: CustomActionSchedule(Action=VBS,ActionType=3078,Source=if Wscript.Arguments.Count > 0 then
MsgBox(Wscript.Arguments(0))
else
MsgBox("None")
end if,,CustomActionData=TEST)
MSI (s) (00:18) [15:27:47:423]: Generating random cookie.
MSI (s) (00:18) [15:27:47:454]: Created Custom Action Server with PID 1172 (0x494).
MSI (s) (00:90) [15:27:47:485]: Running as a service.
MSI (s) (00:90) [15:27:47:501]: Hello, I'm your 32bit Elevated custom action server.
MSI (s) (00:EC) [15:27:47:516]: Entering MsiProvideComponentFromDescriptor. Descriptor: kccSYSv-D=Xgn&5_83.ePSDK>M5KDYSUnf(HA*L[xeX)y, PathBuf: BAF348, pcchPathBuf: BAF344, pcchArgsOffset: BAF29C
MSI (s) (00:EC) [15:27:47:548]: MsiProvideComponentFromDescriptor called for component {997FA962-E067-11D1-9396-00A0C90F27F9}: returning harcoded oleaut32.dll value
MSI (s) (00:EC) [15:27:47:579]: MsiProvideComponentFromDescriptor is returning: 0"

Many thanks
Rudy
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Parameter in VB Script

Hello,

I am afraid the Wscript object is not supported by Windows Installer when a vbscript is being run by an msi installer. You will have to use Session.Property("YOURPROPERTYNAME") in order to pass data from your installer to the vbscript. Note that YOURPROPERTYNAME is a property you set from within your installer.
Usage Example:

Code: Select all

MsgBox Session.Property("APPDIR")
The example above displays a message with the path to which your application will be installed.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”