2024-08-04 10:25:42 +02:00
|
|
|
unit IDE.RegistryDesignerForm;
|
2024-04-01 15:24:26 +02:00
|
|
|
|
2024-04-02 17:23:14 +02:00
|
|
|
{
|
|
|
|
Inno Setup
|
|
|
|
Copyright (C) 1997-2024 Jordan Russell
|
|
|
|
Portions by Martijn Laan
|
|
|
|
For conditions of distribution and use, see LICENSE.TXT.
|
|
|
|
|
|
|
|
Registry Designer form
|
|
|
|
|
|
|
|
Originally contributed by leserg73
|
|
|
|
}
|
|
|
|
|
2024-04-01 15:24:26 +02:00
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
2024-04-10 21:40:53 +02:00
|
|
|
SysUtils, Classes,
|
|
|
|
Forms, Controls, StdCtrls, ExtCtrls,
|
2024-08-04 10:25:42 +02:00
|
|
|
IDE.Wizard.WizardFormRegistryHelper, NewStaticText;
|
2024-04-01 15:24:26 +02:00
|
|
|
|
|
|
|
type
|
|
|
|
TRegistryDesignerForm = class(TForm)
|
2024-04-10 18:07:01 +02:00
|
|
|
Panel1: TPanel;
|
2024-04-01 15:24:26 +02:00
|
|
|
Bevel1: TBevel;
|
2024-04-10 18:07:01 +02:00
|
|
|
InsertButton: TButton;
|
|
|
|
CancelButton: TButton;
|
2024-04-10 08:40:40 +02:00
|
|
|
AppRegistryFileLabel: TNewStaticText;
|
|
|
|
AppRegistryFileEdit: TEdit;
|
|
|
|
AppRegistryFileButton: TButton;
|
2024-04-11 08:52:41 +02:00
|
|
|
AppRegistrySettingsLabel: TNewStaticText;
|
2024-04-10 21:40:53 +02:00
|
|
|
AppRegistryUninsDeleteKeyCheck: TCheckBox;
|
2024-04-11 08:52:41 +02:00
|
|
|
AppRegistryUninsDeleteKeyIfEmptyCheck: TCheckBox;
|
2024-04-10 21:40:53 +02:00
|
|
|
AppRegistryUninsDeleteValueCheck: TCheckBox;
|
|
|
|
AppRegistryMinVerCheck: TCheckBox;
|
|
|
|
AppRegistryMinVerEdit: TEdit;
|
2024-04-11 08:52:41 +02:00
|
|
|
PrivilegesRequiredLabel: TNewStaticText;
|
2024-04-27 16:38:08 +02:00
|
|
|
AppRegistryMinVerDocImage: TImage;
|
2024-04-10 18:07:01 +02:00
|
|
|
procedure InsertButtonClick(Sender: TObject);
|
2024-04-05 15:22:15 +02:00
|
|
|
procedure FormCreate(Sender: TObject);
|
2024-04-10 08:40:40 +02:00
|
|
|
procedure FormDestroy(Sender: TObject);
|
2024-04-01 15:24:26 +02:00
|
|
|
private
|
2024-04-10 08:40:40 +02:00
|
|
|
FRegistryHelper: TWizardFormRegistryHelper;
|
2024-04-11 08:52:41 +02:00
|
|
|
procedure SetPrivilegesRequired(const Value: TPrivilegesRequired);
|
2024-04-01 15:24:26 +02:00
|
|
|
function GetText: String;
|
|
|
|
public
|
2024-04-11 08:52:41 +02:00
|
|
|
property PrivilegesRequired: TPrivilegesRequired write SetPrivilegesRequired;
|
2024-04-01 15:24:26 +02:00
|
|
|
property Text: string read GetText;
|
|
|
|
end;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
2024-04-11 08:52:41 +02:00
|
|
|
uses
|
2024-08-04 21:33:48 +02:00
|
|
|
IDE.HelperFunc;
|
2024-04-11 08:52:41 +02:00
|
|
|
|
|
|
|
procedure TRegistryDesignerForm.SetPrivilegesRequired(
|
|
|
|
const Value: TPrivilegesRequired);
|
2024-04-05 10:56:15 +02:00
|
|
|
begin
|
2024-04-10 21:40:53 +02:00
|
|
|
if Value = prAdmin then
|
2024-04-11 08:52:41 +02:00
|
|
|
PrivilegesRequiredLabel.Caption := 'Script has PrivilegesRequired=admin'
|
2024-04-10 21:40:53 +02:00
|
|
|
else if Value = prLowest then
|
2024-04-11 08:52:41 +02:00
|
|
|
PrivilegesRequiredLabel.Caption := 'Script has PrivilegesRequired=lowest'
|
2024-04-05 10:56:15 +02:00
|
|
|
else
|
2024-04-11 08:52:41 +02:00
|
|
|
PrivilegesRequiredLabel.Caption := 'Script has PrivilegesRequiredOverridesAllowed set';
|
2024-04-19 22:43:25 +02:00
|
|
|
FRegistryHelper.PrivilegesRequired := Value;
|
2024-04-05 10:56:15 +02:00
|
|
|
end;
|
|
|
|
|
2024-04-10 18:07:01 +02:00
|
|
|
procedure TRegistryDesignerForm.FormCreate(Sender: TObject);
|
|
|
|
begin
|
2024-04-11 08:52:41 +02:00
|
|
|
InitFormFont(Self);
|
|
|
|
|
2024-04-10 21:40:53 +02:00
|
|
|
FRegistryHelper := TWizardFormRegistryHelper.Create(Self, AppRegistryFileEdit,
|
|
|
|
AppRegistryFileButton, AppRegistryUninsDeleteKeyCheck,
|
2024-04-11 08:52:41 +02:00
|
|
|
AppRegistryUninsDeleteKeyIfEmptyCheck, AppRegistryUninsDeleteValueCheck,
|
2024-04-27 16:38:08 +02:00
|
|
|
AppRegistryMinVerCheck, AppRegistryMinVerEdit, AppRegistryMinVerDocImage);
|
2024-04-10 18:07:01 +02:00
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TRegistryDesignerForm.FormDestroy(Sender: TObject);
|
|
|
|
begin
|
|
|
|
FRegistryHelper.Free;
|
|
|
|
end;
|
|
|
|
|
2024-04-01 15:24:26 +02:00
|
|
|
function TRegistryDesignerForm.GetText: String;
|
|
|
|
begin
|
2024-04-10 21:40:53 +02:00
|
|
|
Result := '';
|
2024-04-11 09:07:27 +02:00
|
|
|
FRegistryHelper.AddScript(Result, True);
|
2024-04-01 15:24:26 +02:00
|
|
|
end;
|
|
|
|
|
2024-04-10 18:07:01 +02:00
|
|
|
procedure TRegistryDesignerForm.InsertButtonClick(Sender: TObject);
|
2024-04-01 15:24:26 +02:00
|
|
|
begin
|
2024-04-10 08:40:40 +02:00
|
|
|
if not FileExists(AppRegistryFileEdit.Text) then
|
2024-04-02 17:35:54 +02:00
|
|
|
ModalResult := mrCancel;
|
2024-04-01 15:24:26 +02:00
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|