File size: 3,925 Bytes
1b83c9c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
; InsightUX Windows installer — Inno Setup script.
;
; Build (requires Inno Setup / ISCC installed locally, and dist/InsightUX/
; already built via `pyinstaller packaging/InsightUX.spec` first):
;     iscc packaging/installer.iss
; Output lands in packaging/dist_installer/InsightUX-Setup-<version>.exe.
;
; AppId is a FIXED GUID, generated once and never changed. It's the whole
; mechanism behind "push updates through the installer": every future build
; keeps this same AppId + a higher AppVersion, so re-running a new installer
; upgrades the existing install in place (same folder, same shortcuts)
; instead of creating a second copy. Do not regenerate this GUID.
;
; Installs per-user (PrivilegesRequired=lowest) to %LocalAppData%\InsightUX —
; no admin/UAC prompt, and critically, no Program Files write-permission
; problems for calibration.pkl/sessions/, which the running app writes
; directly into its own install folder (see browser_session.py's DATA_DIR).
;
; calibration.pkl, baseline_pose.pkl, and sessions/ are deliberately NOT
; listed under [Files] below. Inno Setup only ever touches files it tracked
; as having installed — so upgrades overwrite app files without touching
; those, and a normal uninstall leaves them behind too (the [Code] section
; below tells the user this explicitly on uninstall, rather than silently).

#define MyAppName "InsightUX"
#define MyAppVersion "1.0.0"
#define MyAppPublisher "InsightUX"
#define MyAppExeName "InsightUX.exe"
#define MyBuildDir "..\dist\InsightUX"

[Setup]
AppId={{6DE35CE2-05CB-4375-BFFE-D63E9181F1B9}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={localappdata}\InsightUX
DefaultGroupName=InsightUX
DisableProgramGroupPage=yes
PrivilegesRequired=lowest
ArchitecturesInstallIn64BitMode=x64compatible
OutputDir=dist_installer
OutputBaseFilename=InsightUX-Setup-{#MyAppVersion}
Compression=lzma2
SolidCompression=yes
WizardStyle=modern
; A ~1.5-2.5GB installer (torch is bundled deliberately, see README) needs
; the larger internal chunk size or ISCC can fail to build at all.
DiskSpanning=no

[Tasks]
Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"

[Files]
Source: "{#MyBuildDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; Microsoft's WebView2 bootstrapper is NOT part of this repo (an external
; download — see packaging/README.md for the official link). If you've
; placed it next to this .iss before compiling, it gets bundled and
; silently run below as a safety net for machines missing the runtime.
; Harmless to (re-)run even if WebView2 is already installed.
#ifexist "MicrosoftEdgeWebview2Setup.exe"
Source: "MicrosoftEdgeWebview2Setup.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall
#endif

[Icons]
Name: "{group}\InsightUX"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{app}"
Name: "{group}\Uninstall InsightUX"; Filename: "{uninstallexe}"
Name: "{commondesktop}\InsightUX"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{app}"; Tasks: desktopicon

[Run]
#ifexist "MicrosoftEdgeWebview2Setup.exe"
Filename: "{tmp}\MicrosoftEdgeWebview2Setup.exe"; Parameters: "/silent /install"; StatusMsg: "Checking Microsoft Edge WebView2 Runtime..."; Flags: waituntilterminated
#endif
Filename: "{app}\{#MyAppExeName}"; Description: "Launch InsightUX"; Flags: nowait postinstall skipifsilent

[Code]
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usPostUninstall then
  begin
    if FileExists(ExpandConstant('{app}\calibration.pkl')) or
       DirExists(ExpandConstant('{app}\sessions')) then
      MsgBox('Your calibration profile and saved sessions were kept in:' + #13#10 +
             ExpandConstant('{app}') + #13#10 +
             'Delete that folder yourself if you want a completely clean removal.',
             mbInformation, MB_OK);
  end;
end;