igneum/packaging/windows/Igneum-Miner.iss

187 lines
9.3 KiB
Text

; Igneum Miner installer for Windows, Inno Setup 6.3 or newer. Compiled by build-installer.ps1, which passes
; /DPayload=<assembled payload folder> and /DArtDir=<brand\icons>. The defaults below are for a run from the repo.
; 0.3.0 (4 October 2026): the app (igneum-app.exe engine, "Igneum Miner.exe" window host when BUILD-APP.bat made it,
; igneumd.exe, igneum-miner.exe, the prebuilt GPU workers when present, the worker sources for the fallback build).
#ifndef Payload
#define Payload "igneum-windows-app"
#endif
#ifndef ArtDir
#define ArtDir "..\..\brand\icons"
#endif
#ifndef AppVersion
#define AppVersion "0.3.23"
#endif
#define AppName "Igneum Miner"
#define Publisher "Igneum"
#define Url "https://igneum.network"
[Setup]
AppId={{A4C1F0E2-6B8D-4E7A-9F31-2C5D8E7B9A01}
AppName={#AppName}
AppVersion={#AppVersion}
AppVerName={#AppName} {#AppVersion}
AppPublisher={#Publisher}
AppPublisherURL={#Url}
AppSupportURL={#Url}
AppUpdatesURL={#Url}
AppCopyright=Igneum. Nothing is bought or sold.
VersionInfoVersion={#AppVersion}.0
VersionInfoCompany={#Publisher}
VersionInfoProductName={#AppName}
VersionInfoDescription={#AppName} Setup
DefaultDirName={localappdata}\Programs\{#AppName}
DefaultGroupName={#AppName}
DisableProgramGroupPage=yes
LicenseFile=LICENSE.txt
OutputDir=dist
OutputBaseFilename=Igneum-Miner-Setup-{#AppVersion}
SetupIconFile={#ArtDir}\igneum.ico
UninstallDisplayIcon={app}\igneum.ico
UninstallDisplayName={#AppName}
WizardStyle=modern
WizardImageFile={#ArtDir}\inno-wizard-164x314.bmp
WizardSmallImageFile={#ArtDir}\inno-wizard-small-55x58.bmp
Compression=lzma2/max
SolidCompression=yes
ArchitecturesAllowed=x64compatible
ArchitecturesInstallIn64BitMode=x64compatible
; Per user since 0.3.3 (4 October 2026): no administrator prompt, so the app's own updater can install unattended
; (two PCs sat stopped at a UAC prompt for an hour). The firewall rule moved to the app's first run (src/ota.rs).
PrivilegesRequired=lowest
MinVersion=10.0
CloseApplications=yes
CloseApplicationsFilter=*.exe,*.dll
RestartApplications=no
; 0.3.23: one installer at a time, and a name the app can read (PC 2, 7 October 2026, 20:54 BST: the host restarted the old
; engine under a running installer); the marker file below is what the engine's helper and the window host hold on
SetupMutex=IgneumMinerSetup
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Messages]
english.WelcomeLabel2=This will install [name/ver] on your computer.%n%nOne window runs your node and the GPU miner, and shows your hash rate, your blocks and the chain. Nothing is bought or sold on this network.
english.FinishedHeadingLabel=Igneum Miner is installed
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
;; No [Dirs] entry: {app} stays read-only for users (R4.3.3). The engine writes under %LOCALAPPDATA%\igneum, and
;; the fallback worker build copies the sources there first.
[Files]
Source: "{#Payload}\*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs ignoreversion; Excludes: "*.log,*.seeds,*.DS_Store,packs\*,build\*,dist\*"
Source: "{#ArtDir}\igneum.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#Payload}\stop-igneum.ps1"; Flags: dontcopy
Source: "wrappers\Stop Igneum Miner.cmd"; DestDir: "{app}"; Flags: ignoreversion
Source: "LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion
[Icons]
; igneum-app.exe --launch hands over to "Igneum Miner.exe" (the window) when it is installed, else opens the dashboard in the browser.
Name: "{group}\Igneum Miner"; Filename: "{app}\igneum-app.exe"; Parameters: "--launch"; WorkingDir: "{app}"; IconFilename: "{app}\igneum.ico"; Comment: "Start the node and mine"
Name: "{group}\Stop Igneum Miner"; Filename: "{app}\Stop Igneum Miner.cmd"; WorkingDir: "{app}"; IconFilename: "{app}\igneum.ico"; Comment: "Stop the miner and the node"
Name: "{group}\Igneum Miner logs"; Filename: "{localappdata}\igneum\logs"; IconFilename: "{app}\igneum.ico"; Comment: "The folder the log files land in"
Name: "{group}\Uninstall Igneum Miner"; Filename: "{uninstallexe}"; IconFilename: "{app}\igneum.ico"
Name: "{autodesktop}\Igneum Miner"; Filename: "{app}\igneum-app.exe"; Parameters: "--launch"; WorkingDir: "{app}"; IconFilename: "{app}\igneum.ico"; Tasks: desktopicon
[Run]
; 0.3.22 (the project lead, 7 October 2026: "all the rights need to be done on install, and then on update if anything new"): the app's own
; rights step runs on every install, silent ones included; it compares the installed rights manifest with this build's list and
; asks for administrator rights ONCE only when a right is missing (the Power Helper task, the boot task, the firewall rules),
; else exits at once. The app never prompts at runtime (src/rights.rs).
Filename: "{app}\igneum-app.exe"; Parameters: "--rights"; Flags: waituntilterminated runasoriginaluser
; The inbound firewall rule needs an administrator and is asked for once by the app on its first run (declined = the node dials out and mines without it).
; Started as the signed-in user, not as administrator (the data lands in that user's %LOCALAPPDATA%).
Filename: "{app}\igneum-app.exe"; Parameters: "--launch"; Description: "Start Igneum Miner now"; Flags: postinstall nowait skipifsilent runasoriginaluser
; The over-the-air updater (packaging/ota, src/ota.rs) runs this installer /VERYSILENT /IGNOTA=1 and the app must come back by itself.
; /IGNOTA=2 (helpers from 0.3.22 on, MF-11): the helper starts the app itself, polls the new engine and restores the kept
; exe set when nothing answers; this entry stays silent so the two never race for the single-instance window.
Filename: "{app}\igneum-app.exe"; Parameters: "--launch"; Flags: nowait runasoriginaluser; Check: OtaRelaunch
[UninstallRun]
Filename: "powershell.exe"; Parameters: "-NoProfile -ExecutionPolicy Bypass -File ""{app}\stop-igneum.ps1"""; Flags: runhidden waituntilterminated; RunOnceId: "StopIgneum"
[UninstallDelete]
; The GPU workers built on this PC and the WebView2 cache are not in the install log; remove them with the folder.
Type: filesandordirs; Name: "{app}"
[Code]
// /IGNOTA=1: the app's own updater (before 0.3.22) started this install; relaunch the app when the files are in.
// /IGNOTA=2: the 0.3.22 helper started it and relaunches the app itself (src/ota.rs WIN_HELPER): no relaunch here.
function OtaRelaunch: Boolean;
begin
Result := ExpandConstant('{param:IGNOTA|0}') = '1';
end;
// The 0.3.2-and-earlier install in Program Files (administrator), when this per-user install lands on top of it.
function OldAdminInstallDir: String;
begin
Result := ExpandConstant('{commonpf}\Igneum Miner');
if not FileExists(Result + '\igneum-app.exe') then
Result := '';
end;
// Stops a running copy before the files are replaced (an upgrade over a running miner): the old copy's own
// stop-igneum.ps1 when one is installed (Program Files or here), else ours from the payload. Then, when someone is at
// the keyboard, offers to remove the Program Files copy (its uninstaller needs one administrator prompt; the data in
// %LOCALAPPDATA%\igneum is the same for both, nothing to copy). A silent (over-the-air) install never asks.
// The install marker (0.3.23): <LOCALAPPDATA>\igneum\app\install-running.flag while this installer works; the engine's
// update helper and the window host never relaunch the app while it is there (src/ota.rs relaunch_allowed, host.cpp).
function MarkerPath: String;
begin
Result := ExpandConstant('{localappdata}\igneum\app\install-running.flag');
end;
procedure SetMarker;
begin
ForceDirectories(ExtractFileDir(MarkerPath));
SaveStringToFile(MarkerPath, GetDateTimeString('yyyy/mm/dd hh:nn:ss', '-', ':') + ' ' + '{#AppVersion}', False);
end;
procedure ClearMarker;
begin
DeleteFile(MarkerPath);
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssDone then ClearMarker;
end;
procedure DeinitializeSetup;
begin
ClearMarker;
end;
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
StopScript, OldDir: String;
ResultCode: Integer;
begin
Result := '';
SetMarker;
OldDir := OldAdminInstallDir;
StopScript := ExpandConstant('{app}\stop-igneum.ps1');
if (not FileExists(StopScript)) and (OldDir <> '') then
StopScript := OldDir + '\stop-igneum.ps1';
if not FileExists(StopScript) then
StopScript := ExpandConstant('{tmp}\stop-igneum.ps1');
if not FileExists(StopScript) then
ExtractTemporaryFile('stop-igneum.ps1');
if FileExists(StopScript) then
Exec('powershell.exe', '-NoProfile -ExecutionPolicy Bypass -File "' + StopScript + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
if (OldDir <> '') and (not WizardSilent) and FileExists(OldDir + '\unins000.exe') then
begin
if MsgBox('Igneum Miner now installs in your user folder, so updates need no administrator prompt.' + #13#10#13#10 +
'An older copy is still in ' + OldDir + '. Remove it now? (one administrator prompt; your chain data, address and settings stay)',
mbConfirmation, MB_YESNO) = IDYES then
ShellExec('runas', OldDir + '\unins000.exe', '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
WizardForm.FinishedLabel.Caption := WizardForm.FinishedLabel.Caption + #13#10#13#10 +
'Nobody from Igneum will ever ask for your seed.';
end;