Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Parameters to VBScript


1 reply to this topic

shajilr

shajilr
  • Members
  • 11 posts

Posted 08 October 2002 - 12:49

Hi,
    I will be getting parametrs from the user in the installshield, how can i pass it to the vbscript file which Iwill be executing using a wscript.exe. Could any one help me with some sample code.
Thanks,
shajil

mattw112

mattw112
  • Members
  • 5 posts

Posted 14 October 2002 - 16:19

Here's what someone posted to my question which was the same a few days ago:

Posted: Oct. 07 2002,08:24    

--------------------------------------------------------------------------------
Hi
The method for doing that is something like this"
Code Sample  

function CreateMTSPackage2
  Dim strPackageName, strComponentDir, strComponents, strIdentityType
  Dim strDebug, bPackageUpdated, bPackageExists
  Dim PropArray

  ' Get the installer properties
  PropArray = Split(Session.Property("CustomActionData"), ";")
  strPackageName = PropArray(0)
  strComponentDir = PropArray(1)
  strComponents = PropArray(2)
  strDebug = PropArray(3)
  bPackageUpdated = False
  bPackageExists = False

  Erase PropArray


This is just a fragment from the code but that's the idea.
In your project create a CA named "YourCAName" that will
set a property by the name "YourPropertyName"

Some thing like this:
   nResult = MsiSetPropertyhMSI,"YourPropertyName",szValue);

Set the property before calling the VBS.
Note :
Use "CustomActionData" to get information from a Deferred Execution Custom Actions.
Otherwise you can use
PropArray = Split(Session.Property("YOURPROPERTY"), ";")
or something like this.
I'm sure if you look at the msdn you will find more information.



I hop this will help you.
--Yoav

>>>>>>>>>>>>>>>>>>>>>>&g
t;>>>>>>>>
I ended up doing two other things though.

First one was the convert the vbscript to a exe and then add that as a custom action (it will give you a line for command lines this way).

The other was to just go through the script and rewrite it to hard code the parameters I wanted.

Terry