Page 1 of 1

MSI code variable to VBScript

Posted: Fri Apr 04, 2014 4:58 am
by markoh3
Hi,

Is it possible to use a MSI code variable in a VBScript?
If this is possible how should I handle this?

Kind regards,

Marko

Re: MSI code variable to VBScript

Posted: Fri Apr 04, 2014 10:21 am
by FrancescoT
Dear Marko,

how do you integrate the VB script with your project?

If it is an external file that you execute from the setup, you could pass an IA Variable to it as you do from command line.

Regards

Re: MSI code variable to VBScript

Posted: Mon Apr 07, 2014 1:13 am
by markoh3
Hi Francesco,

The VBscript is integrated within the project as a support file.

Regards,

Marko

Re: MSI code variable to VBScript

Posted: Mon Apr 07, 2014 10:22 am
by FrancescoT
... you could pass an IA Variable to it as command line parameter (using the RUN PROGRAM command).

Regards

Re: MSI code variable to VBScript

Posted: Tue Apr 08, 2014 12:29 am
by markoh3
Hi Francesco,

Thank you for your reply.
Do you have an example how I could do this in MSI-code. I will try it by myself as well but it would be nice to see an example.

Regards,

marko

Re: MSI code variable to VBScript

Posted: Tue Apr 08, 2014 11:02 am
by FrancescoT
Dear Marko,

it really simple ...

Code: Select all

Set Variable MYVAR to 1234
Run Program $SUPPORTDIR$\myscript.vbs $MYVAR$ (WAIT)

The above example excutes the vbscript "myscript.vbs" (from SupportDir at runtime ) and pass an IA Variable to it as command line parameter.

The same code snippet as IA clipboard format;

Code: Select all

~InstallAware Clipboard Data~
~Run Program~
~{CDF79D0B-FAF1-4374-8DA4-382F32ADBFFE}~
~$SUPPORTDIR$\myscript.vbs~
~TRUE~
~$MYVAR$~
~TRUE~
~~
~Set Variable~
~{8E58E9BD-05BB-432E-A15B-70FA32EFBFE1}~
~MYVAR$MYAH$MYAH$FALSE~
~1234~

Hope this helps you.

Regards