mFm Posted May 25, 2008 Posted May 25, 2008 I want to run a setup file and use the following code to run the file.Run("setup.msi") i also try run("setup.msi","") N.B. Both script and msi setup file are in same directory[folder]and then i save the script and run it. but nothing happens whats wrong with my code? did it run an msi file.? if not then how can i run the setup file. any alternatives.? Any idea what's wrong with my code ??? looking 4 help
Jos07 Posted May 25, 2008 Posted May 25, 2008 (edited) 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, run the command \\\"start\\\" which will automatically work out how to execute the file for you: RunWait(@COMSPEC & \\\" /c Start myfile.msi\\\") Or, use the ShellExecuteWait function which will automatically work out how to execute the file for you: ShellExecuteWait(\\\"myfile.msi\\\")Note : Please avoid \\ because i dont know why it comes with every post while i uses commas. Edited May 25, 2008 by Jos07 Always Keep Your Sig Small... Like me :D
mFm Posted May 25, 2008 Author Posted May 25, 2008 thanks man i will try this and 4 your problem use [*co*de][*/*co*de] code tags to enclose your coding this way whatever u write stays that way.N.B. without asterisk
mFm Posted May 28, 2008 Author Posted May 28, 2008 no hope i was to unable to run it any one else please i need to run this. your first runwait statement. all possible way that i supposed i checked. 1 . > RunWait(,\"msiexec myfile.msi,\") 2 . > RunWait(\,"msiexec myfile.msi\,") non of the above code works.
enaiman Posted May 28, 2008 Posted May 28, 2008 (edited) In order to avoid any error use the full path for your msi file. RunWait("msiexec the_full_name_including_path_of_your_msi_file") or as Jos07 suggested: ShellExecuteWait("myfile.msi") (use also the full file name) Edited May 28, 2008 by enaiman SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
system24 Posted May 28, 2008 Posted May 28, 2008 In order to avoid any error use the full path for your msi file. RunWait("msiexec the_full_name_including_path_of_your_msi_file") or as Jos07 suggested: ShellExecuteWait("myfile.msi") (use also the full file name) If the msi file and the executed script are in the same folder, you could use this: ShellExecuteWait(@ScriptDir & "\myfile.msi") ;myfile.msi contains a backslash because @ScriptDir does not have one [center]It's a question of mind over matter, if I don't mind, it doesn't matter.[/center]
mFm Posted May 28, 2008 Author Posted May 28, 2008 i use the following code to succesfully run the application. ShellExecute("MyFile.msi")
Mrinaldi Posted May 28, 2008 Posted May 28, 2008 I use this normally RunWait('msiexec /options for install/patch "path to MSI" /options for quiet install /log ' & $WorkDir & '\MSI LOG.txt PROPERTIES') to install RunWait('msiexec /i \\server\directory\setup.msi /qb /log ' & $WorkDir & '\log.txt REINSTALL=All REINSTALLMODE=vomus') to patch an admin install RunWait('msiexec /p \\server\share\ArcGISAdminInstall\Service_packs\SP5\ArcGISDesktop92sp5.msp /a \\server\share\ArcGISAdminInstall\Setup.msi /qb /Log \\server\share\ArcGISAdminInstall\Service_packs\SP5\arcview.sp5.txt')
secman Posted January 7, 2009 Posted January 7, 2009 Thanks this has solved a problem for me as well. Secman
stoneheart Posted March 21, 2010 Posted March 21, 2010 I have problem with ShellExecuteWait coz After running the requested program the script pauses until the requested program terminates so the script is stoped until i close the prog
JohnOne Posted March 21, 2010 Posted March 21, 2010 Try just ShellExecute() AutoIt Absolute Beginners  Require a serial  Pause Script  Video Tutorials by Morthawt  ipify Monkey's are, like, natures humans.
TuxBird Posted February 9, 2011 Posted February 9, 2011 (edited) I am trying to recreate a LanDesk script with AutoIt and I am having difficulties getting it to work any assistance would be great. the original script went: "msiexec", para="/i \\servername\RPAA\myfile.msi /qb /Lv* "C:\RP_install.log" PATHINI="\\server\RPAA\Config.ini"" I think using the ShellExecute is the way to go but I can't get the syntax correct. Edited February 9, 2011 by TuxBird
hannes08 Posted February 9, 2011 Posted February 9, 2011 Hello TuxBird, take a look at the helpfile under Contents => Language Reference => Datatypes. Look at the "Strings" paragraph. As far as I can see fro your example you've got a quote-problem. Regards, Hannes Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
MHz Posted February 10, 2011 Posted February 10, 2011 ... "msiexec", para="/i \\servername\RPAA\myfile.msi /qb /Lv* "C:\RP_install.log" PATHINI="\\server\RPAA\Config.ini""... Welcome TuxBird, The "para= ..." property does not look correct to me. The property value i.e. "/i", looks like the switches you should be passing direct to msiexec instead. Try this for Run(). Run('msiexec /i "\\server\RPAA\myfile.msi" /qb /lv* "C:\RP_install.log" "PATHINI=\\server\RPAA\Config.ini"') or perhaps try this with ShellExecute(). ShellExecute('"\\server\RPAA\myfile.msi"', '/qb /lv* "C:\RP_install.log" "PATHINI=\\server\RPAA\Config.ini"') Take note of how the single quotes wrap around the whole of the string parameters so the double quotes within are valid to be passed. Use the workingdir parameter if required.
TuxBird Posted February 14, 2011 Posted February 14, 2011 I did have a quote problem but I got it to go with the following: ShellExecute("msiexec", '/i \\server\setup.msi /qb /Lv* C:\RP_install.log PATHINI=\\server\application\Config.ini') Thanks for the help.
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