123 lines
4.6 KiB
Plaintext
123 lines
4.6 KiB
Plaintext
[Setup]
|
|
AppName=LOGAR Client
|
|
AppVersion=0.3.2
|
|
AppPublisher=LOGAR Security Systems
|
|
AppPublisherURL=https://logar.eibl.tech
|
|
AppSupportURL=https://logar.eibl.tech
|
|
AppUpdatesURL=https://logar.eibl.tech
|
|
DefaultDirName={autopf}\LOGAR
|
|
OutputDir=..\dist
|
|
OutputBaseFilename=LOGAR-Client-Setup
|
|
PrivilegesRequired=admin
|
|
Compression=lzma
|
|
SolidCompression=yes
|
|
WizardStyle=modern
|
|
VersionInfoCompany=LOGAR Security Systems
|
|
VersionInfoDescription=LOGAR Windows Edge Log Forwarder Setup
|
|
VersionInfoVersion=0.3.2.0
|
|
VersionInfoProductName=LOGAR Client
|
|
VersionInfoProductVersion=0.3.2
|
|
|
|
[Files]
|
|
Source: "..\dist\Win_Client.exe"; DestDir: "{app}"; Flags: ignoreversion
|
|
Source: "..\compilation\nssm.exe"; DestDir: "{app}"; Flags: ignoreversion
|
|
Source: "..\dist\runtime\*"; DestDir: "{app}\runtime"; Flags: ignoreversion recursesubdirs createallsubdirs
|
|
|
|
[Dirs]
|
|
Name: "{code:GetDataDir}"; Permissions: users-modify
|
|
|
|
[Run]
|
|
Filename: "{app}\nssm.exe"; Parameters: "install LOGAR_Client ""{app}\Win_Client.exe"""; Flags: runhidden
|
|
Filename: "{app}\nssm.exe"; Parameters: "set LOGAR_Client AppDirectory ""{app}"""; Flags: runhidden
|
|
Filename: "{app}\nssm.exe"; Parameters: "set LOGAR_Client AppStdout ""{code:GetDataDir}\client.log"""; Flags: runhidden
|
|
Filename: "{app}\nssm.exe"; Parameters: "set LOGAR_Client AppStderr ""{code:GetDataDir}\client_err.log"""; Flags: runhidden
|
|
Filename: "{app}\nssm.exe"; Parameters: "set LOGAR_Client AppParameters ""--config """"{code:GetDataDir}\client_config.json"""""""; Flags: runhidden
|
|
Filename: "{app}\nssm.exe"; Parameters: "start LOGAR_Client"; Flags: runhidden
|
|
|
|
[UninstallRun]
|
|
Filename: "{app}\nssm.exe"; Parameters: "stop LOGAR_Client"; Flags: runhidden
|
|
Filename: "{app}\nssm.exe"; Parameters: "remove LOGAR_Client confirm"; Flags: runhidden
|
|
|
|
[UninstallDelete]
|
|
Type: filesandordirs; Name: "{app}\certs"
|
|
Type: files; Name: "{app}\client_config.json"
|
|
Type: files; Name: "{app}\client_state.json"
|
|
Type: files; Name: "{app}\*.log"
|
|
Type: filesandordirs; Name: "{app}\runtime"
|
|
Type: filesandordirs; Name: "{app}"
|
|
Type: filesandordirs; Name: "{commonappdata}\LOGAR"
|
|
|
|
[Code]
|
|
var
|
|
DataDirPage: TInputDirWizardPage;
|
|
ConfigFilePage: TInputFileWizardPage;
|
|
|
|
procedure InitializeWizard;
|
|
begin
|
|
DataDirPage := CreateInputDirPage(
|
|
wpSelectDir,
|
|
'Data and Configuration Location',
|
|
'Where should LOGAR Client store its state tracking and certificates?',
|
|
'Select the folder where LOGAR Client should store state tracking (client_state.json), configuration (client_config.json), and mTLS certificates.'#13#10#13#10 +
|
|
'By default, this is stored in Common AppData (C:\ProgramData\LOGAR), which is accessible to background Windows services.',
|
|
False,
|
|
''
|
|
);
|
|
DataDirPage.Add('Data Directory:');
|
|
DataDirPage.Values[0] := ExpandConstant('{commonappdata}\LOGAR');
|
|
|
|
ConfigFilePage := CreateInputFilePage(
|
|
DataDirPage.ID,
|
|
'Import Client Configuration (Optional)',
|
|
'Do you have a pre-exported client_config.json profile to import?',
|
|
'Select your client_config.json profile exported from the LOGAR Server Hub.'#13#10#13#10 +
|
|
'If selected, this configuration will be copied into the data directory and used for automated server connection and enrollment.'#13#10#13#10 +
|
|
'You can also leave this blank to place client_config.json in the data directory manually later.'
|
|
);
|
|
ConfigFilePage.Add('Client Configuration (client_config.json):', 'JSON Files (*.json)|*.json|All Files (*.*)|*.*', '.json');
|
|
end;
|
|
|
|
function GetDataDir(Param: String): String;
|
|
begin
|
|
Result := DataDirPage.Values[0];
|
|
if Result = '' then
|
|
Result := ExpandConstant('{commonappdata}\LOGAR');
|
|
end;
|
|
|
|
function GetConfigFile(Param: String): String;
|
|
begin
|
|
Result := ConfigFilePage.Values[0];
|
|
end;
|
|
|
|
procedure CurStepChanged(CurStep: TSetupStep);
|
|
var
|
|
CfgPath, DestCfg: String;
|
|
begin
|
|
if CurStep = ssPostInstall then
|
|
begin
|
|
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\LOGAR\LOGAR-Client', 'DataDir', GetDataDir(''));
|
|
|
|
CfgPath := GetConfigFile('');
|
|
if (CfgPath <> '') and FileExists(CfgPath) then
|
|
begin
|
|
DestCfg := GetDataDir('') + '\client_config.json';
|
|
FileCopy(CfgPath, DestCfg, False);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
|
|
var
|
|
CustomDataDir: String;
|
|
begin
|
|
if CurUninstallStep = usPostUninstall then
|
|
begin
|
|
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\LOGAR\LOGAR-Client', 'DataDir', CustomDataDir) then
|
|
begin
|
|
if (CustomDataDir <> '') and DirExists(CustomDataDir) then
|
|
DelTree(CustomDataDir, True, True, True);
|
|
RegDeleteKeyIncludingSubkeys(HKEY_LOCAL_MACHINE, 'Software\LOGAR\LOGAR-Client');
|
|
end;
|
|
end;
|
|
end;
|