Detect and download the .NET framework.: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
Line 3: Line 3:
== Description ==
== Description ==
I would HIGHLY recommend using this script instead. It is more complex yet much more robust.
I would HIGHLY recommend using this script instead. It is more complex yet much more robust.
[[Installing the Microsoft .NET Framework]] yo
[[Installing the Microsoft .NET Framework]]


== The Function ==
== The Function ==

Revision as of 12:21, 8 June 2010

Author: pixolut (talk, contrib)


Description

I would HIGHLY recommend using this script instead. It is more complex yet much more robust. Installing the Microsoft .NET Framework

The Function

; Function: GetDotNet
; Author: Joe Cincotta ( joe@pixolut.com )
; Date: 24/6/2004
;
; Detect the .NET Framework installation. Download if not present.
; NOTES: 
; Requires a default web browser to be installed.
; This function will quit if the framework has not been found. 
; you could replace this with a 'click when done' dialog or something
; similar which waits for the installation process to complete.
; - Note that my quick and dirty exe exists approach could be updated
; to use the registry approaches in the other .NET detect examples...
;
; Usage:
;   Call GetDotNet
----
----
----
----'''Bold text'''
 
 
 
 
 
Function GetDotNet
  IfFileExists "$WINDIR\Microsoft.NET\Framework\v1.1.4322\installUtil.exe" NextStep
  MessageBox MB_OK|MB_ICONEXCLAMATION "You must have the Microsoft .NET Framework 1.1 Installed to use this application. $\n$\n Click 'Open' in the following file dialog to download and run the Microsoft .NET Framework Installer..."
  ExecShell Open "http://download.microsoft.com/download/a/a/c/aac39226-8825-44ce-90e3-bf8203e74006/dotnetfx.exe" SW_SHOWNORMAL
  Quit
NextStep:
FunctionEnd
; Here is a modified version of the above for the .NET 2.0 runtime.
 
Function GetDotNet
  IfFileExists "$WINDIR\Microsoft.NET\Framework\v2.0.50727\installUtil.exe" NextStep
  MessageBox MB_OK|MB_ICONEXCLAMATION "You must have the Microsoft .NET Framework 2.0 Installed to use this application. $\n$\nClick 'Open' in the following file dialog to download and run the Microsoft .NET Framework Installer..."
  ExecShell Open "http://www.microsoft.com/downloads/info.aspx?na=90&p=&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=0856eacb-4362-4b0d-8edd-aab15c5e04f5&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f5%2f6%2f7%2f567758a3-759e-473e-bf8f-52154438565a%2fdotnetfx.exe" SW_SHOWNORMAL
  Quit
NextStep:
FunctionEnd