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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
// Parametrage PROPATH
var
AuthPage : TInputQueryWizardPage;
procedure InitializeWizard();
begin
AuthPage := CreateInputQueryPage(wpWelcome,
'CONFIGURATION PROPATH APP SERVEUR','PARAMETRAGE INI',
'Merci de renseigner le PROPATH APP SERVEUR. Puis appuyer sur suivant.');
AuthPage.Add('IDENT CLIENT:', False);
AuthPage.Add('RACINE ERP:', False);
AuthPage.Add('RACINE DOG:', False);
AuthPage.Add('PORTAIL WEB:', False);
end;
function AuthForm_NextButtonClick(Page: TWizardPage): Boolean;
begin
Result := True;
end;
function GetIdent(Param: String): string;
begin
result := AuthPage.Values[0];
end;
function GetErp(Param: String): string;
begin
result := AuthPage.Values[1];
end;
function GetRacine(Param: String): string;
begin
result := AuthPage.Values[2];
end;
function GetConsoleWeb(Param: String): string;
begin
result := AuthPage.Values[3];
end;
// Parametrage Turboini
procedure InitializeWizard2();
begin
AuthPage := CreateInputQueryPage(wpWelcome,
'CONFIGURATION TURBOGRAPH','CONFIGURATION TURBOMAQ',
'Merci de renseigner votre SERVEUR SMTP, URL PORTAIL et PROPATH. Puis appuyer sur suivant.');
AuthPage.Add('SMTP: ', False);
AuthPage.Add('URL: ', False);
AuthPage.Add('PATH: ', False);
end;
function GetRoot(Param: String): string;
begin
result : = AuthPage.Values[0];
end;
function GetSmtp(Param: String): string;
begin
result : = AuthPage.Values[1];
end;
function GetHttp(Param: String): string;
begin
result : = AuthPage.Values[2];
end;
// Espace Disponible sur le disque + Espace Necessaire
var
PathLabel, TotalSpaceLabel, FreeSpaceLabel, NeedSpacelabel, InstallSpaceLabel: TLabel;
FreeMB, TotalMB: Cardinal;
Drive: String;
Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.2n', [Float]); StringChange(Result, ',', ',');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = ',')) and (Pos(',', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;
function MbOrTb(Float: Extended): String;
begin
if Float < 1024 then Result:= NumToStr(Float)+' MB' else
if Float/1024 < 1024 then Result:= NumToStr(Float/1024)+' GB' else
Result:= NumToStr(Float/(1024*1024))+' TB';
end;
procedure DirEditOnChange(Sender: TObject);
begin
Drive:= ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Drive, True, FreeMB, TotalMB);
TotalSpaceLabel.Caption:= 'Total disk space: '+MbOrTb(TotalMB);
FreeSpaceLabel.Caption:= 'Available disk space: '+MbOrTb(FreeMB)+' ('+IntToStr(round(FreeMB*100/TotalMB))+'%)';
NeedSpaceLabel.Caption:= 'Required disk space: '+MbOrTb({#NeedSize});
WizardForm.NextButton.Enabled:= (FreeMB>{#NeedSize});
end;
procedure InitializeWizard();
begin
with WizardForm do
begin
PathLabel := TLabel.Create(WizardForm)
DirEdit.OnChange := @DirEditOnChange;
end;
TotalSpaceLabel:= TLabel.Create(WizardForm);
TotalSpaceLabel.AutoSize:= False;
TotalSpaceLabel.SetBounds(0, 155, 300, 20);
TotalSpaceLabel.Parent:= WizardForm.SelectDirpage;
FreeSpaceLabel:= TLabel.Create(WizardForm);
FreeSpaceLabel.AutoSize:= False;
FreeSpaceLabel.SetBounds(0, 175, 300, 20);
FreeSpaceLabel.Parent:= WizardForm.SelectDirpage;
NeedSpaceLabel:= TLabel.Create(WizardForm);
NeedSpaceLabel.AutoSize:= False;
NeedSpaceLabel.SetBounds(0, 195, 300, 20)
NeedSpaceLabel.Parent:= WizardForm.SelectDirpage;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID=wpSelectDir then
begin
DirEditOnChange(nil)
end;
end; |
Partager