Files
raven/dist/install/windows/x64/standalone.iss
John Cardinal 450acc5ef7 case 4694 - standalone setup stops a running embedded PostgreSQL first
The 8.2.4 and older launchers left PostgreSQL running after the in-app
shutdown, so every standalone upgrade stopped at "files in use" and could not
close it. PrepareToInstall and uninstall now run the installed pg_ctl stop.
Changelog; BUILD.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 21:45:39 -07:00

123 lines
6.9 KiB
Plaintext

; Basic preconfigured ayanova installer for super easy config
; single user or lan only, built in postgres
; external to lan requires different config
#define MyAppName "AyaNova"
#define MyAppVersion "8.3.0"
#define MyAppPublisher "Ground Zero Tech-Works, Inc."
#define MyAppURL "https://ayanova.com/"
#define MyAppLauncherExeName "ayanova-launcher.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{B2BB79DB-0690-497C-B92B-955F7B468429}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\ayanova
DisableProgramGroupPage=yes
LicenseFile=C:\data\code\raven\dist\assets\license.rtf
OutputDir=C:\data\code\raven\dist\installers
OutputBaseFilename=ayanova-windows-x64-single-setup
SetupIconFile=C:\data\code\raven\graphics\logo.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern
ArchitecturesInstallIn64BitMode=x64
ArchitecturesAllowed=x64
;Force user to install to set location so that they don't break the backup and stuff
;this prevents users from randomly picking a weird location and then requiring support to edit the config.json file to set the backup path etc
DisableDirPage=yes
AlwaysShowDirOnReadyPage=yes
[Tasks]
;commented out to force desktop icon, no prompt Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\data\code\raven\dist\win-x64\ayanova\standalone\AyaNova.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\data\code\raven\dist\win-x64\ayanova\standalone\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\data\code\raven\dist\win-x64\launcher\config.json"; DestDir: "{app}"; Flags: ignoreversion confirmoverwrite
Source: "C:\data\code\raven\dist\win-x64\launcher\*"; DestDir: "{app}\launcher"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\data\code\raven\dist\win-x64\postgres-standalone\*"; DestDir: "{app}\local-postgres"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\data\code\raven\dist\win-x64\postgres-empty-database\*"; DestDir: "{commonappdata}\ayanova\database"; Permissions: users-modify; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist uninsneveruninstall
[Dirs]
;Name: "{app}\.local-chromium";Permissions: users-modify;Flags: uninsalwaysuninstall
Name: "{commonappdata}\ayanova";Permissions: users-modify;Flags: uninsneveruninstall
Name: "{commonappdata}\ayanova\logs";Permissions: users-modify;Flags: uninsneveruninstall
; Empty folders PostgreSQL 14 needs in a new database. Git does not keep empty folders, so dist\win-x64\postgres-empty-database
; (checked out from Git) lacks them and the server will not start on a fresh install. Already present on an upgrade.
Name: "{commonappdata}\ayanova\database\pg_commit_ts";Permissions: users-modify;Flags: uninsneveruninstall
Name: "{commonappdata}\ayanova\database\pg_dynshmem";Permissions: users-modify;Flags: uninsneveruninstall
Name: "{commonappdata}\ayanova\database\pg_logical\mappings";Permissions: users-modify;Flags: uninsneveruninstall
Name: "{commonappdata}\ayanova\database\pg_logical\snapshots";Permissions: users-modify;Flags: uninsneveruninstall
Name: "{commonappdata}\ayanova\database\pg_notify";Permissions: users-modify;Flags: uninsneveruninstall
Name: "{commonappdata}\ayanova\database\pg_replslot";Permissions: users-modify;Flags: uninsneveruninstall
Name: "{commonappdata}\ayanova\database\pg_serial";Permissions: users-modify;Flags: uninsneveruninstall
Name: "{commonappdata}\ayanova\database\pg_snapshots";Permissions: users-modify;Flags: uninsneveruninstall
Name: "{commonappdata}\ayanova\database\pg_stat";Permissions: users-modify;Flags: uninsneveruninstall
Name: "{commonappdata}\ayanova\database\pg_stat_tmp";Permissions: users-modify;Flags: uninsneveruninstall
Name: "{commonappdata}\ayanova\database\pg_tblspc";Permissions: users-modify;Flags: uninsneveruninstall
Name: "{commonappdata}\ayanova\database\pg_twophase";Permissions: users-modify;Flags: uninsneveruninstall
Name: "{commonappdata}\ayanova\database\pg_wal\archive_status";Permissions: users-modify;Flags: uninsneveruninstall
[UninstallDelete]
;Type: filesandordirs; Name: "{app}\.local-chromium\*"
Type: filesandordirs; Name: "{app}\Chrome"
Type: filesandordirs; Name: "{app}\ChromeHeadlessShell"
[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\launcher\ayanova-launcher.exe";
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\launcher\ayanova-launcher.exe";
;removed this from above line to force desktop icon Tasks: desktopicon
[Run]
; case 4579: the program folder is no longer writable by all local users (nothing writes there, data is under
; {commonappdata}\ayanova). Upgrades over 8.2.4 or older still carry the old grant, so remove the Users group's own
; rights (by SID, the group name is translated) from the program folder and everything in it; inherited read rights stay
Filename: "{sys}\icacls.exe"; Parameters: """{app}"" /remove:g *S-1-5-32-545 /T /C /Q"; Flags: runhidden waituntilterminated
Filename: "{app}\launcher\ayanova-launcher.exe"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[Code]
// case 4694: the launcher of 8.2.4 and older left the local PostgreSQL server running when AyaNova was shut down, so
// its files are in use; stop it (if running) before installing over it or uninstalling
procedure StopLocalPostgres();
var
PgCtl: String;
ResultCode: Integer;
begin
PgCtl := ExpandConstant('{app}\local-postgres\bin\pg_ctl.exe');
if FileExists(PgCtl) and DirExists(ExpandConstant('{commonappdata}\ayanova\database')) then
Exec(PgCtl, 'stop -D "' + ExpandConstant('{commonappdata}\ayanova\database') + '" -m fast -w', ExtractFileDir(PgCtl), SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;
function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
StopLocalPostgres();
Result := '';
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usUninstall then
StopLocalPostgres();
if CurUninstallStep = usPostUninstall then
begin
if MsgBox('Do you want to delete all AyaNova database, attachment and log files?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES then
begin
if MsgBox('Are you sure you want to **PERMANENTLY** delete all AyaNova data files?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES then
begin
DelTree(ExpandConstant('{commonappdata}\ayanova'), True, True, True);
end;
end;
end;
end;