inno setup - How to install .net framework 4.5 after download completes from web using innosetup? -


i want download , install .netframework 4.5 web using innosetup. followed these procedure, 1.i downloaded , installed innotools downloader. 2.in initializewizard declared

itd_init; itd_addfile('http://go.microsoft.com/fwlink/?linkid=225702',expandconstant('{tmp}\dotnetfx45_full_x86_x64.exe')); itd_downloadafter(10); 

where 10 curpageid. , in

nextbuttonclick(curpageid: integer) added ,  if curpageid=104 begin       `filecopy(expandconstant('{tmp}\dotnetfx45_full_x86_x64.exe'),expandconstant('{app}\dotnetfx`45_full_x86_x64.exe'),false);      end 

*now need is,i want check whether .net framework 4.5 installed in pc or not, using function how can check *,

function framework45isnotinstalled(): boolean; var  bver4x5: boolean;  bsuccess: boolean;  iinstalled: cardinal;  strversion: string;  ipos: cardinal;  errorcode: integer;  begin  result := true;  bver4x5 := false;   bsuccess := regquerydwordvalue(hklm, 'software\microsoft\net framework setup\ndp\v4\full', 'install', iinstalled);  if (1 = iinstalled) , (true = bsuccess)   begin     bsuccess := regquerystringvalue(hklm, 'software\microsoft\net framework setup\ndp\v4\full', 'version', strversion);     if (true = bsuccess)      begin         ipos := pos('4.5.', strversion);         if (0 < ipos) bver4x5 := true;       end   end;   if (true = bver4x5) begin     result := false; end; end; 

where need check condition, in side downloading , installing of .netframework 4.5 happening fine,the condition need check whether .net framework 4.5 installed or not,before calling **itd_downloadafter(10)where 10 curpageid.**. download wont happen, if .netframework exist in enduser pc. how can achieve task? ideas?

the release version numbers in registry .net 4.5 highlighted in msdn: http://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx

your code needs modified @ 'release' key in registry specified in mdsn article above , can simplified check value.

function framework45isnotinstalled(): boolean;   var    bsuccess: boolean;    regversion: cardinal;    begin     result := true;      bsuccess := regquerystringvalue(hklm, 'software\microsoft\net framework setup\ndp\v4\full', 'release', regversion);     if (true = bsuccess) , (regversion >= 378389) begin       result := false;     end;   end; end; 

for more complete example of checking .net version numbers inno setup can @ code in useful article: http://kynosarges.org/dotnetversion.html


Comments