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 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
|
var
finishedInstall:Boolean;
OldVersionUninstallString : string;
//INSTALLATION
// Vérification d'existant au début de l'installation
function InitializeSetup(): Boolean;
begin
if RegKeyExists(HKEY_LOCAL_MACHINE,'SOFTWARE\PostgreSQL') = true then
begin
Msgbox('PostgreSQL semble être installé!',mbConfirmation,MB_Ok);
//Result:=False;
//ne pas installer postgresql
Result:=true;
end
else
begin
Msgbox('PostgreSQL ne semble pas être installé!',mbConfirmation,MB_Ok);
Result:=True;
end;
if RegKeyExists(HKEY_LOCAL_MACHINE,'SOFTWARE\JavaSoft\Java Development Kit') = true then
begin
Msgbox('JDK semble être installé!',mbConfirmation,MB_Ok);
//ne pas installer postgresql
//Result:=False;
Result:=true;
end
else
begin
Msgbox('JDK ne semble pas être installé!',mbConfirmation,MB_Ok);
Result:=True;
end;
end;
//procédure permettant d'ajouter le about
procedure AboutButtonOnClick(Sender: TObject);
begin
MsgBox('la Platforme realisée ', mbInformation, mb_Ok);
end;
//procédure pour ajouter le lien du site dans les fenêtres de l'installation
procedure URLLabelOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://www.novadecision.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
//procédure pour la création du bouton et du URL qui seront insérer dans toutes les fenêtre de l'instalation
procedure CreateAboutButtonAndURLLabel(ParentForm: TSetupForm; CancelButton: TNewButton);
var
AboutButton: TNewButton;
URLLabel: TNewStaticText;
begin
AboutButton := TNewButton.Create(ParentForm);
AboutButton.Left := ParentForm.ClientWidth - CancelButton.Left - CancelButton.Width;
AboutButton.Top := CancelButton.Top;
AboutButton.Width := CancelButton.Width;
AboutButton.Height := CancelButton.Height;
AboutButton.Caption := '&About...';
AboutButton.OnClick := @AboutButtonOnClick;
AboutButton.Parent := ParentForm;
URLLabel := TNewStaticText.Create(ParentForm);
URLLabel.Caption := 'www.google.com';
URLLabel.Cursor := crHand;
URLLabel.OnClick := @URLLabelOnClick;
URLLabel.Parent := ParentForm;
{ Alter Font *after* setting Parent so the correct defaults are inherited first }
URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
{URLLabel.Font.Color := clBlue;}
URLLabel.Font.Color := clGreen;
URLLabel.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
URLLabel.Left := AboutButton.Left + AboutButton.Width + ScaleX(20);
end;
//DESINSTALLATION
// fonction pour l'Envoie d'un message au reponsable après une désinstallation du produit
function UninstallEzDesign(): Boolean;
var
Form: TSetupForm;
FeedbackLabel0: TLabel;
FeedbackLabel1: TLabel;
OKButton, CancelButton: TButton;
FeedbackMemo: TMemo;
Feedback: String;
Url: String;
ErrorCode: Integer;
begin
Result := false;
Form := CreateCustomForm();
try
Form.ClientWidth := ScaleX(450);
Form.ClientHeight := ScaleY(10+23 +10+46 +10+23 +10+23+10 + 23);
Form.Caption := 'désinstallation';
Form.BorderIcons := [biSystemMenu];
Form.BorderStyle := bsDialog;
Form.Center;
OKButton := TButton.Create(Form);
OKButton.Parent := Form;
OKButton.Width := ScaleX(75);
OKButton.Height := ScaleY(23);
OKButton.Left := Form.ClientWidth - ScaleX(75 + 6 + 75 + 20);
OKButton.Top := Form.ClientHeight - ScaleY(23 + 10);
OKButton.Caption := 'Send';
OKButton.ModalResult := mrOk;
OKButton.Default := true;
CancelButton := TButton.Create(Form);
CancelButton.Parent := Form;
CancelButton.Width := ScaleX(75);
CancelButton.Height := ScaleY(23);
CancelButton.Left := Form.ClientWidth - ScaleX(75 + 20);
CancelButton.Top := Form.ClientHeight - ScaleY(23 + 10);
CancelButton.Caption := 'Cancel';
CancelButton.ModalResult := mrCancel;
CancelButton.Cancel := True;
FeedbackMemo := TMemo.Create(Form);
FeedbackMemo.Parent := Form;
FeedbackMemo.Width := Form.ClientWidth - ScaleX(30 + 20);
FeedbackMemo.Height := ScaleY(61);
FeedbackMemo.Left := ScaleX(30);
FeedbackMemo.Top := Form.ClientHeight - ScaleY(23 + 10 + 10) - FeedbackMemo.Height;
FeedbackLabel0 := TLabel.Create(Form);
FeedbackLabel0.Parent := Form;
FeedbackLabel0.AutoSize := False;
FeedbackLabel0.Left := ScaleX(30);
FeedbackLabel0.Top := ScaleY(10);
FeedbackLabel0.Width := Form.ClientWidth - ScaleX(30 + 20);
FeedbackLabel0.Height := ScaleY(42);
FeedbackLabel0.WordWrap := True;
FeedbackLabel0.Caption := 'We regret you have uninstalled EzDesign. ' +
'To help us with future versions of EzDesign, ' +
'we want to know about any troubles or difficulties ' +
'you have experienced while using EzDesign.';
FeedbackLabel1 := TLabel.Create(Form);
FeedbackLabel1.Parent := Form;
FeedbackLabel1.Left := ScaleX(30);
FeedbackLabel1.Top := ScaleY(10+42+10);
FeedbackLabel1.AutoSize := True;
FeedbackLabel1.Height := ScaleY(21);
FeedbackLabel1.Caption := 'Please let us know...';
FeedbackLabel1.FocusControl := FeedbackMemo;
Form.ActiveControl := FeedbackMemo;
if Form.ShowModal() = mrOk then
begin
Feedback := Trim(FeedbackMemo.Lines.Text);
if Feedback <> '' then
begin
StringChange(Feedback, '&', '%26');
StringChange(Feedback, #13#10, '%0A');
StringChange(Feedback, #13, '%0A');
StringChange(Feedback, #10, '%0D');
Url := 'mailto:user@gmail.com?Subject=' +
'EzDesign%20Uninstall&' + 'Body=' + Feedback;
ShellExec('open', Url, '', '', SW_SHOW, ewNoWait, ErrorCode);
end;
end;
finally
Form.Free();
end;
end;
//Appeler les fonction de la UninstallEzDesign durant la désinstallation
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
WindowNumber: HWND;
var
RegDir: String;
begin
if CurUninstallStep = usUninstall then
begin
UninstallEzDesign();
end;
end; |
Partager