@@ -35,10 +35,13 @@ if (Test-Path launcher\build\libs\woodlanders-launcher.jar) {
3535 exit 1
3636}
3737
38- # Copy icon if it exists (rename to match template expectations)
39- if (Test-Path assets\icon\icon.png) {
40- Copy-Item assets\icon\icon.png - Destination installer- staging\launcher.ico
41- Write-Host " Icon copied" - ForegroundColor Green
38+ # Copy icon (use .ico for Windows)
39+ if (Test-Path assets\icon\icon.ico) {
40+ Copy-Item assets\icon\icon.ico - Destination installer- staging\launcher.ico
41+ Write-Host " Icon copied (.ico)" - ForegroundColor Green
42+ } elseif (Test-Path assets\icon\icon.png) {
43+ Copy-Item assets\icon\icon.png - Destination installer- staging\launcher.png
44+ Write-Host " Icon copied (.png)" - ForegroundColor Green
4245} else {
4346 Write-Host " Icon not found (optional)" - ForegroundColor Yellow
4447}
@@ -142,8 +145,10 @@ function Install-Application {
142145 Write-ErrorMsg "Application JAR not found"
143146 return $false
144147 }
145- if (Test-Path "$scriptDir\launcher-icon.png") {
146- Copy-Item "$scriptDir\launcher-icon.png" -Destination $INSTALL_DIR -Force
148+ if (Test-Path "$scriptDir\launcher.ico") {
149+ Copy-Item "$scriptDir\launcher.ico" -Destination $INSTALL_DIR -Force
150+ } elseif (Test-Path "$scriptDir\launcher.png") {
151+ Copy-Item "$scriptDir\launcher.png" -Destination $INSTALL_DIR -Force
147152 }
148153 return $true
149154}
@@ -160,8 +165,8 @@ function New-Shortcuts {
160165 $Shortcut.TargetPath = "$INSTALL_DIR\launcher.bat"
161166 $Shortcut.WorkingDirectory = $INSTALL_DIR
162167 $Shortcut.Description = "Woodlanders Game Launcher"
163- if (Test-Path "$INSTALL_DIR\launcher-icon.png ") {
164- $Shortcut.IconLocation = "$INSTALL_DIR\launcher-icon.png "
168+ if (Test-Path "$INSTALL_DIR\launcher.ico ") {
169+ $Shortcut.IconLocation = "$INSTALL_DIR\launcher.ico "
165170 }
166171 $Shortcut.Save()
167172 Write-Success "Desktop shortcut created"
@@ -170,8 +175,8 @@ function New-Shortcuts {
170175 $StartMenuShortcut.TargetPath = "$INSTALL_DIR\launcher.bat"
171176 $StartMenuShortcut.WorkingDirectory = $INSTALL_DIR
172177 $StartMenuShortcut.Description = "Woodlanders Game Launcher"
173- if (Test-Path "$INSTALL_DIR\launcher-icon.png ") {
174- $StartMenuShortcut.IconLocation = "$INSTALL_DIR\launcher-icon.png "
178+ if (Test-Path "$INSTALL_DIR\launcher.ico ") {
179+ $StartMenuShortcut.IconLocation = "$INSTALL_DIR\launcher.ico "
175180 }
176181 $StartMenuShortcut.Save()
177182 Write-Success "Start Menu shortcut created"
@@ -293,15 +298,18 @@ Write-Host "[7/7] Creating distribution package..." -ForegroundColor Yellow
293298# Copy all necessary files to distributions folder
294299Copy-Item installer- staging\woodlanders- launcher.jar - Destination build\distributions\ - Force
295300Copy-Item installer- staging\launcher.ico - Destination build\distributions\ - Force - ErrorAction SilentlyContinue
301+ Copy-Item installer- staging\launcher.png - Destination build\distributions\ - Force - ErrorAction SilentlyContinue
296302Copy-Item installer- staging\install.ps1 - Destination build\distributions\ - Force
297303Copy-Item installer- staging\README.txt - Destination build\distributions\ - Force
304+ Copy-Item launcher\uninstall.ps1 - Destination build\distributions\ - Force
298305
299306# Create ZIP with all installer files
300307$zipFiles = @ (
301308 " build\distributions\woodlanders-setup-launcher.exe" ,
302309 " build\distributions\woodlanders-launcher.jar" ,
303310 " build\distributions\launcher.ico" ,
304311 " build\distributions\install.ps1" ,
312+ " build\distributions\uninstall.ps1" ,
305313 " build\distributions\README.txt"
306314)
307315$zipFiles = $zipFiles | Where-Object { Test-Path $_ }
@@ -336,20 +344,5 @@ Write-Host " 1. Extract the ZIP file" -ForegroundColor White
336344Write-Host " 2. Run woodlanders-setup-launcher.exe from the extracted folder" - ForegroundColor White
337345Write-Host " "
338346
339- $test = Read-Host " Would you like to extract and test the installer now? (Y/n)"
340- if ($test -ne ' n' -and $test -ne ' N' ) {
341- Write-Host " "
342- Write-Host " Extracting ZIP..." - ForegroundColor Cyan
343- $testDir = " build\distributions\test-installer"
344- if (Test-Path $testDir ) { Remove-Item $testDir - Recurse - Force }
345-
346- # Try Expand-Archive first, fallback to .NET if module not available
347- try {
348- Expand-Archive - Path build\distributions\woodlanders- launcher- installer.zip - DestinationPath $testDir - ErrorAction Stop
349- } catch {
350- Add-Type - AssemblyName System.IO.Compression.FileSystem
351- [System.IO.Compression.ZipFile ]::ExtractToDirectory(" $PWD \build\distributions\woodlanders-launcher-installer.zip" , " $PWD \$testDir " )
352- }
353- Write-Host " Launching installer..." - ForegroundColor Cyan
354- Start-Process - FilePath " $testDir \woodlanders-setup-launcher.exe" - WorkingDirectory $testDir - Wait
355- }
347+ Write-Host " Build complete! Run the installer from:" - ForegroundColor Cyan
348+ Write-Host " build\distributions\test-installer\woodlanders-setup-launcher.exe" - ForegroundColor White
0 commit comments