Jump to content

Help with the RUN command


Recommended Posts

; 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:

Posted Image

My .exe is run from the same directory of the msi.

I have tried:

Run("Photoshop.msi") - without any switches

Run("C:\OemPreinstall\Photoshop\Photoshop.msi") - full path to the msi without any switches

I have also tried both of the above with switches.

Run("calc.exe") and Run("notepad.exe") work without any trouble.

Link to comment
Share on other sites

try

Run(@ComSpec & ' /c ' & "msiexec /i Photoshop.msi /qn UNITYSELECTION=RETAIL SERIALNUMBERTEMP=xxxx-xxxx-xxxx-xxxx-xxxx-xxxx",'',@SW_HIDE)
Edited 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.

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 by MHz
Link to comment
Share on other sites

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!! :whistle:

Thanks!!

Link to comment
Share on other sites

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É][ÝËJB

MHz, 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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...