[setup] fixed silent install mode and added cli option to choose components
Dieser Commit ist enthalten in:
Ursprung
0973e96bf0
Commit
62cf04eb02
@ -116,6 +116,7 @@ const
|
|||||||
ComponentsValueName = 'Components';
|
ComponentsValueName = 'Components';
|
||||||
var
|
var
|
||||||
ComponentsPage : TWizardPage;
|
ComponentsPage : TWizardPage;
|
||||||
|
ComponentsCLI : string;
|
||||||
ClientAndServerRadioButton : TRadioButton;
|
ClientAndServerRadioButton : TRadioButton;
|
||||||
ClientOnlyRadioButton : TRadioButton;
|
ClientOnlyRadioButton : TRadioButton;
|
||||||
|
|
||||||
@ -131,12 +132,12 @@ end;
|
|||||||
|
|
||||||
procedure RegWriteTraintasticComponents(Value: String);
|
procedure RegWriteTraintasticComponents(Value: String);
|
||||||
begin
|
begin
|
||||||
RegWriteStringValue(HKEY_LOCAL_MACHINE, '{#AppSubKey}', ComponentsValueName, Value);
|
RegWriteStringValue(HKEY_LOCAL_MACHINE, ExpandConstant('{#AppSubKey}'), ComponentsValueName, Value);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function RegReadTraintasticComponents: String;
|
function RegReadTraintasticComponents: String;
|
||||||
begin
|
begin
|
||||||
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, '{#AppSubKey}', ComponentsValueName, Result) then
|
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, ExpandConstant('{#AppSubKey}'), ComponentsValueName, Result) then
|
||||||
Result := '';
|
Result := '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -167,13 +168,40 @@ begin
|
|||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function InitializeSetup: Boolean;
|
||||||
|
var
|
||||||
|
I: Integer;
|
||||||
|
Param: string;
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
|
||||||
|
for I := 1 to ParamCount do begin
|
||||||
|
Param := ParamStr(I);
|
||||||
|
if CompareText(Copy(Param, 1, 12), '/Components=') = 0 then begin
|
||||||
|
ComponentsCLI := Copy(Param, 13, MaxInt);
|
||||||
|
if (ComponentsCLI <> 'ClientAndServer') and (ComponentsCLI <> 'ClientOnly') then begin
|
||||||
|
Log('Invalid /Components value: ' + ComponentsCLI)
|
||||||
|
Result := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure InitializeWizard;
|
procedure InitializeWizard;
|
||||||
var
|
var
|
||||||
Lbl: TLabel;
|
Lbl: TLabel;
|
||||||
Components: String;
|
Components: String;
|
||||||
begin
|
begin
|
||||||
Components := RegReadTraintasticComponents;
|
if ComponentsCLI <> '' then
|
||||||
|
Components := ComponentsCLI // override from CLI
|
||||||
|
else
|
||||||
|
Components := RegReadTraintasticComponents;
|
||||||
|
|
||||||
|
if (Components = '') and WizardSilent then begin
|
||||||
|
Log('Silent install without known Components value, defaulting to: ClientAndServer');
|
||||||
|
Components := 'ClientAndServer';
|
||||||
|
end;
|
||||||
|
|
||||||
ComponentsPage := CreateCustomPage(wpSelectComponents, SetupMessage(msgWizardSelectComponents), SetupMessage(msgSelectComponentsDesc));
|
ComponentsPage := CreateCustomPage(wpSelectComponents, SetupMessage(msgWizardSelectComponents), SetupMessage(msgSelectComponentsDesc));
|
||||||
|
|
||||||
ClientAndServerRadioButton := TNewRadioButton.Create(ComponentsPage);
|
ClientAndServerRadioButton := TNewRadioButton.Create(ComponentsPage);
|
||||||
|
|||||||
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren