rmmagent/build/setup-x86.iss

97 lines
4.0 KiB
Plaintext
Raw Normal View History

2020-10-15 03:34:41 +00:00
#define MyAppName "Tactical RMM Agent"
2021-01-17 05:34:47 +00:00
#define MyAppVersion "1.2.1"
2020-10-15 03:34:41 +00:00
#define MyAppPublisher "Tactical Techs"
#define MyAppURL "https://github.com/wh1te909"
#define MyAppExeName "tacticalrmm.exe"
#define NSSM "nssm-x86.exe"
#define MESHEXE "meshagent-x86.exe"
#define SALTUNINSTALL "{sd}\salt\uninst.exe"
#define SALTDIR "{sd}\salt"
#define MESHDIR "{sd}\Program Files\Mesh Agent"
[Setup]
AppId={{0D34D278-5FAF-4159-A4A0-4E2D2C08139D}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName="{sd}\Program Files\TacticalAgent"
DisableDirPage=yes
2020-12-07 08:25:17 +00:00
SetupLogging=yes
2020-10-15 03:34:41 +00:00
DisableProgramGroupPage=yes
OutputBaseFilename=winagent-v{#MyAppVersion}-x86
SetupIconFile=C:\Users\Public\Documents\rmmagent\build\onit.ico
WizardSmallImageFile=C:\Users\Public\Documents\rmmagent\build\onit.bmp
UninstallDisplayIcon={app}\{#MyAppExeName}
Compression=lzma
SolidCompression=yes
WizardStyle=modern
2020-12-10 10:09:21 +00:00
RestartApplications=no
2020-10-15 03:34:41 +00:00
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\Users\Public\Documents\rmmagent\tacticalrmm.exe"; DestDir: "{app}"; Flags: ignoreversion;
2020-10-15 03:34:41 +00:00
Source: "C:\Users\Public\Documents\rmmagent\build\nssm-x86.exe"; DestDir: "{app}"; Flags: ignoreversion;
2020-12-10 10:09:21 +00:00
Source: "C:\Users\Public\Documents\rmmagent\build\saltcustom"; DestDir: "{app}"; Flags: ignoreversion;
2020-10-15 03:34:41 +00:00
[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent runascurrentuser
[UninstallRun]
Filename: "{app}\{#NSSM}"; Parameters: "stop tacticalagent"; RunOnceId: "stoptacagent";
Filename: "{app}\{#NSSM}"; Parameters: "remove tacticalagent confirm"; RunOnceId: "removetacagent";
Filename: "{app}\{#NSSM}"; Parameters: "stop checkrunner"; RunOnceId: "stopcheckrun";
Filename: "{app}\{#NSSM}"; Parameters: "remove checkrunner confirm"; RunOnceId: "removecheckrun";
2020-11-22 02:22:31 +00:00
Filename: "{app}\{#NSSM}"; Parameters: "stop tacticalrpc"; RunOnceId: "stoptacrpc";
Filename: "{app}\{#NSSM}"; Parameters: "remove tacticalrpc confirm"; RunOnceId: "removetacrpc";
2020-10-15 21:51:15 +00:00
Filename: "{app}\{#MyAppExeName}"; Parameters: "-m cleanup"; RunOnceId: "cleanuprm";
2020-10-24 05:26:50 +00:00
Filename: "{cmd}"; Parameters: "/c taskkill /F /IM tacticalrmm.exe"; RunOnceId: "killtacrmm";
2020-10-15 03:34:41 +00:00
Filename: "{#SALTUNINSTALL}"; Parameters: "/S"; RunOnceId: "saltrm";
Filename: "{app}\{#MESHEXE}"; Parameters: "-fulluninstall"; RunOnceId: "meshrm";
[UninstallDelete]
Type: filesandordirs; Name: "{app}";
Type: filesandordirs; Name: "{#SALTDIR}";
Type: filesandordirs; Name: "{#MESHDIR}";
[Code]
function InitializeSetup(): boolean;
2020-10-15 03:34:41 +00:00
var
ResultCode: Integer;
begin
2020-12-09 04:55:02 +00:00
Exec('cmd.exe', '/c net stop tacticalagent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
2020-12-07 08:25:17 +00:00
Log('Stop tacticalagent: ' + IntToStr(ResultCode));
2020-12-09 04:55:02 +00:00
Exec('cmd.exe', '/c net stop checkrunner', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
2020-12-07 08:25:17 +00:00
Log('Stop checkrunner: ' + IntToStr(ResultCode));
2021-01-02 07:28:45 +00:00
Exec('cmd.exe', '/c net stop tacticalrpc', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
2020-12-07 08:25:17 +00:00
Log('Stop tacticalrpc: ' + IntToStr(ResultCode));
2021-01-02 07:28:45 +00:00
Exec('cmd.exe', '/c taskkill /F /IM tacticalrmm.exe', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
2020-12-07 08:25:17 +00:00
Log('taskkill: ' + IntToStr(ResultCode));
Result := True;
2020-10-15 03:34:41 +00:00
end;
2020-12-10 10:19:06 +00:00
procedure DeinitializeSetup();
2020-10-15 03:34:41 +00:00
var
ResultCode: Integer;
begin
2020-12-09 04:55:02 +00:00
Exec('cmd.exe', '/c net start tacticalagent && ping 127.0.0.1 -n 3', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
2020-12-07 08:25:17 +00:00
Log('Start tacticalagent: ' + IntToStr(ResultCode));
2020-12-09 04:55:02 +00:00
Exec('cmd.exe', '/c net start checkrunner', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
2020-12-07 08:25:17 +00:00
Log('Start checkrunner: ' + IntToStr(ResultCode));
2020-11-22 02:22:31 +00:00
Exec('cmd.exe', '/c net start tacticalrpc', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
2020-12-07 08:25:17 +00:00
Log('Start tacticalrpc: ' + IntToStr(ResultCode));
2020-10-15 03:34:41 +00:00
end;