rbenner1184 Posted November 11, 2013 Posted November 11, 2013 (edited) Hello I am trying to build a script and I have read over the code several times, but I think I just need a seperate pair of eyes to look at this.This keeps telling me that there is an error in the expression and I am confused what this may be. I figured I would have the experts look at this. Thanks. expandcollapse popup$SilentInstall = False $installDir = "C:\Admin\AppUpd" $logFile = $installDir & "\" & @ScriptName & ".log" $logFileSubApp = $installDir & "\" & @ScriptName & "_bundled_app.log" $logEntries = 0 $appVersion = "13.3" $appTitle = "Citrix Client v" & $appVersion $ret = 0 ;command options ; <exe> /s 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) _Log("Log Started. SilentInstall = " & $SilentInstall) ;_CheckIfAdmin() ;not needed on most installs since the #requireadmin immediately prompts to run as admin if not $SilentInstall then ProgressOn($appTitle,"","Please Wait...",-1,-1,16) ProgressSet(50,"Please wait...","Installing") FileInstall("CitrixReceiverEnterprise.exe",$installDir & "\CitrixReceiverEnterprise.exe",1) FileInstall("ReceiverCleanupUtility.exe", $installDir & "\ReceiverCleanupUtility.exe"1) ;install the Citrix Client if its not installed already ;its already installed, and will be uninstalled If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", "CitrixOnlinePluginFull") Then ProgressSet(50,"Please wait...","Uninstalling") _Log("Uninstalling Citrix Receiver Enterprise " & $appVersion) RunWait('"' & $installDir & '\ReceiverCleanupUtility.exe /silent"',@SW_SHOWMINNOACTIVE) _Log("Install returned " & $ret & ", err=" & @error & ", ext=" & @extended) ;will install the citrix application Else ProgressSet(50,"Please wait...","Installing") _Log("Installing Citrix Receiver Enterprise " & $appVersion) RunWait('"' & $installDir & '\CitrixReceiverEnterprise.exe" /silent /includeSSON ADDLOCAL="ReceiverInside,ICA_Client,SSON,PN_Agent" ENABLE_SSON=yes SERVER_LOCATION="http://SSCVPOCCTXWEB01.corp.ryder.com/Citrix/PNAgent/Config.xml"',$installDir) _Log("Install returned " & $ret & ", err=" & @error & ", ext=" & @extended) ProgressSet(50,"Please wait...","Deleting files") ;Clean up the icons from the previous installs FileDelete(@DesktopCommonDir & "\SMO Windows Client on Citrix.url") FileDelete(@DesktopCommonDir & "\SMO Windows Client on Citrix.url.lnk") FileDelete(@DesktopCommonDir & "\SMO Windows Client on Citrix.lnk") run(@ComSpec & ' /c del /f /s /q "c:\SMO Windows Client on Citrix.lnk"',"c:\",@SW_HIDE) EndIf ;set up the hosts file (DO NOT USE) ;~ FileInstall("hosts","C:\Windows\System32\drivers\etc\hosts",1) ;Configure the after install stuff like the icon and policy ;ProgressSet(80) ;_DoPostInstallOperations() ;prompt the user if not silent ProgressOff() if not $SilentInstall Then _ShowUserPrompt($ret) ;exit _Log("Exiting") exit $ret ;---------------------------------- ; FUNCTIONS ;---------------------------------- Func _SendToCore($ReturnMessage) ;this will only work if its being sent through LANDesk If FileExists("C:\Program Files\LANDesk\LDClient\sdclient.exe") Then RunWait(@ComSpec & ' /c sdclient.exe /msg="' & $ReturnMessage & '."','C:\Program Files\LANDesk\LDClient',@SW_HIDE) EndIf EndFunc Func _Log($string) $datetime = @MDAY & "/" & @MON & "/" & @YEAR & " " & @HOUR & ":" & @MIN & "." & @SEC & " - " if FileExists($logFile) AND $logEntries = 0 Then ;add a blank line if this is the first entry in the log RunWait(@ComSpec & " /c echo - >> " & $logFile,@WindowsDir,@SW_HIDE) EndIf ;add the pertinent log information RunWait(@ComSpec & " /c echo " & $datetime & $string & " >> " & $logFile,@WindowsDir,@SW_HIDE) ;increase the log entries $logEntries = $logEntries + 1 EndFunc Func _CheckIfAdmin() if not IsAdmin() Then ;Log error (if there's write ability to the install dir then this will update) _Log("Admin rights were not detected. Install will exit.") ;Display the error message if its not silent if not $SilentInstall Then MsgBox(16,"Error","You must have Administrator rights to run this.",300) EndIf exit 1625 ;This installation is forbidden by system policy. Contact your system administrator. EndIf EndFunc Func _ShowUserPrompt($returnCode) if $returnCode = 3010 then ;reboot needed $mret = MsgBox(64 + 4,$appTitle,"A reboot is required to complete this install." & @crlf & @crlf & "Would you like to reboot now?",300) if $mret = 6 Then ;Yes was clicked Shutdown(6,$appTitle & " installation") exit $returnCode EndIf ElseIf $returnCode = 0 Then ;successful install MsgBox(64,$appTitle,"Installation completed successfully.",300) ElseIf $returnCode = 1 then ;already installed MsgBox(64,$appTitle,"This software is already installed." & @crlf & @crlf & "No action was taken.",300) Else MsgBox(16,$appTitle,"There was a problem running this install. The return code was " & $returnCode & _ @crlf & @crlf & "Refer to the following log(s) for more details:" & @crlf & " " & $logFile & @crlf & " " & $logFileSubApp,300) EndIf EndFunc Func _DoPostInstallOperations() ;install the icon and link _Log("Setting up the icon for All Users") FileInstall("Seagull.ico",@WindowsDir & "\System32\Seagull.ico",1) ;FileInstall("SMO Windows Client on Citrix.url",@DesktopCommonDir & "\SMO Windows Client on Citrix.url",1) FileDelete(@DesktopCommonDir & "\SMO Windows Client on Citrix.url") FileDelete(@DesktopCommonDir & "\SMO Windows Client on Citrix.url.lnk") FileCreateShortcut("http://smoctx/Citrix/XenApp/auth/login.aspx",@DesktopCommonDir & "\SMO Windows Client on Citrix","","","",@WindowsDir & "\System32\Seagull.ico") ;set up the policy to allow citrix to run $regKey = "HKLM\Software\Microsoft\Internet Explorer\Low Rights\ElevationPolicy\{9E22DED2-1858-4511-96C4-5625F54CECCA}" RegWrite($regKey,"AppPath","REG_SZ",@ProgramFilesDir & "\Citrix\ICA Client") RegWrite($regKey,"AppName","REG_SZ","wfcrun32.exe") RegWrite($regKey,"Policy","REG_DWORD",3) ;remove the run key entry RegDelete("HKLM\Software\Microsoft\Windows\CurrentVersion\Run","ConnectionCenter") ;remove the bho that slows down ie ;CtxIEInterceptorBHO - {2C4631FF-5CC8-4EBC-A0DF-34C92291759E} ;CtxVDAIEInterceptorBHO - {A44B166E-5097-4B07-8732-BFD924C3CF68} RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects\{2C4631FF-5CC8-4EBC-A0DF-34C92291759E}") ;RegDelete("HKLM\SOFTWARE\Classes\CLSID\{2C4631FF-5CC8-4EBC-A0DF-34C92291759E}") ;RegDelete("HKLM\SOFTWARE\Classes\IEInterceptor.InterceptorBHO") ;RegDelete("HKLM\SOFTWARE\Classes\IEInterceptor.InterceptorBHO.1") EndFunc Edited November 11, 2013 by rbenner1184
Developers Jos Posted November 11, 2013 Developers Posted November 11, 2013 (edited) Try installing the full SciTE4AutoIt3 and run au3check from SciTE by doing Ctrl+F5... it will tell you the exact line(s) that contain errors: >Running AU3Check (1.54.22.0) from:C:\Program Files (x86)\AutoIt3 D:\Development\AutoIt3\programs\test\test.au3(54,86) : ERROR: syntax error FileInstall("ReceiverCleanupUtility.exe", $installDir & "\ReceiverCleanupUtility.exe"1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ au3check will also be ran when doing an Run (F5) or Compile(F7). Jos Edited November 11, 2013 by Jos 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.
rbenner1184 Posted November 11, 2013 Author Posted November 11, 2013 See this is the thing as I had done this prior and I do not get any errors. This is why I am so confused.
Developers Jos Posted November 11, 2013 Developers Posted November 11, 2013 Are you sure you have the separate SciTE4AutoIt3 installer installed and when pressing F5 it is running AutoIt3Wrapper? Jos 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.
rbenner1184 Posted November 11, 2013 Author Posted November 11, 2013 Or perhaps I do not have the full version of theSciTE4AutoIt3
rbenner1184 Posted November 11, 2013 Author Posted November 11, 2013 I just installed it now. I was using the AutoIT Wrapper with the install package. I'm trying this now.
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