rhaynes0010 Posted November 4, 2006 Posted November 4, 2006 ; Script Start - Add your code below here Run("Photoshop.msi /qn UNITYSELECTION=RETAIL SERIALNUMBERTEMP=xxxx-xxxx-xxxx-xxxx-xxxx-xxxx") WinWaitActive("Adobe Photoshop Installer") ControlClick("Adobe Photoshop Installer", "", "Button6") WinWaitActive("Adobe Activation") ControlClick("Adobe Activation", "", "Button1")Returns the following:My .exe is run from the same directory of the msi.I have tried:Run("Photoshop.msi") - without any switchesRun("C:\OemPreinstall\Photoshop\Photoshop.msi") - full path to the msi without any switchesI have also tried both of the above with switches.Run("calc.exe") and Run("notepad.exe") work without any trouble.
GaryFrost Posted November 4, 2006 Posted November 4, 2006 (edited) try Run(@ComSpec & ' /c ' & "msiexec /i Photoshop.msi /qn UNITYSELECTION=RETAIL SERIALNUMBERTEMP=xxxx-xxxx-xxxx-xxxx-xxxx-xxxx",'',@SW_HIDE) Edited November 4, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Developers Jos Posted November 4, 2006 Developers Posted November 4, 2006 xyz.msi is not an executable. you need to run msiexe.exe or use ShellExecute SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
MHz Posted November 4, 2006 Posted November 4, 2006 Same dir as the script. Run('msiexec /i "' & @ScriptDir & '\Photoshop.msi" /qn UNITYSELECTION=RETAIL SERIALNUMBERTEMP=xxxx-xxxx-xxxx-xxxx-xxxx-xxxx') Notepad and Calc are executables and are in the system path so are easy to execute.
rhaynes0010 Posted November 4, 2006 Author Posted November 4, 2006 Thank you. I have a batch file that I'd like to tun into an .exe, could you take a look and let me know if @ComSpec would be used for most of the commands or if there's a better approach. I'd eventually like to add a GUI. I only want to be pointed in the right direction. I'm trying to read documentation first, honest. :">Document.txt
MHz Posted November 4, 2006 Posted November 4, 2006 I'd eventually like to add a GUI. I only want to be pointed in the right direction. I'm trying to read documentation first, honest. :">You can use all Au3 scripts if you like. ComSpec is not normally needed for executables and others as you have noticed can use the executable that normally runs them. If you want, you could try this software deployment method like I use here. It runs scripts like these here in sequence by searching within the select folders.Suppose you want to use a SplashTestOn window for progress of your current script conversion?
MHz Posted November 4, 2006 Posted November 4, 2006 (edited) Here is an untested conversion CODE Opt('ExpandEnvStrings', 1) ; < COMMAND 1 > _Splash('show hidden files and folders/show extensions...') RunWait('reg import %systemdrive%\OemPreinstall\View.reg', '', @SW_HIDE) ; < COMMAND 2 > _Splash('Microsoft .NET Framework 1.1') RunWait('msiexec /i %systemdrive%\OemPreinstall\dotnetfx\netfx.msi /qn') ; < COMMAND 3 > _Splash('Microsoft .NET Framework 2.0') RunWait('%systemdrive%\OemPreinstall\dotnetfx.exe /q:a /c:"install /l /q"') ; < COMMAND 4 > _Splash('Security update for Microsoft .NET Framework 2.0') RunWait('%systemdrive%\OemPreinstall\KB917283.exe /qn') ; < COMMAND 5 > _Splash('Security Update for Microsoft .NET Framework, Version 2.0') RunWait('%systemdrive%\OemPreinstall\KB922770.exe /qn') ; < COMMAND 6 > _Splash('Office 2003 - This might take several minutes to complete') RunWait('msiexec /i %systemdrive%\OemPreinstall\Office\SETUP.EXE TRANSFORMS=PRO11.MST /qn') ; < COMMAND 7 > _Splash('Office updates - This might take several minutes to complete') RunWait('%systemdrive%\OemPreinstall\Office\updates\updates.bat', '', @SW_HIDE) ; < COMMAND 8 > _Splash("turning off the Office '03 Language Bar...") RunWait('reg import %systemdrive%\OemPreinstall\LangBar.reg', '', @SW_HIDE) ; < COMMAND 9 > _Splash('Windows Media Player 11') RunWait('msiexec /i %systemdrive%\OemPreinstall\mpsetupedp.msi /qn') ; < COMMAND 10 > _Splash('update for WMDRM-enabled players') RunWait('%systemdrive%\OemPreinstall\KB902344.exe /q') ; < COMMAND 11 > _Splash('Security Update for Windows Media Player 10 for Windows XP (KB911565)') RunWait('%systemdrive%\OemPreinstall\KB911565.exe /q') ; < COMMAND 12 > _Splash('HighMAT CD Writing Wizard') RunWait('%systemdrive%\OemPreinstall\HMTCD.exe /qn') ; < COMMAND 13 > _Splash('Microsoft PowerToys for Windows XP - This may take a minute or two') RunWait('%systemdrive%\OemPreinstall\PowerToys\PowerToys.bat', '', @SW_HIDE) ; < COMMAND 14 > _Splash('Microsoft Calculator Plus') RunWait('msiexec /i %systemdrive%\OemPreinstall\CalcPlus.msi /qn') ; < COMMAND 15 > _Splash('Windows Media Connect 2.0') RunWait('%systemdrive%\OemPreinstall\wmcsetup.exe /q') ; < COMMAND 16 > _Splash('Adobe Reader 7.0.7') RunWait('msiexec /i %systemdrive%\OemPreinstall\Adobe\7.07\Adobe.msi /qn') ; < COMMAND 17 > _Splash('Accept Adobe Reader EULA...') RunWait('reg import %systemdrive%\OemPreinstall\Adobe\EULA.reg', '', @SW_HIDE) ; < COMMAND 18 > _Splash('Hide the Yahoo! toolbar/Search The Internet menu (Adobe Reader)') FileCopy("%systemdrive%\OemPreinstall\Adobe\disableYahooSearch.js", "C:\Program Files\Adobe\Acrobat 7.0\Reader\Javascripts\", 1) ; < COMMAND 19 > _Splash("Disable 'Search The Internet' in the Search pane (Adobe Reader)") FileMove("%systemdrive%\Program Files\Adobe\Acrobat 7.0\Reader\Javascripts\WebSearch.js", "%systemdrive%\Program Files\Adobe\Acrobat 7.0\Reader\Javascripts\WebSearch.old", 1) ; < COMMAND 20 > _Splash('Shockwave Player 10') RunWait('%systemdrive%\OemPreinstall\Shockwave_Installer_Full.exe /S') ProcessClose('iexplore.exe') ; < COMMAND 21 > _Splash('Security update for Flash player (Flash player Version 9)') RunWait('%systemdrive%\OemPreinstall\KB913433.exe /q:a /r:n') ; < COMMAND 22 > _Splash('Windows Live Messenger 8.1 BETA') RunWait('msiexec /i %systemdrive%\OemPreinstall\MsnMsgs.msi /qn') ; < COMMAND 23 > _Splash('Java Runtime Environment 5.0 Update 9') RunWait('%systemdrive%\OemPreinstall\jre-1_5_0_09-windows-i586-p-s.exe /s /v"/qn ADDLOCAL=ALL IEXPLORER=1 REBOOT=Suppress WEBSTARTICON=0') ; < COMMAND 24 > _Splash('Symantec AntiVirus 10.0 Corporate Edition') RunWait('msiexec /i %systemdrive%\OemPreinstall\AntiVirus\AntiVirus.msi ENABLEAUTOPROTECT=1 RUNLIVEUPDATE=0 /qn') ; < COMMAND 25 > _Splash('Close "Old Virus Definition File" window') RunWait('%systemdrive%\OemPreinstall\WinClose.exe') ; < COMMAND 26 > _Splash('Updating Virus Protection Files -Release Date: November 2, 2006-') RunWait('%systemdrive%\OemPreinstall\definitions.exe /q') ; < COMMAND 27 > _Splash('Internet Explorer 7 - This may take a minute or two') RunWait('%systemdrive%\OemPreinstall\IE7.exe /norestart /quiet /passive') ; < COMMAND 28 > _Splash('WinRAR 3.61') RunWait('%systemdrive%\OemPreinstall\wrar361.exe /s') ; < COMMAND 29 > _Splash('Disable Balloon Tips - Remove Messengers from Startup') RunWait('reg import %systemdrive%\OemPreinstall\BalloonTips.reg', '', @SW_HIDE) ; < COMMAND 30 > _Splash('disable third-party tool bands') RunWait('reg import %systemdrive%\OemPreinstall\thirdparty.reg', '', @SW_HIDE) ; < COMMAND 31 > _Splash('QuickTime 7.1.3') RunWait('msiexec /i %systemdrive%\OemPreinstall\QuickTime\QuickTime.msi /qn') FileMove("%ProgramFiles%\QuickTime\qttask.exe", 'qttask') ; < COMMAND 32 > _Splash('Remove Desktop icons') FileDelete("C:\Documents and Settings\All Users\Desktop\*.*") ; < COMMAND 33 > _Splash('Mozilla Firefox 1.5.0.7') RunWait('%systemdrive%\OemPreinstall\Firefox\setup.exe') ; < COMMAND 34 > _Splash('VMware Workstation 5.5.2') RunWait('msiexec /i "%systemdrive%\OemPreinstall\VMware\VMware Workstation.msi" ADDLOCAL=ALL DESKTOP_SHORTCUT=0 SERIALNUMBER=xxxxx-xxxxx-xxxxx-xxxxx /qn') ; < COMMAND 35 > _Splash('Network Diagnostic Tool') RunWait('%systemdrive%\OemPreinstall\KB914440.exe /q') _Splash('Restarting computer...') Sleep(30000) Shutdown(6) Exit Func _Splash($text, $title = 'Richard Haynes 11/03/2006') SplashTextOn($title, $text, 600, 80, Default, Default, 32) EndFunc Edit: Addition of Opt('ExpandEnvStrings', 1) to expand environmental variables within strings. Edited November 4, 2006 by MHz
rhaynes0010 Posted November 5, 2006 Author Posted November 5, 2006 Thank you so much, this will give me a starting point to learn from. Opt('ExpandEnvStrings', 1) is that related to FileCopy? Everything else was self-explanatory Thank you again, I credited you in the comments. Going to test it now.
Stealth111 Posted November 5, 2006 Posted November 5, 2006 One question to throw into the mix reguarding the FileCopy function, as I have not been able to get a solid answer on this 1.. Can the Filecopy or DirCopy command in ANY way be made to overwrite existing files..BUT ONLY if they file is newer than the existing file in the destnation directory?? kind of like the xcopy /d command.. I have the same situation going as rhaynes0010, but my batch files involve alot of xcopy commands which start out as: xcopy /e /c /h /y /i /d "\\main-server\whateverfolder" "c:\whateverfolder" where: /e copy dirs and sub dirs even if empty /c continue copying even if errors occur /h copy system and hidden files /y suppress warning to overwrite existing files /i if destination does not exist assume that destination is a directory /d copy ONLY files that has newer source time than destination files time If anyone could tell me a way to do an overwrite existing, but only OLDER existing then I would greatly appreciate it!! Thanks!!
rhaynes0010 Posted November 5, 2006 Author Posted November 5, 2006 This works...DirCreate("C:\Documents and Settings\All Users\Application Data\Adobe Systems\Product licenses\") FileCopy("C:\OemPreinstall\Photoshop\B2B86000.dat", "C:\Documents and Settings\All Users\Application Data\Adobe Systems\Product licenses\", 1) oÝ÷ Ù´áÇhzÉè·öÚºÚ"µÍÜX]J ][ÝÉPSTÑTÔÑSIIÌLÐXØ][Û]IÌLÐYØHÞÝ[ÉÌLÔÙXÝXÙ[ÙÉÌLÉ][ÝÊB[PÛÜJ ][ÝÉÞÝ[Y]IIÌLÓÙ[TZ[Ý[ ÌLÔÝÜÚÜ ÌLÐ ] ][ÝË ][ÝÐÎÌLÑØÝ[Y[È[Ù][ÜÉÌLÐ[ÙÉÌLÐXØ][Û]IÌLÐYØHÞÝ[ÉÌLÔÙXÝXÙ[ÙÉÌLÉ][ÝËJBoÝ÷ Ùµ,x(¬ÊË^Úâ½ïÛm8b³ +ÏÛjëh×6 FileCopy("C:\OemPreinstall\Photoshop\B2B86000.dat", "C:\Documents and Settings\All Users\Application Data\Adobe Systems\Product licenses\", 1) oÝ÷ Ù´áÇhzÉè·öÚºÚ"µÍ[PÛÜJ ][ÝÐÎÌLÓÙ[TZ[Ý[ ÌLÔÝÜÚÜ ÌLÐ ] ][ÝË ][ÝÐÎÌLÑØÝ[Y[È[Ù][ÜÉÌLÐ[ÙÉÌLÐXØ][Û]IÌLÐYØHÞÝ[ÉÌLÔÙXÝXÙ[ÙÉÌLÉ][ÝËJBMHz, I have yet to test your script, but I noticed that you used/left the %systemdrive% variable in there, so I assumed it would work. What have I done wrong? Must they be defined - if so, wouldn't that defeat the purpose?Again, Thank you for your time.
rhaynes0010 Posted November 5, 2006 Author Posted November 5, 2006 I just realized that I can turn this: DirCreate("%ALLUSERSPROFILE%\Application Data\Adobe Systems\Product licenses\") FileCopy("%systemdrive%\OemPreinstall\Photoshop\B2B86000.dat", "C:\Documents and Settings\All Users\Application Data\Adobe Systems\Product licenses\", 1) oÝ÷ Ú)í¢Øb±«¢+Ø)¥± ½Áä ÅÕ½ÐìÍåÍѵɥÙÀäÈí=µAÉ¥¹Íѱ°ÀäÈíA¡½Ñ½Í¡½ÀÀäÈíÉàØÀÀÀ¹ÐÅÕ½Ðì°ÅÕ½ÐíèÀäÈí½Õµ¹Ñ̹MÑÑ¥¹ÌÀäÈí±°UÍÉÌÀäÈíÁÁ±¥Ñ¥½¸ÑÀäÈí½MåÍѵÌÀäÈíAɽÕб¥¹ÍÌÀäÈìÅÕ½Ðì°à¤( Just thought I'd throw that out there since Stealth mentioned FileCopy.
rhaynes0010 Posted November 5, 2006 Author Posted November 5, 2006 AutoIt HelpOpt('ExpandEnvStrings', 1) e.g., "The temp directory is: %temp%" - Answered my question.My apologies...
Stealth111 Posted November 5, 2006 Posted November 5, 2006 (edited) I figured out my own question.. I found that by using the line: run("xcopy /e /c /h /y /i /d C:\temp2 c:\temp3") I can still use good ole xcopy now.. Edited November 30, 2006 by Stealth111
rhaynes0010 Posted November 6, 2006 Author Posted November 6, 2006 I'm trying to do the same thing (the progress bar) Stealth, I'll PM you if I have any luck. I'd appreciate the same if you don't mind.
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