+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
Scripts Thread, Script for deploying a msi with parameters in Coding and Web Development; Hi all, I trying to deploy a msi with parameters via a vb script. I have written the below (most ...
  1. #1
    FatBoy's Avatar
    Join Date
    Oct 2007
    Location
    Kent, UK
    Posts
    249
    Thank Post
    55
    Thanked 20 Times in 16 Posts
    Rep Power
    17

    Unhappy Script for deploying a msi with parameters

    Hi all,

    I trying to deploy a msi with parameters via a vb script. I have written the below (most of it I found ion the internet and change). I have stopped all the errors that were popping up but I'm stuck now because it doesn't error or do anything LOL, could any one help?

    I put the line dim in a vain attempt to try and write the line to a message box so I could see what it displayed like with all the &'s in but this doesn't even show up.

    dim objShell, fs, test
    set fs=CreateObject("Scripting.FileSystemObject")
    set objShell = CreateObject("Wscript.Shell")
    ' check to see if its installed
    If fs.FolderExists("C:\Program Files\Equitrac\Express\Client\EQSharedEngine.exe") then
    ' launch the installer
    test = "msiexec.exe /i \\ash005\Masters\Ricoh\ClientforXP\Equitrac Express Client.msi" & "EQCASNAME"="ASH005" & "EQLANGUAGE"="en" & "ADDLOCAL=""Common,DesktopPrinting,ClientBilling,C ostPreview,WindowsPrinting,DRC,InteractiveRules"
    MsgBox = test
    objShell.Run "msiexec.exe /i \\ash005\Masters\Ricoh\ClientforXP\Equitrac Express Client.msi" & "EQCASNAME"="ASH005" & "EQLANGUAGE"="en" & "ADDLOCAL=""Common,DesktopPrinting,ClientBilling,C ostPreview,WindowsPrinting,DRC,InteractiveRules",0 ,true
    End If

  2. #2
    FatBoy's Avatar
    Join Date
    Oct 2007
    Location
    Kent, UK
    Posts
    249
    Thank Post
    55
    Thanked 20 Times in 16 Posts
    Rep Power
    17
    I did just try and move the msgbox above the "If" but I got a windows script host "illegal assignment" so I guess thats why that doesn't work. Please help as you can see I don't really know what I'm doing :0s

    This is what it looked like before I tried to add the testing msgbox etc


    dim objShell, fs
    set fs=CreateObject("Scripting.FileSystemObject")
    set objShell = CreateObject("Wscript.Shell")
    ' check to see if its installed
    If fs.FolderExists("C:\Program Files\Equitrac\Express\Client\EQSharedEngine.exe") then
    ' launch the installer
    objShell.Run "msiexec.exe /i \\ash005\Masters\Ricoh\ClientforXP\Equitrac Express Client.msi" & "EQCASNAME"="ASH005" & "EQLANGUAGE"="en" & "ADDLOCAL=""Common,DesktopPrinting,ClientBilling,C ostPreview,WindowsPrinting,DRC,InteractiveRules",0 ,true
    End If

  3. #3

    Join Date
    Jan 2007
    Location
    Nottinghamshire
    Posts
    530
    Thank Post
    1
    Thanked 84 Times in 58 Posts
    Rep Power
    38
    I always create MSTs instead of using parameters and then GPO it, then windows looks after checking for whether it's already installed or not

  4. Thanks to mavhc from:

    FatBoy (27th January 2012)

  5. #4
    FatBoy's Avatar
    Join Date
    Oct 2007
    Location
    Kent, UK
    Posts
    249
    Thank Post
    55
    Thanked 20 Times in 16 Posts
    Rep Power
    17
    I have a few times before but I have no idea where in the MST I would put these variables, I'll open it up in orca and see if I can do it. Thanks for the idea.... haven't done anything like that for ages so didn't consider it a option.

  6. #5

    Join Date
    Feb 2009
    Posts
    149
    Thank Post
    0
    Thanked 36 Times in 35 Posts
    Rep Power
    18
    VBscripts are very picky about using quotes, try changing the objshell.run line to this and see if you get anywhere

    objShell.Run "msiexec.exe /i ""\\ash005\Masters\Ricoh\ClientforXP\Equitrac Express Client.msi"" EQCASNAME=""ASH005"" EQLANGUAGE=""en"" ADDLOCAL=""Common,DesktopPrinting,ClientBilling,Co stPreview,WindowsPrinting,DRC,InteractiveRules""", 0 ,true

  7. Thanks to HilcrRWise from:

    FatBoy (14th February 2012)

  8. #6
    FatBoy's Avatar
    Join Date
    Oct 2007
    Location
    Kent, UK
    Posts
    249
    Thank Post
    55
    Thanked 20 Times in 16 Posts
    Rep Power
    17
    Hi HilcrRWise,

    Sorry for the late reply I didn't realise you posted as I didn't get a e-mail alert! I tried what you said and the good news is its didn't error the bad news is it didn't do anything either

    mavhc I tried to create a MST and found the EQCASNAME & EQLANGUAGE property in orca so added these fields and the program installs. However I don't now how to select the features. I found a feature table but can not find a ADDLOCAL property and if I did would I have to add multiple ADDLOCAL rows for each feature or could I add them like I'm tried to in the above. Please see attached and hopefully it makes sense, if you have done this before and can help I would be eternally greatful
    Attached Images Attached Images

  9. #7

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,766
    Thank Post
    3,274
    Thanked 1,053 Times in 974 Posts
    Rep Power
    365
    How would you type the command out if you were typing it in a command prompt to install so I can see the command without all the quotes etc in the vb script.

    Code:
    Dim sCmd
    sCmd = "msiexec.exe /i " & chr(34) & "\\ash005\Masters\Ricoh\ClientforXP\Equitrac Express Client.msi" & chr(34) & " " & "EQCASNAME=" & chr(34) & "ASH005" & chr(34) & " " & "EQLANGUAGE=" & chr(34) & "en" & chr(34) & " " & "ADDLOCAL=" & chr(34) & "Common,DesktopPrinting,ClientBilling,CostPreview,WindowsPrinting,DRC,InteractiveRules" & chr(34)
    
    msgbox sCmd
    
    objShell.Run sCmd,0 ,true
    I have the message box to output and show what the command looks like, so assuming the above is correct you can comment out the msgbox

    The only other thing I have seen here is using cmd /k as part of the code as per here :

    http://www.visualbasicscript.com/obj...ms-m60133.aspx

    Code:
    objShell.Run "cmd /k c: & CD c:.. &  msiexec /i " etc etc
    Maybe worth while pre fixing the cmd /k c: & CD c:.. & msiexec /i " etc and see if that makes any difference.
    Last edited by mac_shinobi; 10th February 2012 at 10:33 AM.

  10. Thanks to mac_shinobi from:

    FatBoy (14th February 2012)

  11. #8

    Join Date
    Jan 2007
    Location
    Nottinghamshire
    Posts
    530
    Thank Post
    1
    Thanked 84 Times in 58 Posts
    Rep Power
    38
    That looks to be the right way to go about it, add your own rows with exactly the same format as the command line, ignoring the quotes of course

  12. Thanks to mavhc from:

    FatBoy (14th February 2012)

  13. #9


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    8,921
    Thank Post
    226
    Thanked 2,676 Times in 1,973 Posts
    Rep Power
    787
    Quote Originally Posted by FatBoy View Post
    would I have to add multiple ADDLOCAL rows for each feature or could I add them like I'm tried to in the above
    Everything looks fine in your screenshot (although technically you are not meant to put the ADDLOCAL property in an MSI or MST). If you use the command below, does it install successfully?

    Code:
    msiexec /i "Equitrac Express Client.msi" TRANSFORMS="EquitracAnswers.mst" /qb!
    Last edited by Arthur; 12th February 2012 at 01:49 AM.

  14. Thanks to Arthur from:

    FatBoy (14th February 2012)

  15. #10
    FatBoy's Avatar
    Join Date
    Oct 2007
    Location
    Kent, UK
    Posts
    249
    Thank Post
    55
    Thanked 20 Times in 16 Posts
    Rep Power
    17
    Right since it's half term I might actually have time to look into this today, @ Arthur if I used the MST file I would roll it out via GP as that is what I wanted to achieve after reading mavhc's post. Your link to the ICE87 Addlocal property looks really helpful tho so I'm going to look at that and see if I can get the MST working. If not I think mac_shinobi's post will work....

    Thanks All

  16. Thanks to FatBoy from:

    mac_shinobi (14th February 2012)

  17. #11
    FatBoy's Avatar
    Join Date
    Oct 2007
    Location
    Kent, UK
    Posts
    249
    Thank Post
    55
    Thanked 20 Times in 16 Posts
    Rep Power
    17
    Right guys Arthur is defo right the ADDLOCAL, it will not work in the property section which if you read the link it makes sense. It is a shame because the server name and language in the MST works a treat I have change the script to look like what shinobi suggested and added the /q so it works silent. Ended up with this:

    dim objShell, fs, sCmd
    set fs=CreateObject("Scripting.FileSystemObject")
    set objShell = CreateObject("Wscript.Shell")
    ' check to see if its installed
    If NOT fs.FolderExists("C:\Program Files\Equitrac\Express\Client\EQSharedEngine.exe") then
    ' launch the installer
    sCmd = "msiexec.exe /i " & chr(34) & "\\ash005\Masters\Ricoh\ClientforXP\Equitrac Express Client.msi" & chr(34) & " " & "EQCASNAME=" & chr(34) & "ASH005" & chr(34) & " " & "EQLANGUAGE=" & chr(34) & "en" & chr(34) & " " & "ADDLOCAL=" & chr(34) & "Common,DesktopPrinting,ClientBilling,CostPreview, WindowsPrinting,DRC,InteractiveRules" & chr(34) & " /q"
    'msgbox sCmd

    objShell.Run sCmd,0 ,true
    End If

    Thanks again to everyone that replied, even tho the MST way didn't work I learnt a load about how to make them

  18. 3 Thanks to FatBoy:

    Edwardjr (10th May 2012), LinkZ (6th November 2012), mac_shinobi (15th February 2012)

  19. #12


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    8,921
    Thank Post
    226
    Thanked 2,676 Times in 1,973 Posts
    Rep Power
    787
    Glad to hear you got it working in the end.

  20. Thanks to Arthur from:

    mac_shinobi (15th February 2012)

  21. #13

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,766
    Thank Post
    3,274
    Thanked 1,053 Times in 974 Posts
    Rep Power
    365
    You could probably do the spacing different in the vb script as I was using & " " & variable etc where as you may of just been able to add an extra space at the end of the previous string ie

    "msiexec /i path blah blah " & addlocal etc

    instead of

    msiexec /i path blah blah" & " " & chr(34) & etc etc

    Never used an mst as far as installing an msi before so no idea how to get that to work.

  22. #14


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    8,921
    Thank Post
    226
    Thanked 2,676 Times in 1,973 Posts
    Rep Power
    787
    Quote Originally Posted by FatBoy View Post
    Right guys Arthur is defo right the ADDLOCAL, it will not work in the property section which if you read the link it makes sense. It is a shame because the server name and language in the MST works a treat
    @FatBoy. I have just thought of another way you could do what you want without resorting to using VBScript's.

    1. Open your MSI and MST in InstEd or Orca.
    2. Go to the Property table.
    3. Look for the INSTALLEVEL property and make a note of its value.



    4. Next, go to the Features tab, and for each feature or sub-feature that you don't want to install, set its Level to a number higher then the INSTALLEVEL in the previous step. i.e. 101.



      This prevents the feature from being installed by default and essentially does the same thing as using the ADDLOCAL property to select the features you mentioned in post #11.

    5. Save the MST and then test.

  23. 3 Thanks to Arthur:

    Alis_Klar (19th April 2012), FatBoy (12th March 2012), mac_shinobi (12th March 2012)

  24. #15
    FatBoy's Avatar
    Join Date
    Oct 2007
    Location
    Kent, UK
    Posts
    249
    Thank Post
    55
    Thanked 20 Times in 16 Posts
    Rep Power
    17
    Thanks Arthur I'll give that a go at some point sorry I didn't reply earlier I didn't get a notification you posted :0( So what you are saying is by default it installs everything... From what I remember it installed but didn't install any features (altho I could be wrong). Either way I give it a go at some point. Thanks muchly

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 10
    Last Post: 19th August 2009, 10:18 PM
  2. Mimio software MSI for deployment through GPO
    By Kyle in forum How do you do....it?
    Replies: 2
    Last Post: 16th May 2008, 03:34 PM
  3. How can I set the default for .fw3 files? (Fun With Texts)
    By sidewinder in forum Educational Software
    Replies: 2
    Last Post: 6th October 2006, 08:58 AM
  4. VBS script for prestaging computers anyone?
    By ChrisH in forum Scripts
    Replies: 7
    Last Post: 23rd June 2006, 09:59 AM
  5. Backup Script for NT backup and Robocopy
    By ChrisH in forum Scripts
    Replies: 12
    Last Post: 20th October 2005, 01:01 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •