rbenner1184 Posted January 29, 2014 Share Posted January 29, 2014 I am attempting to do a silent install for my company for Firefox and lock down certain sites with a certain add ons. To lock it down i have copied the Mozilla directory from the profile that I have staged for testing. My concern is the error that I get, because I run the syntax error check and I don't receive any errors. Nor do I receive errors in my log that I am creating with the script. It just keeps telling me there is an illegal statement. I for the life can't figure out what that illegal statement is. I have attached a screen shot of the error and posted me code. Can anyone help me with this please? expandcollapse popup#include <FileConstants.au3> #NoTrayIcon #RequireAdmin $SilentInstall = False $installDir = "C:\Admin\AppUpd\Browsers\Firefox" $logFile = $installDir & "\" & @ScriptName & ".log" $logFileSubApp = $installDir & "\" & @ScriptName & "_bundled_app.log" $logEntries = 0 $appTitle = "Mozilla Firefox 25 Install Launcher" $ret1 = 0 $fileName = "Firefox Setup.exe" $versionCheck = "25.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 & ", OS Architecture = " & @OSArch) ;_CheckIfAdmin() ;not needed on most installs since the #requireadmin immediately prompts to run as admin if not $SilentInstall then ProgressOn($appTitle,"Staging Files","Please Wait...",-1,-1,16) _Log("Staging files") FileInstall("install_flash_player_12_plugin.msi",$installDir & "\install_flash_player_12_plugin.msi",1) FileInstall("Firefox Setup25.exe",$installDir & "\Firefox Setup25.exe",1) ;firefox must be closed if we are going to update it and install flash player ;_Log("Closing firefox") ;ProgressSet(50) ;ProcessClose("firefox.exe") ProgressSet(100,"Installing Firefox 25") RunWait('"' & $installDir & '\FirefoxSetup25.exe -ms"') _Log("Install returned " & $ret1 & ", @err=" & @error & ", @ext=" & @extended) ;remove the original settings Log("Deleting default settings") FileDelete(@ProgramFilesDir & "\Mozilla Firefox\override.ini") FileDelete(@ProgramFilesDir & "\Mozilla Firefox\mozilla.cfg") FileDelete(@ProgramFilesDir & "\Mozilla Firefox\defaults\pref\local-settings.js") DirRemove("C:\Program Files\Mozilla Firefox") OR DirRemove("C:\Program Files(x86)\Mozilla Firefox") _Log("File delete returned " & $ret1 & ", @err=" & @error & ", @ext=" & @extended) ;import the default settings _Log("Importing default settings") FileInstall("override.ini",@ProgramFilesDir & "\Mozilla Firefox\override.ini",1) FileInstall("mozilla.cfg",@ProgramFilesDir & "\Mozilla Firefox\mozilla.cfg",1) FileInstall("local-settings.js",@ProgramFilesDir & "\Mozilla Firefox\defaults\pref\local-settings.js",1) _Log("File install returned " & $ret1 & ", @err=" & @error & ", @ext=" & @extended) $source = "\Mozilla Firefox Version 25" ;$destination = @UserProfileDir & "\AppData\Roaming" ;customize firefox profile settings ProgressSet(100,"deleting the old directory") DirRemove(@UserProfileDir & "\AppData\Roaming\Mozilla", 1) _Log("Directory remove returned " & $ret1 & ", @err=" & @error & ", @ext=" & @extended) ;customize firefox profile settings ProgressSet(100,"Copying the appropriate files to directory") DirCopy($source & "\Mozilla", @UserProfileDir & "\AppData\Roaming", $FC_OVERWRITE) _Log("Directory copy returned " & $ret1 & ", @err=" & @error & ", @ext=" & @extended) FileDelete(@DesktopCommonDir & "\Mozilla Firefox.lnk") _Log("file delete returned" & $ret1 & ", @err=" & @error & ", @ext=" & @extended) ;now install flash player (firefox must be closed for this to work) ProgressSet(100,"Checking and installing the Flash Player 12 Plugin") ;$flashVer = RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player Plugin","DisplayVersion") _Log("Installing flash player plugin") RunWait('msiexec /qn /i"' & $installDir & '\install_flash_player_12_plugin.msi"',$installDir) _Log("Install returned " & $ret1 & ", @err=" & @error & ", @ext=" & @extended) ProgressOff() exit if not $SilentInstall Then MsgBox(64,$appTitle,"Install completed with return code " & $ret1,300) EndIf exit $ret1 Link to comment Share on other sites More sharing options...
BrewManNH Posted January 29, 2014 Share Posted January 29, 2014 What do you get when you run the script uncompiled? And what's on line 94? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
rbenner1184 Posted January 29, 2014 Author Share Posted January 29, 2014 (edited) 94 is a comment thats whats crazy..lol. When I run it uncompiled it doesn't return any errors I can see. >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "Y:\Ryan\Mozilla Firefox Version 25.0\Firefox Version 25.0 Install2.au3" /UserParams +>14:50:46 Starting AutoIt3Wrapper v.2.1.4.0 SciTE v.3.3.7.0 ; Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X86 Environment(Language:0409 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X86) >Running AU3Check (3.3.10.2) from:C:\Program Files\AutoIt3 +>14:50:46 AU3Check ended.rc:0 >Running:(3.3.10.2):C:\Program Files\AutoIt3\autoit3.exe "Y:\Ryan\Mozilla Firefox Version 25.0\Firefox Version 25.0 Install2.au3" --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop +>14:50:49 AutoIt3.exe ended.rc:0 >Exit code: 0 Time: 2.855 Edited January 29, 2014 by rbenner1184 Link to comment Share on other sites More sharing options...
Neutro Posted January 29, 2014 Share Posted January 29, 2014 Hey rbenner. Do you have this error as soon as you run the script or the first commands are executed? Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
rbenner1184 Posted January 29, 2014 Author Share Posted January 29, 2014 it seems like I have this error when the first commands are executed. Link to comment Share on other sites More sharing options...
rbenner1184 Posted January 29, 2014 Author Share Posted January 29, 2014 ProgressSet(100,"Installing Firefox 25") RunWait('"' & $installDir & '\FirefoxSetup25.exe -ms"') _Log("Install returned " & $ret1 & ", @err=" & @error & ", @ext=" & @extended) It seems to be at this line, but i'm confused, because when i run this from the command line it works. Link to comment Share on other sites More sharing options...
rbenner1184 Posted January 29, 2014 Author Share Posted January 29, 2014 it seems though when i omit this i still get this error. I have ommited several lines and they all return an error on line 94, but 94 is a comment the compiler shouldn't even read that. Link to comment Share on other sites More sharing options...
Neutro Posted January 29, 2014 Share Posted January 29, 2014 (edited) This line is incorrect: DirRemove("C:\Program Files\Mozilla Firefox") OR DirRemove("C:\Program Files(x86)\Mozilla Firefox") It should be: if @OSArch == "X86" then DirRemove("C:\Program Files\Mozilla Firefox") if @OSArch == "X64" then DirRemove("C:\Program Files\(x86)\Mozilla Firefox") Make this change in your script, recompile it and tell me how it goes Edited January 29, 2014 by Neutro Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
rbenner1184 Posted January 29, 2014 Author Share Posted January 29, 2014 This line is incorrect: DirRemove("C:\Program Files\Mozilla Firefox") OR DirRemove("C:\Program Files(x86)\Mozilla Firefox") It should be: if @OSArch == "X86" then DirRemove("C:\Program Files\Mozilla Firefox") if @OSArch == "X64" then DirRemove("C:\Program Files\(x86)\Mozilla Firefox") Make this change in your script, recompile it and tell me how it goes Good eye. Thanks that worked. Your a life saver!! Link to comment Share on other sites More sharing options...
Neutro Posted January 29, 2014 Share Posted January 29, 2014 (edited) Thanks Actually i just ran your script and get this error: So you might want to reinstall autoit! Edited January 29, 2014 by Neutro Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
rbenner1184 Posted January 29, 2014 Author Share Posted January 29, 2014 Thanks Actually i just ran your script and get this error: Clipboard02.jpg So you might want to reinstall autoit! Its odd, because i did yesterday i'm going to need to run a filecleanup on my machine maybe. i do alot of testing on it. Link to comment Share on other sites More sharing options...
Neutro Posted January 29, 2014 Share Posted January 29, 2014 Using a virtual machine and snapshot stystem is a good way to always have a clean testing setup. You should try it Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
rbenner1184 Posted January 29, 2014 Author Share Posted January 29, 2014 Using a virtual machine and snapshot stystem is a good way to always have a clean testing setup. You should try it I'm using that now mostly, but before I was not. Your right it does work better thats for sure. its much cleaner. Thanks again! Link to comment Share on other sites More sharing options...
pranaynanda Posted March 30, 2016 Share Posted March 30, 2016 Switches don't work for me? Is there something specific that needs to be done? I've tried them all. Even in command prompt. A GUI still pops up. Link to comment Share on other sites More sharing options...
water Posted March 30, 2016 Share Posted March 30, 2016 You need to be more specific. Which switches do you talk about? Which version of FireFox (I hope you do not talk about FF 25)? Can you post your script? 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