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
|
unction Uninstall(): 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. ' +
'To help us with future versions, ' +
'we want to know about any troubles or difficulties ' +
'you have experienced while using.';
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:frifai@novadecision.com?Subject=' +
'PRODUIT%20Uninstall&Body=' + Feedback;
ShellExec('open', Url, '', '', SW_SHOW, ewNoWait, ErrorCode);
end;
end;
finally
Form.Free();
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
WindowNumber: HWND;
var
RegDir: String;
begin
if CurUninstallStep = usUninstall then
begin
Uninstall();
end;
end; |
Partager