.NET - Detect framework
From ISXKB
Detect if the .NET framework is installed, and open a browser window with the download URL if it is not.
Code provided by AG and Matej Cerk
[Setup]
AppName=NETFramewrok
AppVerName=NETFramewrok
DefaultDirName={pf}\NETFramewrok
DisableStartupPrompt=true
[Code]
function InitializeSetup(): Boolean;
var
ErrorCode: Integer;
NetFrameWorkInstalled : Boolean;
Result1 : Boolean;
begin
NetFrameWorkInstalled := RegKeyExists(HKLM,'SOFTWARE\Microsoft\.NETFramework\policy\v1.0');
if NetFrameWorkInstalled then
begin
Result := true;
end else
begin
NetFrameWorkInstalled := RegKeyExists(HKLM,'SOFTWARE\Microsoft\.NETFramework\policy\v1.1');
if NetFrameWorkInstalled then
begin
Result := true;
end else
begin
Result1 := MsgBox('This setup requires the .NET Framework. Please download and install the .NET Framework and run this setup again. Do you want to download the framwork now?',
mbConfirmation, MB_YESNO) = idYes;
if Result1 =false then
begin
Result:=false;
end else
begin
Result:=false;
ShellExec('open',
'http://download.microsoft.com/download/a/a/c/aac39226-8825-44ce-90e3-bf8203e74006/dotnetfx.exe',
'','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
end;
end;
end;
end;
See also
- Acrobat Reader - Detect installed version
- DirectX - How to detect DirectX version
- MDAC - How to detect version of MDAC installed
- Visual FoxPro
External links
- MSKB - How to detect the installed version of the .NET Framework
- .NET Framework 1.1 Installer for Innosetup at CodeProject
- .NET Framework 1.1/2.0/3.5 Installer for InnoSetup by stfx at CodeProject
- .NET Framework 1.1..4.0, VC++2010, SQL 2008 R2 Express Installer for InnoSetup (Based on 'stfx at CodeProject') by Ton
- .NET : Install your app and the .NET framework using INNO Setup at Zerosandtheone
- Detect & Install .NET 3.5 Framework using Inno Setup. By Priyank Bolia
- Check .NET Version with Inno Setup Kynosarges, detect from .NET 1.1 up to .NET 4.0
