Skip to content
Browse files

Cleaned up issues from merge

  • Loading branch information...
1 parent dfc168a commit fcdc213802fd6d56cd8d31ceeca8bf9cb1f1eba2 @msarchet msarchet committed Oct 30, 2012
View
149 SmallestDotNet/Default.aspx
@@ -2,52 +2,25 @@
<!DOCTYPE html>
<html>
<head>
- <title>Get the .NET Framework Fast - Download the smallest .NET Framework Distribution possible</title>
<meta name="Description" content="Get the right .NET Framework download for you, as fast as possible by downloading as little as possible." />
<meta name="Keywords" content=".NET Framework Gast" />
<meta charset="utf-8" />
<meta name="Distribution" content="Global" />
<meta name="t_omni_extblogid" content="msstoextblogs1" />
<meta name="t_omni_blogname" content="Scott Hanselman" />
- <meta name="viewport" content="width=device-width" />
+ <meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="css/bootstrap-responsive.min.css" type="text/css" />
<link href="css/font-awesome.css" rel="stylesheet" type="text/css" />
+ <!--[if IE 7]><link rel="stylesheet" href="/css/font-awesome-ie7.css"><![endif]-->
<link href="css/m-buttons.min.css" rel="stylesheet" media="screen" />
<link rel="Stylesheet" href="css/main.css" type="text/css" />
- <!--[if IE 7]><link rel="stylesheet" href="/css/font-awesome-ie7.css"><![endif]-->
+ <title>Get the .NET Framework Fast - Download the smallest .NET Framework Distribution possible</title>
- <style type="text/css">
- body
- {
- font-family: 'Droid Sans', sans-serif;
- }
-
-
- .header
- {
- padding-bottom: 10%;
- }
- .bottom-container
- {
- color: #eee;
- background: #aaa;
- }
-
- pre
- {
- background: #aaa;
- color: #000;
- }
- i
- {
- padding-right: 5px;
- }
- </style>
</head>
<body>
- <div class="navbar">
+ <div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
@@ -57,11 +30,10 @@
</a>
<a class="brand" href="#">SmallestDotNET</a>
<div class="nav-collapse pull-right">
- <ul class="nav pull-right">
- <li><a href="<%= Constants.Version45URL %>"><i class="icon-download-alt"></i>Get .NET</a></li>
- <li><a href="http://www.hanselman.com"><i class="icon-sign-blank"></i>Scott's Blog</a></li>
- <li><a href="https://github.com/shanselman/SmallestDotNet/"><i class="icon-github-sign"></i>This site on GitHub</a></li>
- <li><a href="https://github.com/shanselman/SmallestDotNet/issues"><i class="icon-heart"></i>Report a Bug</a></li>
+ <ul class="nav">
+ <li><a href="http://www.hanselman.com"><i class="icon-sign-blank"></i> Scott's Blog</a></li>
+ <li><a href="https://github.com/shanselman/SmallestDotNet/"><i class="icon-github-sign"></i> This site on GitHub</a></li>
+ <li><a href="https://github.com/shanselman/SmallestDotNet/issues"><i class="icon-heart"></i> Report a Bug</a></li>
</ul>
</div>
<!--/.nav-collapse -->
@@ -70,6 +42,7 @@
</div>
<div class="container">
+
<div class="row-fluid">
<div class="span12">
<div class="result-header">
@@ -84,8 +57,8 @@
</div>
</div>
- </div>
- </div>
+ </div>
+
<div class="row-fluid">
<div class="span12">
<h2>What about .NET 4.5?</h2>
@@ -94,77 +67,74 @@
This harmless code signed application will tell us if you have .NET 4.5. Don't trust us? Here's <a href="https://github.com/shanselman/SmallestDotNet/blob/master/CheckForDotNet45/Program.cs">the code</a>.
</div>
</div>
- <!-- Example row of columns -->
- <div class="row-fluid">
- <div class="span4">
- <h2><i class="icon-question-sign"></i>What happened</h2>
- This site looked at your browser's "UserAgent" and figured out what version (if any) of the .NET Framework you have (or don't have) installed, then calculated the total size if you chose to download the .NET Framework.
+ <!-- Example row of columns -->
+ <div class="row-fluid">
+ <div class="span4">
+ <h2><i class="icon-question-sign"></i> What happened</h2>
+ This site looked at your browser's "UserAgent" and figured out what version (if any) of the .NET Framework you have (or don't have) installed, then calculated the total size if you chose to download the .NET Framework.
+ <br />
<br />
- <br />
- There's no database, no cookies, and nothing about your computer has been stored or kept. We just look at the information your browser already reports about your computer and make a suggestion as to the best .NET Framework download for you.
+ There's no database, no cookies, and nothing about your computer has been stored or kept. We just look at the information your browser already reports about your computer and make a suggestion as to the best .NET Framework download for you.
<br />
- <br />
- </div>
+ <br />
+ </div>
<div class="span8">
- <h2><i class="icon-download-alt"></i>Downloads</h2>
- <ul class="unstyled">
+ <h2><i class="icon-download-alt"></i> Offline Download</h2>
+ <asp:Literal runat="server" ID="developerOfflineResult" />
+ <h2><i class="icon-download-alt"></i> Online Download</h2>
<asp:Literal runat="server" ID="developerOnline" />
- </li>
- <li>
- <asp:Literal runat="server" ID="developerOfflineResult" />
- </li>
- </ul>
- </div>
</div>
- <div class="row-fluid">
- <div class="span8">
- <h3>Are you a .NET Programmer?</h3>
- If you're a programmer/developer, you might be trying to figure out which .NET Framework for your users to use.
- <br />
- <br />
- Sometimes finding the right .NET Framework is confusing because different kinds of machines (x86, x64, ia64) that may or may not have different versions of .NET already on them.
- <br />
- <br />
- If you look for .NET Downloads on Microsoft's site, it might look like the .NET Framework is 200+ megs. It's not. Those big downloads are the Complete Offline Versions of every version of the .NET Framework for every kind of machine possible. The big .NET download includes x86, x64, and ia64. It includes .NET 2.0, 3.0, and 3.5 code for all systems all in one super-archive. The download for .NET 4.5 is even smaller.
- <br />
- <br />
- Why would you EVER want to download the whole archive? Only if you're a developer and you want to distribute the .NET Framework the widest possible audience in a format like a CD or DVD.
- </div>
- <div class="span4">
- <h3>Your User Agent</h3>
- For technical or debugging purposes, this is exactly what your browser said about itself:
+ </div>
+ <div class="row-fluid">
+ <div class="span8">
+ <h3>Are you a .NET Programmer?</h3>
+ If you're a programmer/developer, you might be trying to figure out which .NET Framework for your users to use.
+ <br />
+ <br />
+ Sometimes finding the right .NET Framework is confusing because different kinds of machines (x86, x64, ia64) that may or may not have different versions of .NET already on them.
+ <br />
+ <br />
+ If you look for .NET Downloads on Microsoft's site, it might look like the .NET Framework is 200+ megs. It's not. Those big downloads are the Complete Offline Versions of every version of the .NET Framework for every kind of machine possible. The big .NET download includes x86, x64, and ia64. It includes .NET 2.0, 3.0, and 3.5 code for all systems all in one super-archive. The download for .NET 4.5 is even smaller.
+ <br />
+ <br />
+ Why would you EVER want to download the whole archive? Only if you're a developer and you want to distribute the .NET Framework the widest possible audience in a format like a CD or DVD.
+ </div>
+ <div class="span4">
+ <h3>Your User Agent</h3>
+ For technical or debugging purposes, this is exactly what your browser said about itself:
<br />
- <pre id="userAgentPre"><asp:Literal runat="server" ID="userAgent" /></pre>
- </div>
+ <pre><asp:Literal runat="server" ID="userAgent" /></pre>
</div>
+ </div>
- <div class="row-fluid">
- <div class="span12">
- <h3>Integration</h3>
- Want SmallestDotNet functionality for your own site? Add this chunk of JavaScript, it'll spit out HTML and you can style to taste.
+ <div class="row-fluid">
+ <div class="span12">
+ <h3>Integration</h3>
+ Want SmallestDotNet functionality for your own site? Add this chunk of JavaScript, it'll spit out HTML and you can style to taste.
<br />
- <pre>&LT;script type="text/javascript" src="http://www.smallestdotnet.com/javascript.ashx"&GT;&LT;/script&GT;</pre>
+ <pre>&LT;script type="text/javascript" src="http://www.smallestdotnet.com/javascript.ashx"&GT;&LT;/script&GT;</pre>
- </div>
</div>
- <div class="row-fluid">
- <div class="span12">
- Prefer a JavaScript Object (JSON) to detect .NET Framework installations? Try this instead:
+ </div>
+ <div class="row-fluid">
+ <div class="span12">
+ Prefer a JavaScript Object (JSON) to detect .NET Framework installations? Try this instead:
<br />
- <pre>&LT;script type="text/javascript" src="http://www.smallestdotnet.com/javascriptdom.ashx"&GT;&LT;/script&GT;</pre>
- Get examples on <a href="http://www.hanselman.com/blog/SmallestDotNetUpdateNowWithNet4SupportandanincludableJavascriptapi.aspx">how to use the JSON object on Scott's Blog.</a>
+ <pre>&LT;script type="text/javascript" src="http://www.smallestdotnet.com/javascriptdom.ashx"&GT;&LT;/script&GT;</pre>
+ Get examples on <a href="http://www.hanselman.com/blog/SmallestDotNetUpdateNowWithNet4SupportandanincludableJavascriptapi.aspx">how to use the JSON object on Scott's Blog.</a>
- </div>
</div>
+ </div>
- <div class="row-fluid">
+ <div class="row-fluid">
<div class="span12 ">
- <hr />
+ <footer>
<hr />
<p>&copy; <a href="http://www.hanselman.com">Scott Hanselman</a>, <a href="http://www.MichaelSarchet.com">Michael Sarchet</a> and Friends 2012. <a href="http://www.github.com/shanselman/smallestdotnet">See the Source and report issues</a>.
The lovely <a href="http://ace-subido.github.com/css3-microsoft-metro-buttons/index.html">CSS3 Microsoft-Modern Buttons</a> are by <a href="http://acesubido.com/">Ace Subido</a>.</p>
+ </footer>
</div>
</div>
</div>
@@ -189,7 +159,6 @@
$('#javascriptResult').html(data);
}
);
- $('#userAgentPre').text(userAgent);
}
})
</script>
@@ -201,4 +170,4 @@
pageTracker._trackPageview();
</script>
</body>
-</html>
+</html>
View
13 SmallestDotNet/Default.aspx.designer.cs
@@ -21,13 +21,13 @@ public partial class _Default {
protected global::System.Web.UI.WebControls.Literal userResult;
/// <summary>
- /// developerOnline control.
+ /// getdotnet control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
- protected global::System.Web.UI.WebControls.Literal developerOnline;
+ protected global::System.Web.UI.HtmlControls.HtmlAnchor getdotnet;
/// <summary>
/// checkdotnet control.
@@ -48,6 +48,15 @@ public partial class _Default {
protected global::System.Web.UI.WebControls.Literal developerOfflineResult;
/// <summary>
+ /// developerOnline control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.WebControls.Literal developerOnline;
+
+ /// <summary>
/// userAgent control.
/// </summary>
/// <remarks>
View
32 SmallestDotNetLib/BrowserSupport.cs
@@ -8,26 +8,26 @@ namespace SmallestDotNetLib
{
public class Browser
{
- public string BrowserString { get; set; }
- public string BrowserPretty { get; set; }
- public bool CanGetCLRVersion { get; set; }
+ public string BrowserString { get; set; }
+ public string BrowserPretty { get; set; }
+ public bool CanGetCLRVersion { get; set; }
}
public class BrowserSupport
{
- private static Browser Chrome = new Browser { BrowserPretty = "Google Chrome", BrowserString = "Chrome", CanGetCLRVersion = false };
- private static Browser Firefox = new Browser { BrowserPretty = "Mozilla Firefox", BrowserString = "Firefox", CanGetCLRVersion = false };
- private static Browser InternetExplorer = new Browser { BrowserPretty = "Internet Explorer", BrowserString = "Trident", CanGetCLRVersion = true };
- public static List<Browser> Browsers = new List<Browser>
- {
- Chrome,
- Firefox,
- InternetExplorer
- };
+ private static Browser Chrome = new Browser { BrowserPretty = "Google Chrome", BrowserString = "Chrome", CanGetCLRVersion = false };
+ private static Browser Firefox = new Browser { BrowserPretty = "Mozilla Firefox", BrowserString = "Firefox", CanGetCLRVersion = false };
+ private static Browser InternetExplorer = new Browser { BrowserPretty = "Internet Explorer", BrowserString = "Trident", CanGetCLRVersion = true };
+ public static List<Browser> Browsers = new List<Browser>
+ {
+ Chrome,
+ Firefox,
+ InternetExplorer
+ };
- public static Browser GetBrowser(string UserAgent)
- {
- return Browsers.FirstOrDefault(b => UserAgent.Contains(b.BrowserString));
- }
+ public static Browser GetBrowser(string UserAgent)
+ {
+ return Browsers.FirstOrDefault(b => UserAgent.Contains(b.BrowserString));
+ }
}
}
View
43 SmallestDotNetLib/Helpers.cs
@@ -25,10 +25,10 @@ public static string GetUpdateInformation(string UserAgent, Version version)
if (UserAgent.Contains("nix"))
{
netInfoString = "It looks like you're running a Unix machine. There's no .NET Framework download from Microsoft for Unix, but you might check out <a href=\"http://www.go-mono.com/mono-downloads/download.html\">Mono</a>, which is an Open Source platform that can run .NET code on Unix.";
- return netInfoString;
+ return netInfoString;
}
-
-
+
+
net4 = (GetWindows8Message(UserAgent, ref netInfoString) || Get40Message(UserAgent, ref netInfoString));
if (Helpers.Has35(UserAgent) || Helpers.Has35SP1C(UserAgent) || Helpers.Has35SP1E(UserAgent))
{
@@ -42,11 +42,11 @@ public static string GetUpdateInformation(string UserAgent, Version version)
{
netInfoString += DotNet2Message(net4);
}
- else if ( Helpers.Has11(UserAgent) || Helpers.Has10(UserAgent))
+ else if (Helpers.Has11(UserAgent) || Helpers.Has10(UserAgent))
{
netInfoString += DotNet1Message(net4);
}
- else if(!net4)
+ else if (!net4)
{
if (UserAgent.Contains("fox"))
{
@@ -56,7 +56,7 @@ public static string GetUpdateInformation(string UserAgent, Version version)
{
netInfoString += MessageForBrowser("Chrome");
}
- else if(UserAgent.Contains("Safari")) // Chrome also uses safari in the user agent so this check must come after
+ else if (UserAgent.Contains("Safari")) // Chrome also uses safari in the user agent so this check must come after
{
netInfoString += MessageForBrowser("Safari");
}
@@ -71,7 +71,7 @@ public static string GetUpdateInformation(string UserAgent, Version version)
{
netInfoString += CheckDotNet3_5UnSupportedOs(UserAgent, windowsVersion.Key, windowsVersion.Value);
}
-
+
return netInfoString;
}
@@ -104,7 +104,7 @@ private static bool Get40Message(string UserAgent, ref string userMessage)
if (ret)
{
- userMessage += String.Format(@"You have {0}, this is a recent version of .NET. Download an installer for the newest version <strong>{1}</strong>.", whichVersion ,Constants.DotNetOnline);
+ userMessage += String.Format(@"You have {0}, this is a recent version of .NET. Download an installer for the newest version <strong>{1}</strong>.", whichVersion, Constants.DotNetOnline);
}
return ret;
@@ -148,7 +148,7 @@ private static string DotNet3_5Message(bool hasSp1, bool hasDotNet4)
if (!hasDotNet4)
{
- return String.Format(@"You have .NET 3.5{0}, this is a recent version of .NET. Download an installer for the newest version <strong>{1}</strong>.", hasSp1 ? " Service Pack 1" : "" ,Constants.DotNetOnline);
+ return String.Format(@"You have .NET 3.5{0}, this is a recent version of .NET. Download an installer for the newest version <strong>{1}</strong>.", hasSp1 ? " Service Pack 1" : "", Constants.DotNetOnline);
}
return "";
@@ -169,24 +169,25 @@ public static bool Has45(String UserAgent)
{
return UserAgent.StartsWith("4.5");
}
-
+
public static string GetJsonPayload(String UserAgent)
{
- var OperatingSystem = OperatingSystems.GetOperatingSystem(UserAgent);
- if (OperatingSystem.LatestCLRVersion != null)
- {
- var Browser = BrowserSupport.GetBrowser(UserAgent);
+ var OperatingSystem = OperatingSystems.GetOperatingSystem(UserAgent);
+ if (OperatingSystem.LatestCLRVersion != null)
+ {
+ var Browser = BrowserSupport.GetBrowser(UserAgent);
- if (Browser.CanGetCLRVersion)
- {
- var parsedVersions = new CLRVersions(UserAgent);
+ if (Browser.CanGetCLRVersion)
+ {
+ var parsedVersions = new CLRVersions(UserAgent);
- var LatestVersion = parsedVersions.GetLatestVersion();
+ var LatestVersion = parsedVersions.GetLatestVersion();
- var UpToDate = (LatestVersion == OperatingSystem.LatestCLRVersion);
- }
- }
+ var UpToDate = (LatestVersion == OperatingSystem.LatestCLRVersion);
+ }
+ }
+ return "Not Implemented";
}
/// <summary>
View
38 SmallestDotNetLib/OperatingSystemSupport.cs
@@ -6,26 +6,26 @@ namespace SmallestDotNetLib
{
public class OperatingSystem
{
- public string UserAgentVersion { get; set; }
- public string PrettyVersion { get; set; }
- public CLRVersion LatestCLRVersion { get; set; }
+ public string UserAgentVersion { get; set; }
+ public string PrettyVersion { get; set; }
+ public CLRVersion LatestCLRVersion { get; set; }
}
public class OperatingSystems
{
- private static OperatingSystem Windows8 = new OperatingSystem() { UserAgentVersion = "Windows NT 6.2", PrettyVersion = "Windows 8", LatestCLRVersion = CLRVersions.NET45Full };
- private static OperatingSystem Windows7 = new OperatingSystem() { UserAgentVersion = "Windows NT 6.1", PrettyVersion = "Windows 7", LatestCLRVersion = CLRVersions.NET45Full };
- private static OperatingSystem WindowsVista = new OperatingSystem() { UserAgentVersion = "Windows NT 6.0", PrettyVersion = "Windows Vista", LatestCLRVersion = CLRVersions.NET45Full };
- private static OperatingSystem WindowsXP64ORServer2003 = new OperatingSystem {UserAgentVersion = "Windows NT 5.2", PrettyVersion = "Windows XP x64, Windows Server 2003", LatestCLRVersion = CLRVersions.NET40Full };
- private static OperatingSystem WindowsXP = new OperatingSystem() { UserAgentVersion = "Windows NT 5.1", PrettyVersion = "Windows XP", LatestCLRVersion = CLRVersions.NET40Full };
- private static OperatingSystem Windows2000SP1 = new OperatingSystem() { UserAgentVersion = "Windows NT 5.01", PrettyVersion = "Windows 2000 SP1", LatestCLRVersion = CLRVersions.NET20Full };
- private static OperatingSystem Windows2000 = new OperatingSystem() { UserAgentVersion = "Windows NT 5.0", PrettyVersion = "Windows 2000", LatestCLRVersion = CLRVersions.NET20Full };
- private static OperatingSystem Windows98 = new OperatingSystem() { UserAgentVersion = "Windows 98", PrettyVersion = "Windows 98", LatestCLRVersion = CLRVersions.NET20Full };
- private static OperatingSystem Macintosh = new OperatingSystem() { UserAgentVersion = "Mac", PrettyVersion = "Macintosh", LatestCLRVersion = null };
- private static OperatingSystem UnixBased = new OperatingSystem() { UserAgentVersion = "nix", PrettyVersion = "Unix/Linux", LatestCLRVersion = null };
- private static OperatingSystem Android = new OperatingSystem() { UserAgentVersion= "Android", PrettyVersion="Android", LatestCLRVersion = null };
+ public static OperatingSystem Windows8 = new OperatingSystem() { UserAgentVersion = "Windows NT 6.2", PrettyVersion = "Windows 8", LatestCLRVersion = CLRVersions.NET45Full };
+ public static OperatingSystem Windows7 = new OperatingSystem() { UserAgentVersion = "Windows NT 6.1", PrettyVersion = "Windows 7", LatestCLRVersion = CLRVersions.NET45Full };
+ public static OperatingSystem WindowsVista = new OperatingSystem() { UserAgentVersion = "Windows NT 6.0", PrettyVersion = "Windows Vista", LatestCLRVersion = CLRVersions.NET45Full };
+ public static OperatingSystem WindowsXP64ORServer2003 = new OperatingSystem { UserAgentVersion = "Windows NT 5.2", PrettyVersion = "Windows XP x64, Windows Server 2003", LatestCLRVersion = CLRVersions.NET40Full };
+ public static OperatingSystem WindowsXP = new OperatingSystem() { UserAgentVersion = "Windows NT 5.1", PrettyVersion = "Windows XP", LatestCLRVersion = CLRVersions.NET40Full };
+ public static OperatingSystem Windows2000SP1 = new OperatingSystem() { UserAgentVersion = "Windows NT 5.01", PrettyVersion = "Windows 2000 SP1", LatestCLRVersion = CLRVersions.NET20Full };
+ public static OperatingSystem Windows2000 = new OperatingSystem() { UserAgentVersion = "Windows NT 5.0", PrettyVersion = "Windows 2000", LatestCLRVersion = CLRVersions.NET20Full };
+ public static OperatingSystem Windows98 = new OperatingSystem() { UserAgentVersion = "Windows 98", PrettyVersion = "Windows 98", LatestCLRVersion = CLRVersions.NET20Full };
+ public static OperatingSystem Macintosh = new OperatingSystem() { UserAgentVersion = "Mac", PrettyVersion = "Macintosh", LatestCLRVersion = null };
+ public static OperatingSystem UnixBased = new OperatingSystem() { UserAgentVersion = "nix", PrettyVersion = "Unix/Linux", LatestCLRVersion = null };
+ public static OperatingSystem Android = new OperatingSystem() { UserAgentVersion = "Android", PrettyVersion = "Android", LatestCLRVersion = null };
- public static List<OperatingSystem> OSVersions = new List<OperatingSystem>
+ public static List<OperatingSystem> OSVersions = new List<OperatingSystem>
{
Windows8,
Windows7,
@@ -39,10 +39,10 @@ public class OperatingSystems
UnixBased
};
- public static OperatingSystem GetOperatingSystem(string UserAgent)
- {
- return OSVersions.FirstOrDefault(o => UserAgent.Contains(o.UserAgentVersion));
- }
+ public static OperatingSystem GetOperatingSystem(string UserAgent)
+ {
+ return OSVersions.FirstOrDefault(o => UserAgent.Contains(o.UserAgentVersion));
+ }
}
}

0 comments on commit fcdc213

Please sign in to comment.
Something went wrong with that request. Please try again.