innosetup を使用して Web から .netframework 4.5 をダウンロードしてインストールしたいと考えています。1. InnoTools Downloader をダウンロードしてインストールしました。2. InitializeWizard で宣言しました
itd_init;
itd_addfile('http://go.microsoft.com/fwlink/?LinkId=225702',expandconstant('{tmp}\dotNetFx45_Full_x86_x64.exe'));
itd_downloadafter(10);
10 は curpageId です。そして、
NextButtonClick(CurPageID: Integer) i added ,
if CurPageId=104 then begin
`filecopy(expandconstant('{tmp}\dotNetFx45_Full_x86_x64.exe'),expandconstant('{app}\dotNetFx`45_Full_x86_x64.exe'),false);
end
*今私がする必要があるのは、関数 how can i check * を使用して、.net Framework 4.5 が私の PC にインストールされているかどうかを確認したいということです。
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) AND (True = bSuccess) then
begin
bSuccess := RegQueryStringValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Full', 'Version', strVersion);
if (True = bSuccess) then
Begin
iPos := Pos('4.5.', strVersion);
if (0 < iPos) then bVer4x5 := True;
End
end;
if (True = bVer4x5) then begin
Result := False;
end;
end;
この条件を確認する必要がある場合、私の側では.netframework 4.5のダウンロードとインストールが正常に行われています。これを呼び出す前に、.net Framework 4.5がインストールされているかどうかを確認する必要がある唯一の条件 **itd_downloadafter(10)Where 10 curpageId.**です。エンドユーザーの PC に .netframework が既に存在する場合は、ダウンロードのみが行われます。どうすればこのタスクを達成できますか? 何か案は?