ThinkOSX Posted February 19, 2012 Share Posted February 19, 2012 Greetings First off, I'd like to apologize for making a topic about this. I've searched for the last 20 mins but have been unable to answer my own question. What i am attempting to do is when a user clicks a button, a program is installed. My AutoIt script is in c:\test The file which i need to run is in c:\test\bin\cc\ I also need to pass command line arguments to it. I think this issue could be resolved by the workingdirectory parameter but i cant figure out the usage or find an example. I do not want to specify the ENTIRE path. Just bin\cc\ as this will be moved to different computers. Below is my code. Thank you in advance. expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Process.au3> $MainPage = GUICreate("VCS Config", 201, 141, -1, -1) $BUT1_SysInfo = GUICtrlCreateButton("System Info", 8, 8, 185, 25) $BUT2_InstallCC = GUICtrlCreateButton("Install Calling Card", 8, 41, 185, 25) $BUT3_InstallOPT = GUICtrlCreateButton("Install Optimization Tools", 8, 73, 185, 25) $BUT4_EXT = GUICtrlCreateButton("Exit", 8, 106, 185, 25) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() IF $msg = $BUT2_InstallCC Then InstallCallingCard() ENDIF IF $msg = $BUT3_InstallOPT Then OPTPAK() ENDIF IF $msg = $BUT4_EXT Then Exit EndIf WEnd FUNC InstallCallingCard() $FREE = DriveSpaceFree("C:\") MsgBox(64,"TotalFree",$FREE) RunWait ( "vcscc.msi /norestart /quiet" [, "bin\cc\" ] ) EndFunc Func OPTPAK() MsgBox(64,"Button 3 Pressed!","Worked!!!") EndFunc Skeletor 1 Link to comment Share on other sites More sharing options...
Chimaera Posted February 19, 2012 Share Posted February 19, 2012 (edited) Try @ScriptDir & "bincc" Or maybe @WorkingDir & "bincc" On a second glance you need to remove the square brackets (they are there to denote optional params) RunWait ( "vcscc.msi /norestart /quiet" ,[ "bincc"] ) More like this RunWait ( "vcscc.msi /norestart /quiet", @ScriptDir & "bincc") or if your switches play up maybe RunWait ( "vcscc.msi" & " /norestart /quiet", @ScriptDir & "bincc") Edited February 19, 2012 by Chimaera If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
Sam1el Posted February 22, 2012 Share Posted February 22, 2012 (edited) I"m having a similar issue with a large install string. Runwait('V5_R20_DMU\INTEL\startb.exe' & '-u C:\Program Files\Dassault Systemes\B20_DMU' & '-newdir -ident B20DMU -all -noStartMenuIcon -noStartMenuTools -noDesktopIcon', @ScriptDir) I've tried a million different combinations of switches and quotes. Can't get it to pass the command line arguements no matter what I do. Edited February 22, 2012 by Sam1el Link to comment Share on other sites More sharing options...
Chimaera Posted February 23, 2012 Share Posted February 23, 2012 (edited) I"m having a similar issue with a large install string. Runwait('V5_R20_DMUINTELstartb.exe' & '-u C:Program FilesDassault SystemesB20_DMU' & '-newdir -ident B20DMU -all -noStartMenuIcon -noStartMenuTools -noDesktopIcon', @ScriptDir) Im no expert with these but this looks a little closer Runwait(@ScriptDir & 'V5_R20_DMUINTELstartb.exe' & ' -u', 'C:Program FilesDassault SystemesB20_DMU' & ' -newdir -ident B20DMU -all -noStartMenuIcon -noStartMenuTools -noDesktopIcon') If its not running from the script dir you will need to change the macro to suit, ive added a space in front of your -u and-newdir as they usually start with a space but im not sure about the switches after the DMU part you will have to keep playing If the switches including the -u are all for the program try this maybe Runwait(@ScriptDir & 'V5_R20_DMUINTELstartb.exe' & ' -u -newdir -ident B20DMU -all -noStartMenuIcon -noStartMenuTools -noDesktopIcon', 'C:Program FilesDassault SystemesB20_DMU') Edited February 23, 2012 by Chimaera If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
ThinkOSX Posted February 26, 2012 Author Share Posted February 26, 2012 (edited) Thank you so much!!! That got me on the right track. It looks like MSI's need to be executed differently than an EXE I ended up doing: ShellExecute("msiexec", "/i" & $WorkingDir & "vcscc.msi /quiet") Edited February 26, 2012 by ThinkOSX Link to comment Share on other sites More sharing options...
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