I have an application that I have to check if .NET FW 3.5 is installed. If it is already installed, I want to open a mailbox that asks the user to download it from the Microsoft website and stop the installation.
I found the following code. Can you tell me:
a) Where do I get this function from? b) Do I have to check if .NET FW 3.5 or higher is installed? For example, if FW 4.0 is installed - do you need to install 3.5?
thanks
function IsDotNET35Detected(): Boolean; var ErrorCode: Integer; netFrameWorkInstalled : Boolean; isInstalled: Cardinal; begin result := true; // Check for the .Net 3.5 framework isInstalled := 0; netFrameworkInstalled := RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5', '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=333325fd-ae52-4e35-b531-508d977d32a6&DisplayLang=en', '','',SW_SHOWNORMAL,ewNoWait,ErrorCode); end; result := false; end; end;
Tamir gefen
source share