Skip to content

Commit d920a0f

Browse files
committed
final windows game launcher
1 parent 8884c40 commit d920a0f

File tree

3 files changed

+145
-34
lines changed

3 files changed

+145
-34
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Launcher Installer
1+
name: Build Launcher Installer (Standalone)
22

33
on:
44
push:
@@ -182,16 +182,13 @@ jobs:
182182
with:
183183
tag_name: ${{ steps.get_tag.outputs.tag_name }}
184184
files: |
185-
build/distributions/woodlanders-setup-launcher.exe
186185
build/distributions/woodlanders-launcher-installer.zip
187186
env:
188187
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
189188

190-
- name: Upload artifacts
189+
- name: Upload artifacts as backup
191190
uses: actions/upload-artifact@v4
192191
with:
193192
name: launcher-installer
194-
path: |
195-
build/distributions/woodlanders-setup-launcher.exe
196-
build/distributions/woodlanders-launcher-installer.zip
193+
path: build/distributions/woodlanders-launcher-installer.zip
197194
retention-days: 90

.github/workflows/release.yml

Lines changed: 123 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,112 @@ jobs:
3434
- name: Build JARs with Gradle
3535
run: gradle build -x test --no-daemon
3636

37+
- name: Build Launcher Installer
38+
run: |
39+
# Create installer directory structure
40+
New-Item -ItemType Directory -Force -Path installer-staging
41+
New-Item -ItemType Directory -Force -Path build\distributions
42+
43+
# Copy launcher JAR and icon
44+
Copy-Item launcher\build\libs\woodlanders-launcher.jar -Destination installer-staging\
45+
if (Test-Path assets\icon\icon.png) {
46+
Copy-Item assets\icon\icon.png -Destination installer-staging\launcher.ico
47+
}
48+
49+
# Create installer script from template
50+
$scriptContent = Get-Content -Path .github\scripts\windows-installer-template.ps1 -Raw
51+
$scriptContent = $scriptContent -replace '\$\{VERSION\}', '${{ github.ref_name }}'
52+
$scriptContent = $scriptContent -replace '\$scriptDir = if \(\$PSScriptRoot\) \{ \$PSScriptRoot \} else \{ Split-Path -Parent \$MyInvocation\.MyCommand\.Path \}', '$scriptDir = if ($PSScriptRoot) { $PSScriptRoot } elseif ($MyInvocation.MyCommand.Path) { Split-Path -Parent $MyInvocation.MyCommand.Path } else { Get-Location | Select-Object -ExpandProperty Path }'
53+
$scriptContent | Out-File -FilePath installer-staging\install.ps1 -Encoding UTF8
54+
55+
# Create README
56+
$readmeLines = @(
57+
"# Woodlanders Launcher Installer",
58+
"",
59+
"## Installation Instructions",
60+
"",
61+
"IMPORTANT: Extract the entire ZIP file before running the installer.",
62+
"The installer needs all files in the same folder to work correctly.",
63+
"",
64+
"### Option 1: Run the EXE (Recommended)",
65+
"1. Extract the ZIP file",
66+
"2. Double-click woodlanders-setup-launcher.exe",
67+
"3. Follow the prompts",
68+
"",
69+
"### Option 2: Run PowerShell Script",
70+
"1. Extract the ZIP file",
71+
"2. Right-click install.ps1",
72+
"3. Select Run with PowerShell",
73+
"",
74+
"## What Gets Installed",
75+
"",
76+
"- Woodlanders Launcher application",
77+
"- Java 21 with JavaFX (if not already installed)",
78+
"- Desktop shortcut with icon",
79+
"- Start Menu entry with icon",
80+
"",
81+
"## Installation Location",
82+
"",
83+
"%LOCALAPPDATA%\Woodlanders\Launcher",
84+
"",
85+
"## Features",
86+
"",
87+
"- Auto-updates game from GitHub releases",
88+
"- Multi-language support (EN, PL, PT, NL, DE)",
89+
"- Offline mode support",
90+
"- No manual Java installation required",
91+
"",
92+
"## Uninstallation",
93+
"",
94+
"To uninstall:",
95+
"1. Delete: %LOCALAPPDATA%\Woodlanders\Launcher",
96+
"2. Delete desktop shortcut",
97+
"3. Delete: %APPDATA%\Microsoft\Windows\Start Menu\Programs\Woodlanders",
98+
"",
99+
"## Troubleshooting",
100+
"",
101+
"If the installer fails:",
102+
"- Ensure all files from the ZIP are in the same folder",
103+
"- Check internet connection for first-time setup",
104+
"- Check Windows Defender is not blocking the installer",
105+
"- Run the installer as Administrator",
106+
"",
107+
"For help: https://github.com/gcclinux/Woodlanders"
108+
)
109+
$readmeLines -join "`r`n" | Out-File -FilePath installer-staging\README.txt -Encoding UTF8
110+
111+
# Install ps2exe and convert to EXE
112+
Install-Module -Name ps2exe -Force -Scope CurrentUser -AllowClobber
113+
Import-Module ps2exe
114+
Invoke-ps2exe `
115+
-inputFile installer-staging\install.ps1 `
116+
-outputFile build\distributions\woodlanders-setup-launcher.exe `
117+
-title "Woodlanders Launcher Installer" `
118+
-description "Woodlanders Game Launcher Installer" `
119+
-company "Wagemaker UK" `
120+
-version "1.0.0.0" `
121+
-requireAdmin `
122+
-noConsole:$false
123+
124+
# Create distribution package
125+
Copy-Item installer-staging\woodlanders-launcher.jar -Destination build\distributions\ -Force
126+
Copy-Item installer-staging\launcher.ico -Destination build\distributions\ -Force -ErrorAction SilentlyContinue
127+
Copy-Item installer-staging\install.ps1 -Destination build\distributions\ -Force
128+
Copy-Item installer-staging\README.txt -Destination build\distributions\ -Force
129+
130+
# Create ZIP with all installer files
131+
$zipFiles = @(
132+
"build\distributions\woodlanders-setup-launcher.exe",
133+
"build\distributions\woodlanders-launcher.jar",
134+
"build\distributions\launcher.ico",
135+
"build\distributions\install.ps1",
136+
"build\distributions\README.txt"
137+
)
138+
$zipFiles = $zipFiles | Where-Object { Test-Path $_ }
139+
Compress-Archive -Path $zipFiles -DestinationPath build\distributions\woodlanders-launcher-installer.zip -Force
140+
141+
Write-Host "Launcher installer created successfully"
142+
37143
- name: Create jpackage directory
38144
run: mkdir jpackage-input
39145

