Files
umbrix/windows/installer.iss
2026-01-20 13:44:26 +03:00

95 lines
3.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
; Umbrix Windows Installer Script for Inno Setup
; https://jrsoftware.org/isinfo.php
#define MyAppName "Umbrix"
#define MyAppVersion "1.7.5"
#define MyAppPublisher "Umbrix VPN"
#define MyAppURL "https://umbrix.net"
#define MyAppExeName "Umbrix.exe"
#define MyAppId "{{8B6F4D6E-5C3A-4F2E-9D1B-7E8A9C0F1234}"
[Setup]
; NOTE: The value of AppId uniquely identifies this application
AppId={#MyAppId}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=..\LICENSE.md
OutputDir=..\dist
OutputBaseFilename=umbrix-{#MyAppVersion}-windows-setup
SetupIconFile=runner\resources\app_icon.ico
Compression=lzma2/ultra64
SolidCompression=yes
WizardStyle=modern
PrivilegesRequired=admin
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
UninstallDisplayIcon={app}\{#MyAppExeName}
UninstallDisplayName={#MyAppName}
VersionInfoVersion={#MyAppVersion}
VersionInfoCompany={#MyAppPublisher}
VersionInfoDescription={#MyAppName} VPN Client
MinVersion=10.0.17763
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 6.1; Check: not IsAdminInstallMode
[Files]
; Все файлы из build/windows/x64/runner/Release
Source: "..\build\windows\x64\runner\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[Code]
// Проверка и закрытие запущенного процесса перед установкой
function InitializeSetup(): Boolean;
var
ResultCode: Integer;
begin
// Проверяем, запущен ли Umbrix
if CheckForMutexes('Umbrix') then
begin
if MsgBox('Umbrix уже запущен. Закрыть приложение и продолжить установку?', mbConfirmation, MB_YESNO) = IDYES then
begin
// Закрываем процесс
Exec('taskkill', '/F /IM Umbrix.exe', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
Sleep(1000); // Ждем завершения процесса
Result := True;
end
else
Result := False;
end
else
Result := True;
end;
// Автоматическое удаление старой версии
function InitializeUninstall(): Boolean;
var
ResultCode: Integer;
begin
// Закрываем процесс при деинсталляции
Exec('taskkill', '/F /IM Umbrix.exe', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
Sleep(1000);
Result := True;
end;