Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,13 @@ jobs:
schtasks /Delete /TN "ThreadPilot_Startup" /F >nul 2>&1
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "ThreadPilot" /f >nul 2>&1

echo [3/4] Optional user data cleanup...
set "REMOVE_DATA=N"
set /p REMOVE_DATA=Do you want to remove user settings at "%APPDATA%\ThreadPilot"? [y/N]:
if /I "%REMOVE_DATA%"=="Y" (
if exist "%APPDATA%\ThreadPilot" (
rd /s /q "%APPDATA%\ThreadPilot"
echo User settings removed.
) else (
echo No user settings folder found.
)
echo [3/4] Removing ThreadPilot user data for this Windows account...
rem Full uninstall removes only ThreadPilot-owned per-user AppData. Normal install/update paths never run this script.
if exist "%APPDATA%\ThreadPilot" (
rd /s /q "%APPDATA%\ThreadPilot"
echo ThreadPilot user data removed.
) else (
echo User settings were kept.
echo No ThreadPilot user data folder found.
)

echo [4/4] Scheduling app folder removal...
Expand Down
14 changes: 11 additions & 3 deletions Installer/Installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define MyAppPublisher "ThreadPilot"
#define MyAppURL "https://github.com/"
#define MyAppExeName "ThreadPilot.exe"
#define MyAppVersion "1.3.0"
#define MyAppVersion "1.3.1"

#ifndef MyWizardStyle
#define MyWizardStyle "modern dynamic windows11"
Expand All @@ -20,7 +20,7 @@
AppId={{A2A4C8B5-4A9A-4B1B-93F4-5F8B1C7E8C2A}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppVerName={#MyAppName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
Expand Down Expand Up @@ -54,7 +54,15 @@ Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: de
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[UninstallRun]
Filename: taskkill.exe; Parameters: "/IM '{#MyAppExeName}' /F"; Flags: runhidden waituntilterminated; RunOnceId: UninstallKill
Filename: "taskkill.exe"; Parameters: "/IM ""{#MyAppExeName}"" /F"; Flags: runhidden waituntilterminated; RunOnceId: "UninstallKill"
Filename: "schtasks.exe"; Parameters: "/Delete /TN ""ThreadPilot_Startup"" /F"; Flags: runhidden waituntilterminated; RunOnceId: "UninstallRemoveThreadPilotStartupTask"
Filename: "reg.exe"; Parameters: "delete ""HKCU\Software\Microsoft\Windows\CurrentVersion\Run"" /v ""ThreadPilot"" /f"; Flags: runhidden waituntilterminated; RunOnceId: "UninstallRemoveThreadPilotRunEntry"

; ThreadPilot user data is preserved during install/update and removed only when
; the generated uninstaller runs. Per-user AppData cleanup is limited to the
; account context used by uninstall.
[UninstallDelete]
Type: filesandordirs; Name: "{userappdata}\ThreadPilot"

[Code]

Expand Down
2 changes: 1 addition & 1 deletion Installer/ThreadPilot.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Package
Name="ThreadPilot"
Manufacturer="Prime Build"
Version="1.3.0.0"
Version="1.3.1.0"
UpgradeCode="PUT-GENERATED-UPGRADE-CODE-HERE"
Language="1033">
<SummaryInformation Description="ThreadPilot MSI template" />
Expand Down
50 changes: 48 additions & 2 deletions Installer/setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#endif

#ifndef MyAppVersion
#define MyAppVersion "1.3.0"
#define MyAppVersion "1.3.1"
#endif

#ifndef MyAppSourceDir
Expand All @@ -22,7 +22,7 @@
AppId={{E8F7A3B2-5C4D-4E6F-8A9B-1C2D3E4F5A6B}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppVerName={#MyAppName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}/issues
Expand Down Expand Up @@ -62,3 +62,49 @@ Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

; Intentionally do not auto-launch after setup to keep package-manager installs unattended.
; ThreadPilot user data is preserved during install/update. Inno removes installed
; files and shortcuts automatically only when the generated uninstaller runs.
; Per-user AppData cleanup is limited to the account context used by uninstall.
[UninstallRun]
Filename: "taskkill.exe"; Parameters: "/IM ""{#MyAppExeName}"" /F"; Flags: runhidden waituntilterminated; RunOnceId: "UninstallKillThreadPilot"
Filename: "schtasks.exe"; Parameters: "/Delete /TN ""ThreadPilot_Startup"" /F"; Flags: runhidden waituntilterminated; RunOnceId: "UninstallRemoveThreadPilotStartupTask"
Filename: "reg.exe"; Parameters: "delete ""HKCU\Software\Microsoft\Windows\CurrentVersion\Run"" /v ""ThreadPilot"" /f"; Flags: runhidden waituntilterminated; RunOnceId: "UninstallRemoveThreadPilotRunEntry"

[UninstallDelete]
Type: filesandordirs; Name: "{userappdata}\ThreadPilot"

[Code]
const
LegacyBetaUninstallKey = 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{A2A4C8B5-4A9A-4B1B-93F4-5F8B1C7E8C2A}_is1';
LegacyBetaDisplayName = 'ThreadPilot 0.1.0-beta';

function IsLegacyThreadPilotInstallPath(InstallLocation: string): Boolean;
var
NormalizedLocation: string;
ExpectedInstallRoot: string;
begin
NormalizedLocation := Lowercase(RemoveBackslashUnlessRoot(RemoveQuotes(InstallLocation)));
ExpectedInstallRoot := Lowercase(RemoveBackslashUnlessRoot(ExpandConstant('{autopf}\ThreadPilot')));
Result := (NormalizedLocation = ExpectedInstallRoot);
end;

procedure DeleteLegacyBetaUninstallEntry(RootKey: Integer);
var
DisplayName: string;
InstallLocation: string;
begin
if RegQueryStringValue(RootKey, LegacyBetaUninstallKey, 'DisplayName', DisplayName) and
RegQueryStringValue(RootKey, LegacyBetaUninstallKey, 'InstallLocation', InstallLocation) and
(DisplayName = LegacyBetaDisplayName) and
IsLegacyThreadPilotInstallPath(InstallLocation) then
begin
RegDeleteKeyIncludingSubkeys(RootKey, LegacyBetaUninstallKey);
end;
end;

function InitializeSetup(): Boolean;
begin
DeleteLegacyBetaUninstallEntry(HKLM);
DeleteLegacyBetaUninstallEntry(HKCU);
Result := True;
end;
Loading
Loading