Setup.UninstallSharedFileForm.pas 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. unit Setup.UninstallSharedFileForm;
  2. {
  3. Inno Setup
  4. Copyright (C) 1997-2025 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. protected
  25. procedure CreateParams(var Params: TCreateParams); override;
  26. public
  27. constructor Create(AOwner: TComponent); override;
  28. end;
  29. function ExecuteRemoveSharedFileDlg(const Filename: String;
  30. var AAll: Boolean): Boolean;
  31. implementation
  32. uses
  33. PathFunc, Shared.Struct, SetupLdrAndSetup.Messages, Shared.SetupMessageIDs, Setup.MainForm;
  34. {$R *.DFM}
  35. function ExecuteRemoveSharedFileDlg(const Filename: String;
  36. var AAll: Boolean): Boolean;
  37. var
  38. Form: TUninstSharedFileForm;
  39. Res: Integer;
  40. begin
  41. Form := TUninstSharedFileForm.Create(nil);
  42. try
  43. Form.FilenameEdit.Text := PathExtractName(Filename);
  44. Form.LocationEdit.Text := PathExtractDir(Filename);
  45. Res := Form.ShowModal;
  46. finally
  47. Form.Free;
  48. end;
  49. Result := (Res = mrYes) or (Res = mrYesToAll);
  50. AAll := (Res = mrYesToAll) or (Res = mrNoToAll);
  51. end;
  52. { TSelectLanguageForm }
  53. constructor TUninstSharedFileForm.Create(AOwner: TComponent);
  54. begin
  55. inherited;
  56. InitializeFont;
  57. Caption := SetupMessages[msgConfirmDeleteSharedFileTitle];
  58. BodyLabel.Caption := SetupMessages[msgConfirmDeleteSharedFile2];
  59. FilenameLabel.Caption := SetupMessages[msgSharedFileNameLabel];
  60. LocationLabel.Caption := SetupMessages[msgSharedFileLocationLabel];
  61. YesButton.Caption := SetupMessages[msgButtonYes];
  62. YesToAllButton.Caption := SetupMessages[msgButtonYesToAll];
  63. NoButton.Caption := SetupMessages[msgButtonNo];
  64. NoToAllButton.Caption := SetupMessages[msgButtonNoToAll];
  65. KeepSizeY := True;
  66. end;
  67. procedure TUninstSharedFileForm.CreateParams(var Params: TCreateParams);
  68. begin
  69. inherited;
  70. Params.WindowClass.style := Params.WindowClass.style or CS_NOCLOSE;
  71. end;
  72. end.