jcolma Posted July 28, 2011 Share Posted July 28, 2011 Hey All, I was asked by my company to write a script using autoit that installs IE8 onto user's machines via the command line upon logging onto the domain. Problem is, I have never written script in autoit, or any other program before! I do have some vague knowledge of the scritping language, I merely can understand the concepts. I have already done the easiest part and saved the IE8.exe onto a location on our server. Our company is running Windows XP workstations. Windows 2003 servers. I know you need more information than that, so please let me know what you need from me. I am obviously not asking for the whole script, just help! I appreciate this so so much and have great respect for all of you. Thanks! I look forward to hearing back from you all. Link to comment Share on other sites More sharing options...
MrMitchell Posted July 28, 2011 Share Posted July 28, 2011 (edited) Does it not have a silent install switch? Example something like this: IE8-WindowsXP-x86-ENU.exe /quiet /update-no /log:C:\temp\IEinstall.log Edited July 28, 2011 by MrMitchell Link to comment Share on other sites More sharing options...
BrewManNH Posted July 28, 2011 Share Posted July 28, 2011 You could create a script that is executed when the user logs on using Group Policy, and just have that script run the executable. If your users have the credentials to install software you could just use the Run() command, if they don't you'd need to use the RunAs() command to run the program from the server. 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...
sleepydvdr Posted July 28, 2011 Share Posted July 28, 2011 If you use a logon script (for assigning shares or installing printers), you can just add a line to it to install IE8. start \\servername\share\IE8.exe /qn If you don't use a logon script, you can create one and assign it to all users. It should be located: %SystemRoot%\sysvol\sysvol\<domain DNS name>\scripts You can make an self-installer like this: $version = FileGetVersion(@ProgramFilesDir & "\Internet Explorer\iexplore.exe") If $version < 8 Then FileInstall("ie8_installer.exe", @TempDir & "\ie8_installer.exe") RunAsWait("administrator", "yourdomain", "password", 1, @TempDir & "\ie8_installer.exe /qn") FileDelete(@TempDir & "\ie8_installer.exe") EndIf Otherwise, then you will need to publish it in Group Policy (which can be a bitch): http://support.microsoft.com/kb/816102 #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
jcolma Posted July 28, 2011 Author Share Posted July 28, 2011 (edited) Wow - Thanks for the fast responses. Let me make some things clear. This is going to be pushed out to users via the everdream client. It needs to run via the cmd line. It should recognize if any IE windows are opened and close them automatically, then start the install. Anything I can answer for you guys? One more edit: if someone wants to write this script for me and has a paypal account I will award you!!! LOL --- just a thought. Edited July 28, 2011 by jcolma Link to comment Share on other sites More sharing options...
sleepydvdr Posted July 28, 2011 Share Posted July 28, 2011 Wow - Thanks for the fast responses.Let me make some things clear.This is going to be pushed out to users via the everdream client. It needs to run via the cmd line. It should recognize if any IE windows are opened and close them automatically, then start the install. Anything I can answer for you guys?From what you just told us, you could do it either way (logon script or Group Policy). Whichever is easiest for you. #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
jcolma Posted July 28, 2011 Author Share Posted July 28, 2011 From what you just told us, you could do it either way (logon script or Group Policy). Whichever is easiest for you.Thanks, thanks -If I wanted to just make a script that when you execute it, automatically, silently installs IE8 and closes any IE windows opened - how would I go about that? Link to comment Share on other sites More sharing options...
sleepydvdr Posted July 28, 2011 Share Posted July 28, 2011 Thanks, thanks - If I wanted to just make a script that when you execute it, automatically, silently installs IE8 and closes any IE windows opened - how would I go about that? Go back to my post where I gave you the script to silently install and add in this bit of code: Do If ProcessExists("iexplore.exe") Then ProcessClose("iexplore.exe") Else ExitLoop EndIf Until Not ProcessExists("iexplore.exe") #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
jcolma Posted July 29, 2011 Author Share Posted July 29, 2011 Go back to my post where I gave you the script to silently install and add in this bit of code: Do If ProcessExists("iexplore.exe") Then ProcessClose("iexplore.exe") Else ExitLoop EndIf Until Not ProcessExists("iexplore.exe") I apologize - I am more novice than I had originally expressed. Are you referring to this self installer? And in the top line below, do I just swap out "(@ProgramFilesDir & "\Internet Explorer\iexplore.exe")" with where the location of the .exe is on the server? I really appreciate the help. You guys are life savers. $version = FileGetVersion(@ProgramFilesDir & "\Internet Explorer\iexplore.exe") If $version < 8 Then FileInstall("ie8_installer.exe", @TempDir & "\ie8_installer.exe") RunAsWait("administrator", "yourdomain", "password", 1, @TempDir & "\ie8_installer.exe /qn") FileDelete(@TempDir & "\ie8_installer.exe") EndIf Link to comment Share on other sites More sharing options...
sleepydvdr Posted July 29, 2011 Share Posted July 29, 2011 I apologize - I am more novice than I had originally expressed. Are you referring to this self installer? And in the top line below, do I just swap out "(@ProgramFilesDir & "\Internet Explorer\iexplore.exe")" with where the location of the .exe is on the server? I really appreciate the help. You guys are life savers. $version = FileGetVersion(@ProgramFilesDir & "\Internet Explorer\iexplore.exe") If $version < 8 Then FileInstall("ie8_installer.exe", @TempDir & "\ie8_installer.exe") RunAsWait("administrator", "yourdomain", "password", 1, @TempDir & "\ie8_installer.exe /qn") FileDelete(@TempDir & "\ie8_installer.exe") EndIf Download the IE8 executable installer (not the .msi because the .msi includes some junkware). Name it ie8_installer.exe and put it in the same directory as your script. When you compile the script, it will pack the installer into your compiled executable. When you run it, it will extract the IE installer to a temp directory and install it silently and delete it when finished. Below is the combined code to create an unattended installer. Since you say the users are allowed to install software, I changed RunAsWait to RunWait and deleted the credential information. $version = FileGetVersion(@ProgramFilesDir & "\Internet Explorer\iexplore.exe") If $version < 8 Then Do If ProcessExists("iexplore.exe") Then ProcessClose("iexplore.exe") Else ExitLoop EndIf Until Not ProcessExists("iexplore.exe") FileInstall("ie8_installer.exe", @TempDir & "\ie8_installer.exe") RunWait(@TempDir & "\ie8_installer.exe /qn") FileDelete(@TempDir & "\ie8_installer.exe") EndIf #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
jcolma Posted August 1, 2011 Author Share Posted August 1, 2011 (edited) Download the IE8 executable installer (not the .msi because the .msi includes some junkware). Name it ie8_installer.exe and put it in the same directory as your script. When you compile the script, it will pack the installer into your compiled executable. When you run it, it will extract the IE installer to a temp directory and install it silently and delete it when finished. Below is the combined code to create an unattended installer. Since you say the users are allowed to install software, I changed RunAsWait to RunWait and deleted the credential information. $version = FileGetVersion(@ProgramFilesDir & "\Internet Explorer\iexplore.exe") If $version < 8 Then Do If ProcessExists("iexplore.exe") Then ProcessClose("iexplore.exe") Else ExitLoop EndIf Until Not ProcessExists("iexplore.exe") FileInstall("ie8_installer.exe", @TempDir & "\ie8_installer.exe") RunWait(@TempDir & "\ie8_installer.exe /qn") FileDelete(@TempDir & "\ie8_installer.exe") EndIf That looks great. Thank you. Now what if I did not want to so it via the command line? What if I just wanted to make a .au3 and when the user clicks on it, it installs IE8, closes windows, etc... by the way, the location where the .exe is, is, \\"servername"\xp software\ie8_installer.exe (that should help you when writing the script) If you can, just make it known where I need to do some replacing. Pretty much what I am asking is, when I c/p'ed the above script into AutoIt and then saved and ran it-- it closed my IE windows, but it didn't run the .exe -- where do I need to put the file location of the .exe in the above script for it to work when I click on it? Thanks so much for the help. Edited August 1, 2011 by jcolma Link to comment Share on other sites More sharing options...
sleepydvdr Posted August 1, 2011 Share Posted August 1, 2011 That looks great. Thank you. Now what if I did not want to so it via the command line? What if I just wanted to make a .au3 and when the user clicks on it, it installs IE8, closes windows, etc... by the way, the location where the .exe is, is, \\"servername"\xp software\ie8_installer.exe (that should help you when writing the script) If you can, just make it known where I need to do some replacing. Pretty much what I am asking is, when I c/p'ed the above script into AutoIt and then saved and ran it-- it closed my IE windows, but it didn't run the .exe -- where do I need to put the file location of the .exe in the above script for it to work when I click on it?Thanks so much for the help.The Internet Explorer installer needs to be in the same directory as the script (and it has to be named as it is in the script). Now compile it - don't try to run the .au3 script remotely. Then you can run your compiled script.Also to note, you may want to change the /qn to /qb. /qn means 100% silent versus /qb shows a progressbar. This will let you know it's working. If the installer stops abruptly, then you are probably missing a hotfix that is necessary to upgrade to IE8. I ran in to that problem myself.Then run your compiled script like so:\\"servername"\xp software\IE8_Unattended.exe <-- this is your compiled script, not the original ie8_installer.exe!!! #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
jcolma Posted August 2, 2011 Author Share Posted August 2, 2011 (edited) Your going to kill me... LMAO... I tried compiling this script: $version = FileGetVersion(@ProgramFilesDir & "\Internet Explorer\iexplore.exe") If $version < 8 Then Do If ProcessExists("iexplore.exe") Then ProcessClose("iexplore.exe") Else ExitLoop EndIf Until Not ProcessExists("iexplore.exe") FileInstall("ie8_installer.exe", @TempDir & "\ie8_installer.exe") RunWait(@TempDir & "\\brsrv1\xp software\ie8_installer.exe /qb") FileDelete(@TempDir & "\\brsrv1\xp software\ie8_installer.exe") EndIf Whoever, I get an error when compiling saying that, error adding file ie8_installer.exe I just want to be able to compile the script, then click on it, and have it close my IE windows, then run the .exe located at \\"servername"\xp software\... I probably did something wrong. Thanks for helping this novice!! Edited August 2, 2011 by jcolma Link to comment Share on other sites More sharing options...
sleepydvdr Posted August 2, 2011 Share Posted August 2, 2011 Your going to kill me... LMAO... Whoever, I get an error when compiling saying that, error adding file ie8_installer.exe I just want to be able to compile the script, then click on it, and have it close my IE windows, then run the .exe located at \\"servername"\xp software\... I probably did something wrong. Thanks for helping this novice!! If you don't want to pack the installer in your script, then you should remove fileinstall. The script should be this: $version = FileGetVersion(@ProgramFilesDir & "\Internet Explorer\iexplore.exe") If $version < 8 Then Do If ProcessExists("iexplore.exe") Then ProcessClose("iexplore.exe") Else ExitLoop EndIf Until Not ProcessExists("iexplore.exe") RunWait("\\brsrv1\xp software\ie8_installer.exe /qb") EndIf #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
jcolma Posted August 2, 2011 Author Share Posted August 2, 2011 If you don't want to pack the installer in your script, then you should remove fileinstall. The script should be this: $version = FileGetVersion(@ProgramFilesDir & "\Internet Explorer\iexplore.exe") If $version < 8 Then Do If ProcessExists("iexplore.exe") Then ProcessClose("iexplore.exe") Else ExitLoop EndIf Until Not ProcessExists("iexplore.exe") RunWait("\\brsrv1\xp software\ie8_installer.exe /qb") EndIf Ok. I tested this out, it closed out of any IE windows opened and started the installer - it appears as if it finished the installer, but when it finishesm this screen appears...see attachment -- "Installl Windows Internet Explorer 8" Availables Switches... Link to comment Share on other sites More sharing options...
sleepydvdr Posted August 3, 2011 Share Posted August 3, 2011 Ok. I tested this out, it closed out of any IE windows opened and started the installer - it appears as if it finished the installer, but when it finishesm this screen appears...see attachment -- "Installl Windows Internet Explorer 8" Availables Switches... I forgot that the switches for the executable installer are different from the .msi installer. Sorry about that. You should use this instead: RunWait("\\brsrv1\xp software\ie8_installer.exe /passive /norestart") Use /norestart to prevent it from automatically restarting the computer. #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
jcolma Posted August 3, 2011 Author Share Posted August 3, 2011 I forgot that the switches for the executable installer are different from the .msi installer. Sorry about that. You should use this instead:RunWait("\\brsrv1\xp software\ie8_installer.exe /passive /norestart")Use /norestart to prevent it from automatically restarting the computer.Thanks! No need to be sorry! I am running the script now - How will I know when it is completed? Will the computer ask me to restart? Thanks Thanks!I know this will be a bear, if you'd like to tackle it... now, how would I get this to e-mail me the results? Success or not successful?LOL, if you don't have time to explain this to me, then don't worry about it. You have done a lot and it's much appreciated. 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