|
-
Jul 1st, 2010, 06:44 PM
#1
Thread Starter
Lively Member
innosetup checking for 4.0 framework and installing if missing
Found a script online and tweaked it a bit. Figure others would like it to
[CustomMessages]
dotnetmissing=This application requires Microsoft Framework 4.0 which is not yet installed on this computer. Would you like to download it now?
function InitializeSetup(): Boolean;
var
ErrorCode: Integer;
netFrameWorkInstalled : Boolean;
isInstalled: Cardinal;
begin
result := true;
// Check for the .Net 4.0 framework
isInstalled := 0;
netFrameworkInstalled := RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\client', 'Install', isInstalled);
if ((netFrameworkInstalled) and (isInstalled <> 1)) then netFrameworkInstalled := false;
if netFrameworkInstalled = false then
begin
if (MsgBox(ExpandConstant('{cm:dotnetmissing}'),
mbConfirmation, MB_YESNO) = idYes) then
begin
ShellExec('open',
'http://www.microsoft.com/downloads/details.aspx?familyid=9CFB2D51-5FF4-4491-B0E5-B386F32C0992&displaylang=en',
'','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
end;
result := false;
end;
end;
-
Jul 14th, 2010, 05:45 AM
#2
Re: innosetup checking for 4.0 framework and installing if missing
This code checks, downloads and installs it if needed. Make sure you have the isxdl.dll also deployed. If you don't know how it works Google: "isxdl.dll Innosetup".
[CustomMessages]
dotnetfx40_title=.NET Framework 4.0
en.dotnetfx40_size=48.1 MB
[Code]
const
dotnetfx40_url = 'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe';
procedure dotnetfx40();
var
version: cardinal;
begin
RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Full', 'Install', version);
if version <> 1 then
AddProduct('dotNetFx40_Full_x86_x64.exe',
'/q /norestart',
CustomMessage('dotnetfx40_title'),
CustomMessage('dotnetfx40_size'),
dotnetfx40_url);
end;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|