How to download Internet Explorer 8 for Windows 7 E without any Web browser?

Posted by: Ajax.NET Professional, on 15 Jul 2009 | View original | Bookmarked: 0 time(s)

Windows 7 RTM will be available in the next days and for all European users there will be no Internet Explorer 8. Im not sure if there will be an option to install Internet Explorer from the setup DVD or if we can simple add this as a Windows feature in control panel.

Following command line batch file will download Internet Explorer 8 setup:

@echo off

if exist download-IE8.cs del download-IE8.cs

echo using System; > download-IE8.cs
echo using System.Net; >> download-IE8.cs
echo using System.IO; >> download-IE8.cs
echo. >> download-IE8.cs
echo namespace Download_IE8 >> download-IE8.cs
echo { >> download-IE8.cs
echo     class Program >> download-IE8.cs
echo     { >> download-IE8.cs
echo         static void Main(string[] args) >> download-IE8.cs
echo         { >> download-IE8.cs
echo             if (File.Exists("IE8-WindowsVista-x86-DEU.exe")) >> download-IE8.cs
echo                 File.Delete("IE8-WindowsVista-x86-DEU.exe"); >> download-IE8.cs
echo. >> download-IE8.cs
echo             try >> download-IE8.cs
echo             { >> download-IE8.cs
echo                 HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://download.microsoft.com/download/3/D/C/3DC5DC1B-2B60-487A-BAE2-732662BC0886/IE8-WindowsVista-x86-DEU.exe"); >> download-IE8.cs
echo                 request.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1;)"; >> download-IE8.cs
echo                 request.AllowWriteStreamBuffering = false; >> download-IE8.cs
echo                 request.Timeout = 10000; >> download-IE8.cs
echo. >> download-IE8.cs
echo                 using (Stream s = request.GetResponse().GetResponseStream()) >> download-IE8.cs
echo                 { >> download-IE8.cs
echo                     FileStream fs = new FileStream("IE8-WindowsVista-x86-DEU.exe", FileMode.Create); >> download-IE8.cs
echo. >> download-IE8.cs
echo                     byte[] read = new byte[1024]; >> download-IE8.cs
echo                     int count = s.Read(read, 0, read.Length); >> download-IE8.cs
echo. >> download-IE8.cs
echo                     while (count != 0) >> download-IE8.cs
echo                     { >> download-IE8.cs
echo                         fs.Write(read, 0, count); >> download-IE8.cs
echo                         count = s.Read(read, 0, read.Length); >> download-IE8.cs
echo. >> download-IE8.cs
echo                         Console.Write("."); >> download-IE8.cs
echo                     } >> download-IE8.cs
echo                 } >> download-IE8.cs
echo. >> download-IE8.cs
echo                 Console.WriteLine(); >> download-IE8.cs
echo                 Console.WriteLine("Done."); >> download-IE8.cs
echo. >> download-IE8.cs
echo                 System.Threading.Thread.Sleep(5000); >> download-IE8.cs
echo                 System.Diagnostics.Process.Start("IE8-WindowsVista-x86-DEU.exe"); >> download-IE8.cs
echo             } >> download-IE8.cs
echo             catch (Exception ex) >> download-IE8.cs
echo             { >> download-IE8.cs
echo                 Console.WriteLine("Error: " + ex.Message); >> download-IE8.cs
echo             } >> download-IE8.cs
echo         } >> download-IE8.cs
echo     } >> download-IE8.cs
echo } >> download-IE8.cs
echo. >> download-IE8.cs

if not exist download-IE8.cs goto ERROR1

"%WINDIR%\Microsoft.NET\Framework\v3.5\csc.exe" download-IE8.cs

download-IE8.exe

if not exists download-IE8.exe goto ERROR2

:ERROR1

echo Could not create C# source file.

goto END

:ERROR2

echo Could not create executable to download IE8.

goto END

:END

Note: this is a first version of my script that will download Internet Explorer 8 German for Windows Vista (x86) only. If it is working I will modify it to have an option to choose the correct version you need. Well, if Microsoft is adding a checkbox to the Windows features in control panel we dont need it.


Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: C# | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 8072 | Hits: 33

Similar Posts

  • Upgrade Wizard: auto-upgrades and more more
  • Announcing the WebsiteSpark Program more
  • Announcing the Microsoft AJAX CDN more
  • Intersoft Solutions Announces WebUI Studio 2009 Service Pack 1 more
  • SimplePatch My Patching Tool more
  • Free Open Source .NET Mobile API From Mobile Experts - 51degrees.mobi more
  • How to check your network connection state more
  • Using SSL in your application more
  • Rounded Corner Rendering in newer Browsers more
  • Telerik Introduces Free Web Testing Framework for ASP.NET AJAX and Silverlight more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD