Setup.UninstallSharedFileForm.pas 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. unit Setup.UninstallSharedFileForm;
  2. {
  3. Inno Setup
  4. Copyright (C) 1997-2004 Jordan Russell
  5. Portions by Martijn Laan
  6. For conditions of distribution and use, see LICENSE.TXT.
  7. "Remove Shared File" form
  8. }
  9. interface
  10. uses
  11. Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  12. Setup.SetupForm, StdCtrls, NewStaticText, BidiCtrls;
  13. type
  14. TUninstSharedFileForm = class(TSetupForm)
  15. BodyLabel: TNewStaticText;
  16. FilenameLabel: TNewStaticText;
  17. FilenameEdit: TEdit;
  18. LocationLabel: TNewStaticText;
  19. LocationEdit: TEdit;
  20. YesButton: TNewButton;
  21. YesToAllButton: TNewButton;
  22. NoButton: TNewButton;
  23. NoToAllButton: TNewButton;
  24. private
  25. { Private declarations }
  26. protected
  27. procedure CreateParams(var Params: TCreateParams); override;
  28. public
  29. { Public declarations }
  30. constructor Create(AOwner: TComponent); override;
  31. end;
  32. function ExecuteRemoveSharedFileDlg(const Filename: String;
  33. var AAll: Boolean): Boolean;
  34. implementation
  35. uses
  36. PathFunc, Shared.Struct, SetupLdrAndSetup.Messages, Shared.SetupMessageIDs, Setup.MainForm;
  37. {$R *.DFM}
  38. function ExecuteRemoveSharedFileDlg(const Filename: String;
  39. var AAll: Boolean): Boolean;
  40. var
  41. Form: TUninstSharedFileForm;
  42. Res: Integer;
  43. begin
  44. Form := TUninstSharedFileForm.Create(nil);
  45. try
  46. Form.FilenameEdit.Text := PathExtractName(Filename);
  47. Form.LocationEdit.Text := PathExtractDir(Filename);
  48. Res := Form.ShowModal;
  49. finally
  50. Form.Free;
  51. end;
  52. Result := (Res = mrYes) or (Res = mrYesToAll);
  53. AAll := (Res = mrYesToAll) or (Res = mrNoToAll);
  54. end;
  55. { TSelectLanguageForm }
  56. constructor TUninstSharedFileForm.Create(AOwner: TComponent);
  57. begin
  58. inherited;
  59. InitializeFont;
  60. Caption := SetupMessages[msgConfirmDeleteSharedFileTitle];
  61. BodyLabel.Caption := SetupMessages[msgConfirmDeleteSharedFile2];
  62. FilenameLabel.Caption := SetupMessages[msgSharedFileNameLabel];
  63. LocationLabel.Caption := SetupMessages[msgSharedFileLocationLabel];
  64. YesButton.Caption := SetupMessages[msgButtonYes];
  65. YesToAllButton.Caption := SetupMessages[msgButtonYesToAll];
  66. NoButton.Caption := SetupMessages[msgButtonNo];
  67. NoToAllButton.Caption := SetupMessages[msgButtonNoToAll];
  68. KeepSizeY := True;
  69. end;
  70. procedure TUninstSharedFileForm.CreateParams(var Params: TCreateParams);
  71. begin
  72. inherited;
  73. Params.WindowClass.style := Params.WindowClass.style or CS_NOCLOSE;
  74. end;
  75. end.