@@ -107,16 +213,20 @@ jobs:
107213
## Downloads
108214
- **Woodlanders-Windows-Portable.zip** - Windows executable with bundled JRE (no Java installation required)
109215
- **Woodlanders-Linux-x86_64.AppImage** - Linux executable with bundled JRE (no Java installation required)
110-
- **woodlanders-launcher.jar** - Game launcher with auto-update (requires Java 21+)
216+
- **woodlanders-launcher-installer.zip** - Launcher installer with auto Java/JavaFX setup (recommended for new users)
217+
- **woodlanders-launcher.jar** - Standalone launcher JAR (requires Java 21+)
111218
- **woodlanders-client.jar** - Client JAR (requires Java 21+)
112219
- **woodlanders-server.jar** - Dedicated server JAR (requires Java 21+)
113220
114-
## Launcher Features
115-
The launcher provides:
116-
- Automatic game updates from GitHub releases
221+
## Launcher Installer
222+
The launcher installer (`woodlanders-launcher-installer.zip`) provides:
223+
- Automatic Java 21 + JavaFX installation (if needed)
224+
- Desktop and Start Menu shortcuts
117225
- Multi-language support (English, Polish, Portuguese, Dutch, German)
226+
- Auto-updates game from GitHub releases
118227
- Version management and offline mode
119-
- Simple one-click game launch
228+
229+
**Installation:** Extract the ZIP and run `woodlanders-setup-launcher.exe`
120230
121231
## Server Requirements by Player Count
122232
| Players | CPU Cores | RAM | Upload Speed |
@@ -175,15 +285,20 @@ jobs:
175285
```
176286
files: |
177287
./dist/Woodlanders-Windows-Portable.zip
288+
./build/distributions/woodlanders-launcher-installer.zip
178289
./build/libs/woodlanders-client.jar
179290
./build/libs/woodlanders-server.jar
180291
./build/libs/woodlanders-launcher.jar
181292
env:
182293
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
183294

184-
- name: Upload artifact as backup
295+
- name: Upload artifacts as backup
185296
uses: actions/upload-artifact@v4
186297
with:
187-
name: Woodlanders-Windows-Portable
188-
path: dist/Woodlanders-Windows-Portable.zip
298+
name: Woodlanders-Release-Artifacts
299+
path: |
300+
dist/Woodlanders-Windows-Portable.zip
301+
build/libs/woodlanders-client.jar
302+
build/libs/woodlanders-server.jar
303+
build/libs/woodlanders-launcher.jar
189304
retention-days: 90

build-launcher-installer-local.ps1

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -306,35 +306,34 @@ Write-Host "=========================================" -ForegroundColor Green
306306
Write-Host " Build Complete!" -ForegroundColor Green
307307
Write-Host "=========================================" -ForegroundColor Green
308308
Write-Host ""
309-
Write-Host "Created files:" -ForegroundColor Cyan
310-
Write-Host ""
311309

312-
$exeFile = Get-Item build\distributions\woodlanders-setup-launcher.exe
313310
$zipFile = Get-Item build\distributions\woodlanders-launcher-installer.zip
314311

315-
Write-Host " EXE Installer:" -ForegroundColor Yellow
316-
Write-Host " Path: $($exeFile.FullName)" -ForegroundColor Gray
317-
Write-Host " Size: $([math]::Round($exeFile.Length / 1MB, 2)) MB" -ForegroundColor Gray
318-
Write-Host ""
319-
Write-Host " ZIP Package:" -ForegroundColor Yellow
320-
Write-Host " Path: $($zipFile.FullName)" -ForegroundColor Gray
321-
Write-Host " Size: $([math]::Round($zipFile.Length / 1MB, 2)) MB" -ForegroundColor Gray
312+
Write-Host "Created installer package:" -ForegroundColor Cyan
313+
Write-Host " Path: $($zipFile.FullName)" -ForegroundColor Yellow
314+
Write-Host " Size: $([math]::Round($zipFile.Length / 1MB, 2)) MB" -ForegroundColor Gray
322315
Write-Host ""
323316

324-
Write-Host "IMPORTANT: The EXE installer needs these files in the same folder:" -ForegroundColor Yellow
325-
Write-Host " - woodlanders-setup-launcher.exe" -ForegroundColor Gray
326-
Write-Host " - woodlanders-launcher.jar" -ForegroundColor Gray
327-
Write-Host " - launcher.ico" -ForegroundColor Gray
317+
Write-Host "ZIP Contents:" -ForegroundColor Cyan
318+
Write-Host " - woodlanders-setup-launcher.exe (installer)" -ForegroundColor Gray
319+
Write-Host " - woodlanders-launcher.jar (application)" -ForegroundColor Gray
320+
Write-Host " - launcher.ico (icon)" -ForegroundColor Gray
321+
Write-Host " - install.ps1 (PowerShell alternative)" -ForegroundColor Gray
322+
Write-Host " - README.txt (instructions)" -ForegroundColor Gray
328323
Write-Host ""
329-
Write-Host "You can now test the installer by running:" -ForegroundColor Cyan
330-
Write-Host " .\build\distributions\woodlanders-setup-launcher.exe" -ForegroundColor White
331-
Write-Host ""
332-
Write-Host "Or extract and run the ZIP package which contains everything." -ForegroundColor Cyan
324+
325+
Write-Host "To test the installer:" -ForegroundColor Cyan
326+
Write-Host " 1. Extract the ZIP file" -ForegroundColor White
327+
Write-Host " 2. Run woodlanders-setup-launcher.exe from the extracted folder" -ForegroundColor White
333328
Write-Host ""
334329

335-
$test = Read-Host "Would you like to test the installer now? (Y/n)"
330+
$test = Read-Host "Would you like to extract and test the installer now? (Y/n)"
336331
if ($test -ne 'n' -and $test -ne 'N') {
337332
Write-Host ""
333+
Write-Host "Extracting ZIP..." -ForegroundColor Cyan
334+
$testDir = "build\distributions\test-installer"
335+
if (Test-Path $testDir) { Remove-Item $testDir -Recurse -Force }
336+
Expand-Archive -Path build\distributions\woodlanders-launcher-installer.zip -DestinationPath $testDir
338337
Write-Host "Launching installer..." -ForegroundColor Cyan
339-
Start-Process -FilePath "build\distributions\woodlanders-setup-launcher.exe" -Wait
338+
Start-Process -FilePath "$testDir\woodlanders-setup-launcher.exe" -WorkingDirectory $testDir -Wait
340339
}

0 commit comments

Comments
 (0)