Jump to content
Sign in to follow this  
rbenner1184

Error: Illega text at the end of statement (one statement per line)

Recommended Posts

rbenner1184

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

Share this post


Link to post
Share on other sites
Melba23

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 silent
Try 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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
rbenner1184

Hey thanks Melba23. I look at code all day so some times my brain just gets fried after a while >_<:)

Share this post


Link to post
Share on other sites
rbenner1184

Yep that did the trick thanks.

Share this post


Link to post
Share on other sites
Melba23

rbenner1184,

 

I look at code all day so some times my brain just gets fried after a while

I know the feeling! :D

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
water

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 (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
rbenner1184

Yes water I will do this from now on. I appologize I just learned this last month.

Share this post


Link to post
Share on other sites
water

No need to apologize :)

We learn something new every day.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  

×