-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmTadata.iss
More file actions
118 lines (98 loc) · 4.3 KB
/
Copy pathmTadata.iss
File metadata and controls
118 lines (98 loc) · 4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
; Non-commercial use only.
#define MyAppName "mTadata Agent"
#define MyAppVersion "1.0"
#define MyAppPublisher "oRyanPS, Inc."
#define MyAppURL "https://oryanps.com.br/"
#define MyAppExeName "m-tadata-agent.exe"
#define DoubleAmp(Value) StringChange(Value, "&", "&&")
#define EscapeConstArgument(Value) StringChange(StringChange(StringChange(Value, "%", "%25"), ",", "%2c"), "}", "%7d")
[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{554096AC-2530-47D9-B0B5-7E49FBF0738E}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={cm:NameAndVersion,{#EscapeConstArgument(MyAppName)},{#EscapeConstArgument(MyAppVersion)}}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DisableDirPage=yes
UninstallDisplayIcon={app}\{#MyAppExeName}
; "ArchitecturesAllowed=x64compatible" specifies that Setup cannot run on anything but x64 and Windows 11 on Arm.
ArchitecturesAllowed=x64compatible
; "ArchitecturesInstallIn64BitMode=x64compatible" requests that the install be done in "64-bit mode" on x64 or Windows 11 on Arm.
; This means it should use the native 64-bit Program Files directory and the 64-bit view of the registry.
ArchitecturesInstallIn64BitMode=x64compatible
; Uncomment the following line to use a 64-bit installer.
;SetupArchitecture=x64
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=E:\Arquivos\Workspace\TelemetryAgent\license.txt
; Uncomment the following line to run in non administrative install mode (install for current user only).
;PrivilegesRequired=lowest
OutputBaseFilename=mTadataAgent
SetupIconFile=E:\Arquivos\Workspace\mtadata\public\assets\favicon\favicon.ico
SolidCompression=yes
WizardStyle=modern dynamic
[Languages]
Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
[Files]
Source: "E:\Arquivos\Workspace\TelemetryAgent\\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\Arquivos\Workspace\TelemetryAgent\build\libs\TelemetryAgent.jar"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\Arquivos\Workspace\TelemetryAgent\m-tadata-agent.xml"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files.
[Code]
var
AgentPage: TInputQueryWizardPage;
AgentIdEdit: TNewEdit;
ApiUrlEdit: TNewEdit;
procedure InitializeWizard;
begin
AgentPage := CreateInputQueryPage(
wpWelcome,
'Configuração do mTadata Agent',
'Configure o agente',
'Informe os dados utilizados para conectar este computador ao servidor.'
);
AgentPage.Add('Agent ID:', False);
AgentPage.Add('API URL:', False);
AgentPage.Values[0] := 'PC-001';
AgentPage.Values[1] := 'https://mtadata.com.br/api';
end;
procedure CreateConfigFile();
var
ConfigDir: string;
ConfigFile: string;
ConfigContent: string;
begin
ConfigDir := ExpandConstant('{commonappdata}\mTadata Agent');
ConfigFile := ConfigDir + '\config.json';
ForceDirectories(ConfigDir);
ConfigContent :=
'{' + #13#10 +
' "agentId": "' + AgentPage.Values[0] + '",' + #13#10 +
' "apiUrl": "' + AgentPage.Values[1] + '",' + #13#10 +
' "telemetryInterval": 0' + #13#10 +
'}';
SaveStringToFile(ConfigFile, ConfigContent, False);
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
begin
CreateConfigFile();
end;
end;
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
[Run]
Filename: "{app}\{#MyAppExeName}"; Parameters: "install"; Description: "{cm:LaunchProgram,{#DoubleAmp(MyAppName)}}"; Flags: nowait postinstall skipifsilent
Filename: "{app}\{#MyAppExeName}"; Parameters: "start"; Description: "{cm:LaunchProgram,{#DoubleAmp(MyAppName)}}"; Flags: nowait postinstall skipifsilent
[UninstallRun]
Filename: "{app}\m-tadata-agent.exe"; Parameters: "stop"; Flags: runhidden waituntilterminated
Filename: "{app}\m-tadata-agent.exe"; Parameters: "uninstall"; Flags: runhidden waituntilterminated