dachammer Posted July 30, 2013 Posted July 30, 2013 (edited) Hi, I find myself in need of a simple script to pass arguments to a msi installation. This is what I came up with for the code. What I'm looking for is a way that the $args line will be read by the msi. Thanks in advance for any help on this one..... $Inst = @ScriptDir & "KeyViewComponent1080.msi" $args = "/qb /l*v C:sccmmsi_logsKeyViewComponent1080.log" ShellExecuteWait($Inst,$args, @ScriptDir) This works but I need to pass more arguments.... $Inst = @ScriptDir & "KeyViewComponent1080.msi" $args = "/qb" ShellExecuteWait($Inst,$args, @ScriptDir) Edited July 30, 2013 by dachammer
Moderators JLogan3o13 Posted July 30, 2013 Moderators Posted July 30, 2013 I'm not sure what you mean by "need to pass more arguments". You should be able to do this: ShellExecute("msiexec.exe", @ScriptDir & "KeyViewComponent1080.msi /qb /l*v C:sccmmsi_logsKeyViewComponent1080.log") "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
dachammer Posted July 30, 2013 Author Posted July 30, 2013 That comes up with the msi installer options box. Meaning it's not reading the args correctly.... Windows ® Installer. V 5.0.7601.17514 msiexec /Option <Required Parameter> [Optional Parameter] Install Options </package | /i> <Product.msi> Installs or configures a product
DW1 Posted July 30, 2013 Posted July 30, 2013 Is it case sensitive? You can test by changing your lower case l to an uppercase L. Msiexec (command-line options) shows the command as "/L*v", I don't know if this is why you are getting the syntax error, but I suppose it is possible. AutoIt3 Online Help
Moderators JLogan3o13 Posted July 30, 2013 Moderators Posted July 30, 2013 @dachammer - Try this to confirm that the output looks the way you would like it: $var = @ScriptDir & "\KeyViewComponent1080.msi /qb /l*v C:\sccm\msi_logs\KeyViewComponent1080.log" ConsoleWrite($var & @CRLF) "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Solution TXTechie Posted July 30, 2013 Solution Posted July 30, 2013 (edited) dachammer, You need to include the /i switch before you provide the MSI folderpath, like this: ShellExecute("msiexec.exe", "/i " & @ScriptDir & "\KeyViewComponent1080.msi /qb /l*v C:\sccm\msi_logs\KeyViewComponent1080.log") You might even need to include quotes around your MSI folderpath if there are spaces in the folder path. Edited July 30, 2013 by TXTechie
Moderators JLogan3o13 Posted July 30, 2013 Moderators Posted July 30, 2013 good lord, can't believe I missed that. Nice catch TXTechie. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
DW1 Posted July 30, 2013 Posted July 30, 2013 good lord, can't believe I missed that. Nice catch TXTechie. LOL, is there room on that boat? I was even on the damn technet page... AutoIt3 Online Help
dachammer Posted July 30, 2013 Author Posted July 30, 2013 Still coming up with msi installer parameters box. Syntax is incorrect.... $var = @ScriptDir & "KeyViewComponent1080.msi /qb /l*v C:sccmmsi_logsKeyViewComponent1080.log" ConsoleWrite($var & @CRLF) Where do I read the output of this file at?
Moderators JLogan3o13 Posted July 30, 2013 Moderators Posted July 30, 2013 You would see it in the bottom portion of the console if you have the full AutoIt install and are using SciTe. If not, try this instead: MsgBox(4096, "", $var) "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
DW1 Posted July 30, 2013 Posted July 30, 2013 (edited) And make sure you read TXTechie's post which is likely the issue dachammer, You need to include the /i switch before you provide the MSI folderpath, like this: ShellExecute("msiexec.exe", "/i " & @ScriptDir & "\KeyViewComponent1080.msi /qb /l*v C:\sccm\msi_logs\KeyViewComponent1080.log") You might even need to include quotes around your MSI folderpath if there are spaces in the folder path. Edited July 30, 2013 by danwilli AutoIt3 Online Help
TXTechie Posted July 30, 2013 Posted July 30, 2013 JLogan3o13 & danwilli, It was one of those too obvious to even notice things. I had to check one of my MSI install scripts and compare the entire command-line in order to see it.
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