FatBoy Posted January 27, 2012 Posted January 27, 2012 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
FatBoy Posted January 27, 2012 Author Posted January 27, 2012 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
mavhc Posted January 27, 2012 Posted January 27, 2012 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 1
FatBoy Posted January 27, 2012 Author Posted January 27, 2012 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.
TLARWise Posted January 27, 2012 Posted January 27, 2012 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 1
FatBoy Posted February 10, 2012 Author Posted February 10, 2012 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
mac_shinobi Posted February 10, 2012 Posted February 10, 2012 (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 February 10, 2012 by mac_shinobi 1
mavhc Posted February 12, 2012 Posted February 12, 2012 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 1
Arthur Posted February 12, 2012 Posted February 12, 2012 (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 February 12, 2012 by Arthur 1
FatBoy Posted February 14, 2012 Author Posted February 14, 2012 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 1
FatBoy Posted February 14, 2012 Author Posted February 14, 2012 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 3
Arthur Posted February 14, 2012 Posted February 14, 2012 Glad to hear you got it working in the end. 1
mac_shinobi Posted February 15, 2012 Posted February 15, 2012 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.
Arthur Posted February 16, 2012 Posted February 16, 2012 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. Open your MSI and MST in InstEd or Orca. Go to the Property table. Look for the INSTALLEVEL property and make a note of its value. http://i.imgur.com/XmG0T.png 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. Save the MST and then test. 3
FatBoy Posted March 12, 2012 Author Posted March 12, 2012 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
Edwardjr Posted May 9, 2012 Posted May 9, 2012 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 Thread bump... We are in the middle of having Equitrac installed, did this script work for installing the .MSI? Much appreciated!
LinkZ Posted November 6, 2012 Posted November 6, 2012 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?
LinkZ Posted November 6, 2012 Posted November 6, 2012 Ah, turns out it's my own silly fault! Wasn't including WindowsPrinting as one of the roles.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now