Ho un'applicazione che devo controllare se .NET FW 3.5 è già installato. Se è già installato, voglio aprire una messagebox che chiede all'utente di scaricarlo dal sito Web Microsoft e interrompere l'installazione..NET Framework come prerequisito per l'installazione con Inno-setup
Ho trovato il seguente codice. Potete dirmi per favore:
a) Da dove devo chiamare questa funzione? b) Devo controllare se .NET FW 3.5 o versione successiva è già installato? per esempio. Se è installato FW 4.0, è necessario installare 3.5?
Grazie
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;
So che non ho risposto a nessuna delle tue domande. Tornerò presto con un aggiornamento ... Ma ora devo andare ... – TLama
Grazie. Lo proverò. Che dire di versioni superiori (> 3.5)? È vero che se FW 4.0 è installato, copre le esigenze di 3.5? –
Dipende dalla tua applicazione come si dice in ['questo articolo'] (http://msdn.microsoft.com/en-us/library/ff602939.aspx). Ma nessuno ha detto chiaramente che se installi, ad es. .NET 4.5 su un computer senza .NET Framework 3.5 installato, che sarà possibile applicare ['questo genere'] (http://support.microsoft.com/kb/318785/en-us) di un rilevamento. – TLama