Simple Way To Install .NET Framework: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
(created page) |
(Converted list of .NET versions to table) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
== How To Use == | == How To Use == | ||
First copy the script into your NSIS script. Using the list below, change NETVersion to the right version and download the installer: | First copy the script into your NSIS script. Using the list below, change NETVersion to the right version and download the installer: | ||
{| class="wikitable sortable" border="1" | |||
|- | |||
! .NET Version !! Download Link | |||
|- | |||
| 1.0.3705 || http://www.filehippo.com/download_dotnet_framework_1/ | |||
|- | |||
| 1.1.4322 || http://www.filehippo.com/download_dotnet_framework_1/ | |||
|- | |||
| 2.0.50727 || http://www.filehippo.com/download_dotnet_framework_2/ | |||
|- | |||
| 3.0 || http://www.filehippo.com/download_dotnet_framework_3/3481/ | |||
|- | |||
| 3.5 || http://www.filehippo.com/download_dotnet_framework_3/ | |||
|- | |||
| 4.0.30319 || http://www.microsoft.com/download/en/details.aspx?id=17718 | |||
|} | |||
Then move the .NET installer to the folder with NSIS and change NETInstaller to the filename. Compile your script and test it, if you have the framework installed then it wont install and if it isnt, then it will install. | Then move the .NET installer to the folder with NSIS and change NETInstaller to the filename. Compile your script and test it, if you have the framework installed then it wont install and if it isnt, then it will install. | ||
== Example Section == | == Example Section == | ||
<highlight-nsis> | <highlight-nsis> | ||
Line 29: | Line 42: | ||
== Reference == | == Reference == | ||
[http://msdn.microsoft.com | [http://msdn.microsoft.com/kb/kbarticle.aspx?id=318785 How to determine which versions of the .NET Framework are installed and whether service packs have been applied] | ||
[[Category:Code Examples]] | [[Category:Code Examples]] | ||
[[Category:Other Products Version Detection Functions]] | [[Category:Other Products Version Detection Functions]] |
Latest revision as of 19:11, 25 January 2012
Information
After looking at the other examples of how to detect the current Microsoft .NET Framework on the computer, they all don't seem to be looking in the right place. If you do a search on the MSDN website you will see that it has some documentation on how to see if a version of the .NET framework is installed.
How To Use
First copy the script into your NSIS script. Using the list below, change NETVersion to the right version and download the installer:
Then move the .NET installer to the folder with NSIS and change NETInstaller to the filename. Compile your script and test it, if you have the framework installed then it wont install and if it isnt, then it will install.
Example Section
!define NETVersion "3.5" !define NETInstaller "dotNetFx35setup.exe" Section "MS .NET Framework v${NETVersion}" SecFramework IfFileExists "$WINDIR\Microsoft.NET\Framework\v${NETVersion}" NETFrameworkInstalled 0 File /oname=$TEMP\${NETInstaller} ${NETInstaller} DetailPrint "Starting Microsoft .NET Framework v${NETVersion} Setup..." ExecWait "$TEMP\${NETInstaller}" Return NETFrameworkInstalled: DetailPrint "Microsoft .NET Framework is already installed!" SectionEnd