pjw73nh Posted May 14, 2007 Posted May 14, 2007 Greetings, See my code below. When I run this on a machine that has IE 6 SP2, it works fine. The dialog box returned with SP2 is the ""Internet Explorer - Security Warning" box, that wants an alt "I" sent to it to install. If the user has IE6 SP1, The dialog box returned with SP1 is the "Security Warning" dialog box, and wants an alt "A" for always trust, and an alt "Y" for yes to continue with the install, and I would like it to run the rem-ed out branch. ; Sub-routine to run the install. MsgBox(64, "Install Java 1.5.0 U6 for Kronos", "Click OK to install JRE 1.5.0 update 6 for Kronos") Run("C:\Program Files\Internet Explorer\iexplore.exe http:\\ehkronosapp\wfc\logon") BlockInput(1) ;*********** this is the code that should be used if the user has IE SP1 ****************** ;WinWaitActive("Security Warning") ;Send("!a") ;Send("!y) ;*********** this is the code that should be used if the user has IE SP2 ****************** WinWaitActive("Internet Explorer - Security Warning") Send("!i") ;**************** End of differing code *********************** WinWaitActive("J2SE Runtime Environment 5.0 Update 6 - License") Send("!a") WinWaitActive("J2SE Runtime Environment 5.0 Update 6 - Complete") BlockInput(0) MsgBox(0, "Java install Success", " You have successfully installed Java 2 SE Runtime Environment 5.0 Update 6 ",10) Exit I was hoping to use something similar to the @OSServicePack statement, but with IE version. I am having difficulty figuring out how to do it. Any thoughts or suggections would be appreciated. Thanks.. P.
DaleHohm Posted May 14, 2007 Posted May 14, 2007 There would be other ways, but since you are already starting IE in this process, coverting to IE.au3 you can use this: #include <IE.au3> $oIE = _IECreate () $sAppVersion = _IEPropertyGet($oIE, "appversion") In my system with IE7 I get: 4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; Tablet PC 1.7; .NET CLR 3.0.04506.30) Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble
pjw73nh Posted May 15, 2007 Author Posted May 15, 2007 There would be other ways, but since you are already starting IE in this process, coverting to IE.au3 you can use this:#include <IE.au3>$oIE = _IECreate ()$sAppVersion = _IEPropertyGet($oIE, "appversion")In my system with IE7 I get:4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; Tablet PC 1.7; .NET CLR 3.0.04506.30)DaleHi Dale,Thanks for the quick reply. I upgraded to the latest AutoIt, I tried your script (above) and I got a ton of errors. When I say I "tried" your script, it was just that. I cut and pasted it and ran it just as it looks above. As I'm sure you can tell from my original script, I am a very green script writer, so I'm sure there are pieces I am missing. Anything you can fill me in on would be appreciated. Thanks. Oh, is there a way to conditionally branch based on which active window appears? That way, I could tell the script that if the "Security Warning" window appears (do this), and if the "Internet Explorer - Security Warning" window appears (do that). Now that I look at this some more, could I use the WinActive cammand for this? Thanks for any help you can provide. Paul...
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