Jump to content

Script for deploying a msi with parameters


Recommended Posts

Posted

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,CostPreview,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,CostPreview,WindowsPrinting,DRC,InteractiveRules",0,true

End If

Posted

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,CostPreview,WindowsPrinting,DRC,InteractiveRules",0,true

End If

Posted
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
  • Thanks 1
Posted
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.
Posted

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,CostPreview,WindowsPrinting,DRC,InteractiveRules""",0 ,true

  • Thanks 1
  • 2 weeks later...
Posted

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

2012-02-10 09h12_46.png

Posted (edited)

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.

 

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/objshellrun-msiexec-problems-m60133.aspx

 

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.

Edited by mac_shinobi
  • Thanks 1
Posted
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
  • Thanks 1
Posted (edited)
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?

 

msiexec /i "Equitrac Express Client.msi" TRANSFORMS="EquitracAnswers.mst" /qb!

Edited by Arthur
  • Thanks 1
Posted

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

  • Thanks 1
Posted

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 :nerd:

  • Thanks 3
Posted

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.

Posted
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.
     
    http://i.imgur.com/XmG0T.png
     
     
  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.
     
    http://i.imgur.com/ggNns.png
     
    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.

  • Thanks 3
  • 4 weeks later...
Posted
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
  • 1 month later...
Posted
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 :nerd:

 

Thread bump... We are in the middle of having Equitrac installed, did this script work for installing the .MSI?

 

Much appreciated!

  • 5 months later...
Posted
Got this semi-working thanks to FatBoy's script. Still having problems with the PrintAssist (ClientBilling role) though. If I go through a manual install it will pop up asking users to enter the appropriate billing code, however if I install it through the VBS it won't. Anyone else run into this issue?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...