rbenner1184 Posted November 7, 2013 Share Posted November 7, 2013 Hello this has been driving me crazy I am trying to build a script that will check the OS arch and apply the correct service pack 2 for Office 2010. When i compile this I do not recieve any errors, but after i run the EXE i get this AutoIT error. Line 28 (File""): Error: Illega text at the end of statement (one statement per line) Here is my code. Thanks ------------------------------------------------------------------------------------------------------------------------------------------- AutoItSetOption("TrayIconHide",1) $SilentInstall = False $installDir = "C:AdminAppUpdOffice Pro 2010 SP2" $logFile = $installDir & "" & @ScriptName & ".log" $logFileSubApp = $installDir & "" & @ScriptName & "_bundled_app.log" $appTitle = "Office Pro 2010 SP2" $ret = 0 ;command options if $cmdLine[0] > 0 then for $a = 1 to $cmdLine[0] if StringLeft($cmdLine[$a],1) = "-" then $cmdLine[$a] = "/" & StringMid($cmdLine[$a],1) EndIf Switch $cmdLine[$a] Case "/s", "/q", "/silent", "/quiet" $SilentInstall = True EndSwitch Next EndIf ;start the log DirCreate($installDir) if not $SilentInstall then ProgressOn($appTitle,"Staging Files","Please Wait...",-1,-1,16) ;stage the files FileInstall("officesp2010-kb2687455-fullfile-x86-en-us.exe",$installDir & "officesp2010-kb2687455-fullfile-x86-en-us.exe") If @OSArch = "x86" Then ;run the command ProgressSet(100,"Installing Office Pro 2010 SP2") RunWait('"' & $installDir & 'officesp2010-kb2687455-fullfile-x86-en-us.exe /quiet"') _Log("Install returned " & $ret & ", @err=" & @error & ", @ext=" & @extended) Else @OSArch = "x64" Then ProgressSet(100,"Installing Office Pro 2010 SP2") RunWait('"' & $installDir & 'officesp2010-kb2687455-fullfile-x64-en-us.exe /quiet"') EndIf prompt if not silent ProgressOff() if not $SilentInstall Then _ShowUserPrompt($ret) exit $ret Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 7, 2013 Moderators Share Posted November 7, 2013 rbenner1184,A couple of obvious problems:Else @OSArch = "x64" Then ; should be ElseIf @OSArch = "x64" Then ; And prompt if not silent ; should be ; prompt if not silentTry amending those and see if it fixes the problem. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
rbenner1184 Posted November 7, 2013 Author Share Posted November 7, 2013 Hey thanks Melba23. I look at code all day so some times my brain just gets fried after a while Link to comment Share on other sites More sharing options...
rbenner1184 Posted November 7, 2013 Author Share Posted November 7, 2013 Yep that did the trick thanks. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 7, 2013 Moderators Share Posted November 7, 2013 rbenner1184, I look at code all day so some times my brain just gets fried after a whileI know the feeling! Glad I could help. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
water Posted November 7, 2013 Share Posted November 7, 2013 BTW: Could you please put your script code in AutoIt tags (the blue "A" icon in the editor) - greatly enhances readability My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
rbenner1184 Posted November 8, 2013 Author Share Posted November 8, 2013 Yes water I will do this from now on. I appologize I just learned this last month. Link to comment Share on other sites More sharing options...
water Posted November 8, 2013 Share Posted November 8, 2013 No need to apologize We learn something new every day. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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