<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nsis.sourceforge.io/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Download_and_Install_dotNET_45</id>
	<title>Download and Install dotNET 45 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nsis.sourceforge.io/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Download_and_Install_dotNET_45"/>
	<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Download_and_Install_dotNET_45&amp;action=history"/>
	<updated>2026-06-07T07:38:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Download_and_Install_dotNET_45&amp;diff=23094&amp;oldid=prev</id>
		<title>RaggieSoft: /* The Function */</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Download_and_Install_dotNET_45&amp;diff=23094&amp;oldid=prev"/>
		<updated>2013-03-08T17:32:32Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;The Function&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;â† Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:32, 8 March 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l19&quot;&gt;Line 19:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	Var /GLOBAL EXIT_CODE&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	Var /GLOBAL EXIT_CODE&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        # We are reading a version release DWORD that Microsoft says is the documented&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        # way to determine if .NET Framework 4.5 is installed&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	ReadRegDWORD $dotNET45IsThere HKLM &amp;quot;SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full&amp;quot; &amp;quot;Release&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	ReadRegDWORD $dotNET45IsThere HKLM &amp;quot;SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full&amp;quot; &amp;quot;Release&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	IntCmp $dotNET45IsThere 378389 is_equal is_less is_greater&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	IntCmp $dotNET45IsThere 378389 is_equal is_less is_greater&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key n22049_wiki-wiki_:diff::1.12:old-23093:rev-23094 --&gt;
&lt;/table&gt;</summary>
		<author><name>RaggieSoft</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Download_and_Install_dotNET_45&amp;diff=23093&amp;oldid=prev</id>
		<title>RaggieSoft: Function I wrote to install .NET Framework 4.5 from either Microsoft&#039;s website, or a local copy of the installer</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Download_and_Install_dotNET_45&amp;diff=23093&amp;oldid=prev"/>
		<updated>2013-03-08T17:30:03Z</updated>

		<summary type="html">&lt;p&gt;Function I wrote to install .NET Framework 4.5 from either Microsoft&amp;#039;s website, or a local copy of the installer&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{PageAuthor|RaggieSoft}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This little function lets you download and install Microsoft .NET Framework 4.5.  It is self-contained (only requiring LogicLib), works with silent and non-silent installers, and correctly sets the Reboot flag based on Microsoft&amp;#039;s exit codes.  The function can also work with $EXEPATH\components\dotNET45Full.exe (there&amp;#039;s a link below to the .NET installer), while falling back to the download version, which would be useful for CD/DVD/USB distributions.&lt;br /&gt;
&lt;br /&gt;
Please note that .NET Framework 4.5 will *NOT* run on Windows XP.  Microsoft&amp;#039;s installer enforces this.  You need Vista SP2 or Windows 7 (it&amp;#039;s built in to Windows 8, see the function for details).&lt;br /&gt;
&lt;br /&gt;
== The Function ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
 Function CheckAndDownloadDotNet45&lt;br /&gt;
	# Let&amp;#039;s see if the user has the .NET Framework 4.5 installed on their system or not&lt;br /&gt;
	# Remember: you need Vista SP2 or 7 SP1.  It is built in to Windows 8, and not needed&lt;br /&gt;
	# In case you&amp;#039;re wondering, running this code on Windows 8 will correctly return is_equal&lt;br /&gt;
	# or is_greater (maybe Microsoft releases .NET 4.5 SP1 for example)&lt;br /&gt;
&lt;br /&gt;
	# Set up our Variables&lt;br /&gt;
	Var /GLOBAL dotNET45IsThere&lt;br /&gt;
	Var /GLOBAL dotNET_CMD_LINE&lt;br /&gt;
	Var /GLOBAL EXIT_CODE&lt;br /&gt;
&lt;br /&gt;
	ReadRegDWORD $dotNET45IsThere HKLM &amp;quot;SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full&amp;quot; &amp;quot;Release&amp;quot;&lt;br /&gt;
	IntCmp $dotNET45IsThere 378389 is_equal is_less is_greater&lt;br /&gt;
&lt;br /&gt;
	is_equal:&lt;br /&gt;
		Goto done_compare_not_needed&lt;br /&gt;
	is_greater:&lt;br /&gt;
		# Useful if, for example, Microsoft releases .NET 4.5 SP1&lt;br /&gt;
		# We want to be able to simply skip install since it&amp;#039;s not&lt;br /&gt;
		# needed on this system&lt;br /&gt;
		Goto done_compare_not_needed&lt;br /&gt;
	is_less:&lt;br /&gt;
		Goto done_compare_needed&lt;br /&gt;
&lt;br /&gt;
	done_compare_needed:&lt;br /&gt;
		#.NET Framework 4.5 install is *NEEDED*&lt;br /&gt;
