@@ -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
0 commit comments