breedja Posted January 11, 2007 Posted January 11, 2007 I'm a bit of a beginner... I keep getting an error (Unable to execute the external program) when I run my script. The files and directories exist and I can run from a command line. The problem is with this line...Run("msiexec /i c:\temp\ExpressImageInstall\expressimagesetup.msi /qb+") DirCreate("c:\temp\ExpressImageInstall") FileCopy("\\ExpressImageInstall\*.*","c:\temp\ExpressImageInstall") RunAsSet("Administrator", @Computername, "xxxxxxxx") Run("msiexec /i c:\temp\ExpressImageInstall\expressimagesetup.msi /qb+") ; Reset user's permissions RunAsSet() Also, can anyone recommend any reference material for scripting? Many thanks.
Zedna Posted January 11, 2007 Posted January 11, 2007 Use Search at this forum (in right upper corner), especially with search in Title only:Search results for MSIHere is one topic for you.About learning stuff: I think the best is AutoIt Helpfile with all examples included in it:"C:\Program Files\AutoIt3\autoit.chm" Resources UDF ResourcesEx UDF AutoIt Forum Search
Zedna Posted January 11, 2007 Posted January 11, 2007 (edited) Run("msiexec /i c:\temp\ExpressImageInstall\expressimagesetup.msi /qb+") Try (not tested): RunWait("msiexec /i /qb+ c:\temp\ExpressImageInstall\expressimagesetup.msi")oÝ÷ Ù±!?Ûjëh×6DirCreate("c:\temp\ExpressImageInstall") FileCopy("\\ExpressImageInstall\*.*","c:\temp\ExpressImageInstall\") IF Not FileExists("c:\temp\ExpressImageInstall\expressimagesetup.msi") Then MsgBox(0,'Error', 'MSI file not found!') Exit EndIf RunAsSet("Administrator", @Computername, "xxxxxxxx") RunWait("msiexec /i /qb+ c:\temp\ExpressImageInstall\expressimagesetup.msi") RunAsSet() Note: added \ in FileCopy and FileExists() Edited January 11, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
breedja Posted January 11, 2007 Author Posted January 11, 2007 Zedna, I got the same error.. Unable to execute the external program.: RunWait("msiexec /i /qb+ c:\temp\ExpressImageInstall\expressimagesetup.msi") The directory name is invalid.
Joon Posted January 11, 2007 Posted January 11, 2007 (edited) How about specifying working directory. RunWait("msiexec /i c:\temp\ExpressImageInstall\expressimagesetup.msi /qb+","c:\temp\ExpressImageInstsall") Edited January 11, 2007 by Joon
breedja Posted January 11, 2007 Author Posted January 11, 2007 I'm checking out some other posts...thanks again.
Zedna Posted January 12, 2007 Posted January 12, 2007 Zedna, I got the same error.. Unable to execute the external program.: RunWait("msiexec /i /qb+ c:\temp\ExpressImageInstall\expressimagesetup.msi") The directory name is invalid. Try some testing: #Include <File.au3> #Include <Array.au3> DirCreate("c:\temp\ExpressImageInstall") FileCopy("\\ExpressImageInstall\*.*","c:\temp\ExpressImageInstall\") ShowMSI('\\ExpressImageInstall\') ShowMSI('c:\temp\ExpressImageInstall\') Func ShowMSI($dir) $FileList=_FileListToArray($dir,"*.msi",1) If @Error Then Return _ArraySort($FileList,0,1) $tmp = '' For $i = 1 to UBound($FileList) - 1 $tmp &= $FileList[$i] & @crlf Next MsgBox(0,'Info: ' & $dir, $tmp) EndFunc Also check if msiexex is somewhere in PATH Resources UDF ResourcesEx UDF AutoIt Forum Search
Bert Posted January 12, 2007 Posted January 12, 2007 From the helpfile:6. Why can I only use Run() to execute .exe files? What about .msi / .txt and others?Only a few file extensions are usually "runable" - these are .exe, .bat, .com, .pif. Other file types like .txt and .msi are actually executed with another program. When you double click on a "myfile.msi" file what actually happens in the background is that "msiexec.exe myfile.msi" is executed. So to run a .msi file from AutoIt you would do: RunWait("msiexec myfile.msi") Or, an even simpler way is to run the command "start" which will automatically work out how to execute the file for you: RunWait(@COMSPEC & " /c Start myfile.msi") Back To Top The Vollatran project My blog: http://www.vollysinterestingshit.com/
herewasplato Posted January 12, 2007 Posted January 12, 2007 I see nothing wrong with the Run in the OP, but there is always ShellExecute. [size="1"][font="Arial"].[u].[/u][/font][/size]
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