| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- unit Setup.UninstallSharedFileForm;
- {
- Inno Setup
- Copyright (C) 1997-2025 Jordan Russell
- Portions by Martijn Laan
- For conditions of distribution and use, see LICENSE.TXT.
- "Remove Shared File" form
- }
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- Setup.SetupForm, StdCtrls, NewStaticText, NewCtrls;
- type
- TUninstallSharedFileForm = class(TSetupForm)
- BodyLabel: TNewStaticText;
- FilenameLabel: TNewStaticText;
- FilenameEdit: TEdit;
- LocationLabel: TNewStaticText;
- LocationEdit: TEdit;
- YesButton: TNewButton;
- YesToAllButton: TNewButton;
- NoButton: TNewButton;
- NoToAllButton: TNewButton;
- protected
- procedure CreateParams(var Params: TCreateParams); override;
- public
- constructor Create(AOwner: TComponent); override;
- end;
- function ExecuteRemoveSharedFileDlg(const Filename: String;
- var AAll: Boolean): Boolean;
- implementation
- uses
- PathFunc, Shared.Struct, SetupLdrAndSetup.Messages, Shared.SetupMessageIDs, Setup.MainForm;
- {$R *.DFM}
- function ExecuteRemoveSharedFileDlg(const Filename: String;
- var AAll: Boolean): Boolean;
- var
- Form: TUninstallSharedFileForm;
- Res: Integer;
- begin
- Form := TUninstallSharedFileForm.Create(nil);
- try
- Form.FilenameEdit.Text := PathExtractName(Filename);
- Form.LocationEdit.Text := PathExtractDir(Filename);
- Res := Form.ShowModal;
- finally
- Form.Free;
- end;
- Result := (Res = mrYes) or (Res = mrYesToAll);
- AAll := (Res = mrYesToAll) or (Res = mrNoToAll);
- end;
- { TUninstallSharedFileForm }
- constructor TUninstallSharedFileForm.Create(AOwner: TComponent);
- begin
- inherited;
- InitializeFont(False, True);
- Caption := SetupMessages[msgConfirmDeleteSharedFileTitle];
- BodyLabel.Caption := SetupMessages[msgConfirmDeleteSharedFile2];
- FilenameLabel.Caption := SetupMessages[msgSharedFileNameLabel];
- LocationLabel.Caption := SetupMessages[msgSharedFileLocationLabel];
- YesButton.Caption := SetupMessages[msgButtonYes];
- YesToAllButton.Caption := SetupMessages[msgButtonYesToAll];
- NoButton.Caption := SetupMessages[msgButtonNo];
- NoToAllButton.Caption := SetupMessages[msgButtonNoToAll];
- end;
- procedure TUninstallSharedFileForm.CreateParams(var Params: TCreateParams);
- begin
- inherited;
- Params.WindowClass.style := Params.WindowClass.style or CS_NOCLOSE;
- end;
- end.
|