1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
function InitializeSetup: Boolean;
var
Version: TWindowsVersion;
S: String;
NetFrameWorkInstalled : Boolean;
SqlServercompact35Installed : Boolean;
ErrorCode: Integer;
begin
GetWindowsVersionEx(Version);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// On Windows XP, check for SP2
if Version.NTPlatform and
(Version.Major = 5) and
(Version.Minor = 1) and
(Version.ServicePackMajor < 2) then
begin
SuppressibleMsgBox('La configuration minimum du système doit être windows XP service pack 2.',
mbCriticalError, MB_OK, MB_OK);
Result := False;
Exit;
end;
//La version minimale d'xp est bien le service pack 2
Result := True;
//Test pour savoir si le Framework 4.0 client profile X86 et X64 est installé
begin
//;LA CLE CORRESPONDANT AU FRAMEWORK 4.0 CLIENT PROFILE EXISTE-T-ELLE
NetFrameWorkInstalled := RegKeyExists(HKLM,'SOFTWARE\Microsoft\.NETFramework\v4.0.30319');
//;SI OUI :
if NetFrameWorkInstalled then
begin
//;ON RETOURNE TRUE
Result := true;
end else
begin
//;SINON ON INSTALLE
begin
ShellExec('open',
ExpandConstant('{src}\dotNetFx40_Client_setup.exe'),
'','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
end;
end;
end;
//Test pour savoir si SQL Server compact 3.5 SP2 est installé
begin
//;LA CLE CORRESPONDANT A SQL Server compact 3.5 SP2 EXISTE-T-ELLE
SqlServercompact35Installed := RegKeyExists(HKLM,'SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v3.5');
//;SI OUI :
if SqlServercompact35Installed then
begin
//;ON RETOURNE TRUE
Result := true;
end else
begin
//;SINON ON INSTALLE
begin
ShellExec('open',
ExpandConstant('{src}\SSCERuntime-FRA.exe'),
'','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
end;
end;
end;
end; |
Partager