&lt;br /&gt;
		# Microsoft Download Center EXE:&lt;br /&gt;
		# Web Bootstrapper: http://go.microsoft.com/fwlink/?LinkId=225704&lt;br /&gt;
		# Full Download: http://go.microsoft.com/fwlink/?LinkId=225702&lt;br /&gt;
&lt;br /&gt;
		# Setup looks for components\dotNET45Full.exe relative to the install EXE location&lt;br /&gt;
		# This allows the installer to be placed on a USB stick (for computers without internet connections)&lt;br /&gt;
		# If the .NET Framework 4.5 installer is *NOT* found, Setup will connect to Microsoft&amp;#039;s website&lt;br /&gt;
		# and download it for you&lt;br /&gt;
&lt;br /&gt;
		# Reboot Required with these Exit Codes:&lt;br /&gt;
		# 1641 or 3010&lt;br /&gt;
&lt;br /&gt;
		# Command Line Switches:&lt;br /&gt;
		# /showrmui /passive /norestart&lt;br /&gt;
&lt;br /&gt;
		# Silent Command Line Switches:&lt;br /&gt;
		# /q /norestart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		# Let&amp;#039;s see if the user is doing a Silent install or not&lt;br /&gt;
		IfSilent is_quiet is_not_quiet&lt;br /&gt;
&lt;br /&gt;
		is_quiet:&lt;br /&gt;
			StrCpy $dotNET_CMD_LINE &amp;quot;/q /norestart&amp;quot;&lt;br /&gt;
			Goto LookForLocalFile&lt;br /&gt;
		is_not_quiet:&lt;br /&gt;
			StrCpy $dotNET_CMD_LINE &amp;quot;/showrmui /passive /norestart&amp;quot;&lt;br /&gt;
			Goto LookForLocalFile&lt;br /&gt;
&lt;br /&gt;
		LookForLocalFile:&lt;br /&gt;
			# Let&amp;#039;s see if the user stored the Full Installer&lt;br /&gt;
			IfFileExists &amp;quot;$EXEPATH\components\dotNET45Full.exe&amp;quot; do_local_install do_network_install&lt;br /&gt;
&lt;br /&gt;
			do_local_install:&lt;br /&gt;
				# .NET Framework found on the local disk.  Use this copy&lt;br /&gt;
&lt;br /&gt;
				ExecWait &amp;#039;&amp;quot;$EXEPATH\components\dotNET45Full.exe&amp;quot; $dotNET_CMD_LINE&amp;#039; $EXIT_CODE&lt;br /&gt;
				Goto is_reboot_requested&lt;br /&gt;
&lt;br /&gt;
			# Now, let&amp;#039;s Download the .NET&lt;br /&gt;
			do_network_install:&lt;br /&gt;
&lt;br /&gt;
				Var /GLOBAL dotNetDidDownload&lt;br /&gt;
				NSISdl::download &amp;quot;http://go.microsoft.com/fwlink/?LinkId=225704&amp;quot; &amp;quot;$TEMP\dotNET45Web.exe&amp;quot; $dotNetDidDownload&lt;br /&gt;
&lt;br /&gt;
				StrCmp $dotNetDidDownload success fail&lt;br /&gt;
				success:&lt;br /&gt;
					ExecWait &amp;#039;&amp;quot;$TEMP\dotNET45Web.exe&amp;quot; $dotNET_CMD_LINE&amp;#039; $EXIT_CODE&lt;br /&gt;
					Goto is_reboot_requested&lt;br /&gt;
&lt;br /&gt;
				fail:&lt;br /&gt;
					MessageBox MB_OK|MB_ICONEXCLAMATION &amp;quot;Unable to download .NET Framework.  ${PRODUCT_NAME} will be installed, but will not function without the Framework!&amp;quot;&lt;br /&gt;
					Goto done_dotNET_function&lt;br /&gt;
&lt;br /&gt;
				# $EXIT_CODE contains the return codes.  1641 and 3010 means a Reboot has been requested&lt;br /&gt;
				is_reboot_requested:&lt;br /&gt;
					${If} $EXIT_CODE = 1641&lt;br /&gt;
					${OrIf} $EXIT_CODE = 3010&lt;br /&gt;
						SetRebootFlag true&lt;br /&gt;
					${EndIf}&lt;br /&gt;
&lt;br /&gt;
	done_compare_not_needed:&lt;br /&gt;
		# Done dotNET Install&lt;br /&gt;
		Goto done_dotNET_function&lt;br /&gt;
&lt;br /&gt;
	#exit the function&lt;br /&gt;
	done_dotNET_function:&lt;br /&gt;
&lt;br /&gt;
    FunctionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Written by [[RaggieSoft]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Code Examples]]&lt;/div&gt;</summary>
		<author><name>RaggieSoft</name></author>
	</entry>
</feed>