Εντοπίζει dotNet και τη Microsoft Access 2000. Μπορείς να προσθέσεις και ότι άλλο θες. Κάπου το βρήκα και εγώ στο internet αλλά το ξέχασα που. Ήταν μόνο για dotNet και του πρόσθεσα και τη Microsoft Access 2000.
[Code]
const
dotnetRedistURL = 'http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe';
var
//
access9Needed: boolean;
access9RedistPath: string;
//
dotnetRedistPath: string;
dotNetNeeded: boolean;
downloadNeeded: boolean;
//
memoDependenciesNeeded: string;
procedure isxdl_AddFile(URL, Filename: PChar);
external 'isxdl_AddFile@files:isxdl.dll stdcall';
function isxdl_DownloadFiles(hWnd: Integer): Integer;
external 'isxdl_DownloadFiles@files:isxdl.dll stdcall';
function isxdl_SetOption(Option, Value: PChar): Integer;
external 'isxdl_SetOption@files:isxdl.dll stdcall';
function InitializeSetup(): Boolean;
var dotNETExist, access9Exist :boolean;
begin
//
Result := true;
dotNetNeeded := false;
//
if (not IsAdminLoggedOn()) then begin
MsgBox('Η εφαρμογή για να εγκατασταθεί χρειάζεται να έχετε δικαιώματα διαχειριστή (Administrator).', mbInformation, MB_OK);
Result := false;
exit;
end;
// Check for required netfx installation
//
access9Exist := RegKeyExists(HKLM, 'SOFTWARE\Microsoft\Office\9.0\Access');
dotNETExist := RegKeyExists(HKLM, 'SOFTWARE\Microsoft\.NETFramework\policy\v2.0');
//
if (not access9Exist) then begin
access9Needed := true;
memoDependenciesNeeded := memoDependenciesNeeded + ' Microsoft Acess 2000' #13;
access9RedistPath := ExpandConstant('{src}\Tools\MSAccessRunTime\DATA1.MSI');//SETUP.EXE
end;
//
if (not dotNETExist) then begin
dotNetNeeded := true;
memoDependenciesNeeded := memoDependenciesNeeded + ' .NET Framework 2.0' #13;
dotnetRedistPath := ExpandConstant('{src}\Tools\dotNetFx\dotnetfx.exe');
if not FileExists(dotnetRedistPath) then begin
dotnetRedistPath := ExpandConstant('{tmp}\dotnetfx.exe');
if not FileExists(dotnetRedistPath) then begin
isxdl_AddFile(dotnetRedistURL, dotnetRedistPath);
downloadNeeded := true;
end;
SetIniString('install', 'dotnetRedist', dotnetRedistPath, ExpandConstant('{tmp}\dep.ini'));
end;
end;
//
end;
function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
s: string;
begin
if memoDependenciesNeeded <> '' then s := s + 'Απαραίτητα συστατικά για εγκατάσταση:' + NewLine + memoDependenciesNeeded + NewLine;
s := s + MemoDirInfo + NewLine + NewLine;
Result := s
end;
function NextButtonClick(CurPage: Integer): Boolean;
var
hWnd: Integer;
ResultCode: Integer;
begin
Result := true;
//
if CurPage = wpReady then begin
//
hWnd := StrToInt(ExpandConstant('{wizardhwnd}'));
//
// don't try to init isxdl if it's not needed because it will error on < ie 3
if downloadNeeded then begin
isxdl_SetOption('label', 'Κατέβασμα του Microsoft .NET Framework');
isxdl_SetOption('description', 'Χρειάζεται να εγκατασταθεί το Microsoft .NET Framework. Παρακαλώ περιμένετε για κατεβούν τα απαραίτητα στοιχειά στο υπολογιστή σας.');
if isxdl_DownloadFiles(hWnd) = 0 then Result := false;
end;
//
//MS Acess 2000
if (Result) and (access9Needed) then begin
if Exec('msiexec.exe', '/i "'+ExpandConstant(access9RedistPath)+'" /qb', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then begin
// handle success if necessary; ResultCode contains the exit code
if not (ResultCode = 0) then Result := false;
end else begin
// handle failure if necessary; ResultCode contains the error code
Result := false;
end;
end;
//
//dotNET
if (Result) and (dotNetNeeded) then begin
if Exec(ExpandConstant(dotnetRedistPath), '/c:"install /qb"', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then begin
// handle success if necessary; ResultCode contains the exit code
if not (ResultCode = 0) then Result := false;
end else begin
// handle failure if necessary; ResultCode contains the error code
Result := false;
end;
end;
//
end;
//
end;
while (!dead) learn();