Advertisement
RobeN

Check for .NET during InitializeSetup

Jan 20th, 2015
3,378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [CustomMessages]
  2. dotNETnotpresent=Foi detectado que seu computador não possui o .NET Framework 4.0. Para que o aplicativo execute normalmente é necessário tê-lo instalado. %n%nDeseja instalar?
  3.  
  4. [Code]
  5. function InitializeSetup(): Boolean;
  6. var
  7.   Q: Integer;
  8. begin
  9.     Result := False;
  10.     if not RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\.NETFramework\policy\v4.0') then begin
  11.     //Registry entry was not found, quesion will appear
  12.         Q := MsgBox(ExpandConstant('{cm:dotNETnotpresent}'), mbInformation, MB_YESNO);      
  13.         if Q = IDYES then begin
  14.         //If the asnwer is YES, Setup will initialize
  15.         //If the answer is NO, Setup will terminate
  16.             Result := True;
  17.         end;
  18.     end
  19.     else begin
  20.     //Registry entry was found, Setup will initialize
  21.         Result := True;
  22.     end;
  23. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement