Skip to content

Commit 9cec8b9

Browse files
committed
added uninstaller also
1 parent 03f9f8d commit 9cec8b9

2 files changed

Lines changed: 37 additions & 4 deletions

File tree

.github/workflows/build-launcher-installer.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
run: |
124124
Install-Module -Name ps2exe -Force -Scope CurrentUser -AllowClobber
125125
126-
- name: Convert PowerShell script to EXE
126+
- name: Convert PowerShell scripts to EXE
127127
run: |
128128
Import-Module ps2exe
129129
Invoke-ps2exe `
@@ -135,6 +135,16 @@ jobs:
135135
-version "1.0.0.0" `
136136
-requireAdmin `
137137
-noConsole:$false
138+
139+
Invoke-ps2exe `
140+
-inputFile launcher\uninstall.ps1 `
141+
-outputFile build\distributions\uninstall-launcher.exe `
142+
-title "Woodlanders Launcher Uninstaller" `
143+
-description "Uninstall Woodlanders Game Launcher" `
144+
-company "Wagemaker UK" `
145+
-version "1.0.0.0" `
146+
-requireAdmin `
147+
-noConsole:$false
138148
139149
- name: Create distribution package with all installer files
140150
run: |
@@ -146,6 +156,7 @@ jobs:
146156
147157
$zipFiles = @(
148158
"build\distributions\woodlanders-setup-launcher.exe",
159+
"build\distributions\uninstall-launcher.exe",
149160
"build\distributions\woodlanders-launcher.jar",
150161
"build\distributions\launcher.ico",
151162
"build\distributions\install.ps1",

launcher/build-launcher-installer-local.ps1

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,30 @@ $ps2exeParams = @{
285285
Invoke-ps2exe @ps2exeParams
286286

287287
if (Test-Path build\distributions\woodlanders-setup-launcher.exe) {
288-
Write-Host "EXE created successfully" -ForegroundColor Green
288+
Write-Host "Installer EXE created successfully" -ForegroundColor Green
289289
} else {
290-
Write-Host "Failed to create EXE" -ForegroundColor Red
290+
Write-Host "Failed to create installer EXE" -ForegroundColor Red
291291
exit 1
292292
}
293+
294+
Write-Host " Converting uninstaller to EXE..." -ForegroundColor Gray
295+
$uninstallParams = @{
296+
inputFile = "launcher\uninstall.ps1"
297+
outputFile = "build\distributions\uninstall-launcher.exe"
298+
title = "Woodlanders Launcher Uninstaller"
299+
description = "Uninstall Woodlanders Game Launcher"
300+
company = "Wagemaker UK"
301+
version = "1.0.0.0"
302+
requireAdmin = $true
303+
noConsole = $false
304+
}
305+
Invoke-ps2exe @uninstallParams
306+
307+
if (Test-Path build\distributions\uninstall-launcher.exe) {
308+
Write-Host "Uninstaller EXE created successfully" -ForegroundColor Green
309+
} else {
310+
Write-Host "Failed to create uninstaller EXE" -ForegroundColor Red
311+
}
293312
Write-Host ""
294313

295314
# Step 7: Create distribution package
@@ -306,6 +325,7 @@ Copy-Item launcher\uninstall.ps1 -Destination build\distributions\ -Force
306325
# Create ZIP with all installer files
307326
$zipFiles = @(
308327
"build\distributions\woodlanders-setup-launcher.exe",
328+
"build\distributions\uninstall-launcher.exe",
309329
"build\distributions\woodlanders-launcher.jar",
310330
"build\distributions\launcher.ico",
311331
"build\distributions\install.ps1",
@@ -333,9 +353,11 @@ Write-Host ""
333353

334354
Write-Host "ZIP Contents:" -ForegroundColor Cyan
335355
Write-Host " - woodlanders-setup-launcher.exe (installer)" -ForegroundColor Gray
356+
Write-Host " - uninstall-launcher.exe (uninstaller)" -ForegroundColor Gray
336357
Write-Host " - woodlanders-launcher.jar (application)" -ForegroundColor Gray
337358
Write-Host " - launcher.ico (icon)" -ForegroundColor Gray
338-
Write-Host " - install.ps1 (PowerShell alternative)" -ForegroundColor Gray
359+
Write-Host " - install.ps1 (PowerShell script)" -ForegroundColor Gray
360+
Write-Host " - uninstall.ps1 (PowerShell script)" -ForegroundColor Gray
339361
Write-Host " - README.txt (instructions)" -ForegroundColor Gray
340362
Write-Host ""
341363

0 commit comments

Comments
 (0)