2021-07-01 17:26:15 +00:00
|
|
|
#define Name "Status"
|
|
|
|
#define Publisher "Status.im"
|
2023-06-08 15:56:18 +00:00
|
|
|
#define URL "https://status.app"
|
2021-07-01 17:26:15 +00:00
|
|
|
#define ExeName "Status.exe"
|
2021-07-16 10:19:54 +00:00
|
|
|
#define IcoName "status.ico"
|
2021-07-01 17:26:15 +00:00
|
|
|
|
|
|
|
[Setup]
|
|
|
|
|
|
|
|
; Generated from Tools -> Generate GUID
|
|
|
|
AppId={{F3E2EDB6-78E8-4539-9C8B-A78F059D8647}}
|
|
|
|
|
|
|
|
AppName={#Name}
|
|
|
|
AppVersion={#Version}
|
|
|
|
AppPublisher={#Publisher}
|
|
|
|
AppPublisherURL={#URL}
|
|
|
|
AppSupportURL={#URL}
|
|
|
|
AppUpdatesURL={#URL}
|
2021-08-11 11:51:44 +00:00
|
|
|
DefaultDirName={localappdata}\{#Name}App
|
2021-07-16 10:19:54 +00:00
|
|
|
UsePreviousAppDir=no
|
2021-09-06 08:58:54 +00:00
|
|
|
PrivilegesRequired=admin
|
2021-07-15 11:12:18 +00:00
|
|
|
WizardStyle=modern
|
2021-07-16 10:19:54 +00:00
|
|
|
UninstallDisplayIcon={app}\{#ExeName}
|
2021-07-01 17:26:15 +00:00
|
|
|
DefaultGroupName={#Name}
|
2021-08-13 05:15:43 +00:00
|
|
|
CloseApplications=yes
|
2021-09-06 08:58:54 +00:00
|
|
|
ArchitecturesInstallIn64BitMode=x64
|
2021-07-01 17:26:15 +00:00
|
|
|
|
|
|
|
; output dir for installer
|
2021-07-15 11:12:18 +00:00
|
|
|
OutputBaseFileName={#BaseName}
|
2021-07-01 17:26:15 +00:00
|
|
|
|
|
|
|
; Icon file
|
2021-07-16 10:19:54 +00:00
|
|
|
SetupIconFile=resources\{#IcoName}
|
2021-07-01 17:26:15 +00:00
|
|
|
|
2021-08-10 12:53:56 +00:00
|
|
|
; Compression (default is lzma2/max)
|
2021-07-01 17:26:15 +00:00
|
|
|
SolidCompression=yes
|
|
|
|
|
2021-07-15 11:12:18 +00:00
|
|
|
[Languages]
|
|
|
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
|
|
|
Name: "it"; MessagesFile: "compiler:Languages\Italian.isl"
|
|
|
|
Name: "es"; MessagesFile: "compiler:Languages\Spanish.isl"
|
|
|
|
Name: "de"; MessagesFile: "compiler:Languages\German.isl"
|
|
|
|
Name: "nl"; MessagesFile: "compiler:Languages\Dutch.isl"
|
|
|
|
Name: "pt_BR"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
|
|
|
|
Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl"
|
|
|
|
Name: "fr"; MessagesFile: "compiler:Languages\French.isl"
|
|
|
|
Name: "ua"; MessagesFile: "compiler:Languages\Ukrainian.isl"
|
2021-07-01 17:26:15 +00:00
|
|
|
|
|
|
|
[Files]
|
|
|
|
|
|
|
|
; Path to exe on
|
2021-07-15 11:12:18 +00:00
|
|
|
Source: {#ExeName}; DestDir: "{app}"; Flags: ignoreversion
|
2021-07-01 17:26:15 +00:00
|
|
|
|
|
|
|
; Resources
|
2021-07-15 11:12:18 +00:00
|
|
|
Source: "bin\*"; DestDir: "{app}\bin"; Flags: ignoreversion recursesubdirs createallsubdirs
|
2021-07-01 17:26:15 +00:00
|
|
|
|
|
|
|
Source: "resources\*"; DestDir: "{app}\resources"; Flags: ignoreversion recursesubdirs createallsubdirs
|
|
|
|
|
|
|
|
Source: "vendor\*"; DestDir: "{app}\vendor"; Flags: ignoreversion recursesubdirs createallsubdirs
|
|
|
|
|
2021-07-16 10:19:54 +00:00
|
|
|
[Tasks]
|
2021-07-18 21:38:45 +00:00
|
|
|
Name: desktopicon; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:";
|
2021-07-16 10:19:54 +00:00
|
|
|
|
|
|
|
[Icons]
|
2021-08-13 05:15:43 +00:00
|
|
|
Name: "{group}\{#Name}"; Filename: "{app}\{#ExeName}"; WorkingDir: "{app}"
|
|
|
|
Name: "{group}\Uninstall {#Name}"; Filename: "{uninstallexe}"
|
2021-07-16 10:19:54 +00:00
|
|
|
Name: "{userdesktop}\{#Name}"; Filename: "{app}\{#ExeName}"; IconFilename: "{app}\resources\{#IcoName}"; Tasks: desktopicon
|
|
|
|
|
2021-08-10 12:53:56 +00:00
|
|
|
[Run]
|
2021-09-06 08:58:54 +00:00
|
|
|
Filename: "{app}\vendor\vc_redist.x64.exe"; Parameters: "/install /quiet /norestart"; StatusMsg: "Installing VS2017 redistributable package (64 Bit)";
|
2021-08-10 12:53:56 +00:00
|
|
|
Filename: "{app}\{#ExeName}"; Description: {cm:LaunchProgram,{#Name}}; Flags: nowait postinstall skipifsilent
|
|
|
|
|
2021-07-15 11:12:18 +00:00
|
|
|
[UninstallDelete]
|
|
|
|
Type: filesandordirs; Name: "{app}"
|
2021-07-16 10:19:54 +00:00
|
|
|
Type: files; Name: "{userdesktop}\{#Name}"
|
2021-08-10 12:53:56 +00:00
|
|
|
Type: files; Name: "{commondesktop}\{#Name}"
|
2021-07-19 11:15:44 +00:00
|
|
|
|
2021-07-01 17:26:15 +00:00
|
|
|
[Registry]
|
2023-05-23 17:33:34 +00:00
|
|
|
Root: HKCR; Subkey: "status-app"; ValueType: "string"; ValueData: "URL:status-app Protocol"; Flags: uninsdeletekey
|
|
|
|
Root: HKCR; Subkey: "status-app"; ValueType: "string"; ValueName: "URL Protocol"; ValueData: ""
|
|
|
|
Root: HKCR; Subkey: "status-app\DefaultIcon"; ValueType: "string"; ValueData: "{app}\Status.exe,1"
|
|
|
|
Root: HKCR; Subkey: "status-app\shell\open\command"; ValueType: "string"; ValueData: """{app}\bin\Status.exe"" ""--uri=%1"""
|
2021-07-19 11:15:44 +00:00
|
|
|
|
|
|
|
[Code]
|
2021-08-13 05:15:43 +00:00
|
|
|
function IsAppRunning(const FileName : string): Boolean;
|
|
|
|
var
|
|
|
|
FSWbemLocator: Variant;
|
|
|
|
FWMIService: Variant;
|
|
|
|
FWbemObjectSet: Variant;
|
|
|
|
begin
|
|
|
|
Result := false;
|
|
|
|
FSWbemLocator := CreateOleObject('WBEMScripting.SWBEMLocator');
|
|
|
|
FWMIService := FSWbemLocator.ConnectServer('', 'root\CIMV2', '', '');
|
|
|
|
FWbemObjectSet := FWMIService.ExecQuery(Format('SELECT Name FROM Win32_Process Where Name="%s"',[FileName]));
|
|
|
|
Result := (FWbemObjectSet.Count > 0);
|
|
|
|
FWbemObjectSet := Unassigned;
|
|
|
|
FWMIService := Unassigned;
|
|
|
|
FSWbemLocator := Unassigned;
|
|
|
|
end;
|
|
|
|
|
|
|
|
function InitializeUninstall(): Boolean;
|
|
|
|
var
|
|
|
|
ErrorCode: Integer;
|
|
|
|
begin
|
|
|
|
Result := true;
|
|
|
|
if IsAppRunning('{#ExeName}') then
|
|
|
|
begin
|
|
|
|
if MsgBox('Status application is still running. Do you want to terminate the app?', mbConfirmation, MB_YESNO or MB_DEFBUTTON1) = IDYES
|
|
|
|
then
|
|
|
|
ShellExec('', ExpandConstant('{sys}\taskkill.exe'),'/f /im {#ExeName}', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode)
|
|
|
|
else
|
|
|
|
Result := false;
|
|
|
|
end
|
|
|
|
end;
|
|
|
|
|
2021-07-19 11:15:44 +00:00
|
|
|
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
|
|
|
|
begin
|
|
|
|
if CurUninstallStep = usPostUninstall then
|
|
|
|
begin
|
|
|
|
if DirExists(ExpandConstant('{localappdata}\Status')) then
|
|
|
|
if MsgBox('Do you want to delete application data?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES
|
|
|
|
then
|
|
|
|
DelTree(ExpandConstant('{localappdata}\Status'), True, True, True);
|
|
|
|
end;
|
|
|
|
end;
|
2021-08-13 05:15:43 +00:00
|
|
|
|