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
10 changes: 7 additions & 3 deletions .github/workflows/build-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
BUILD_CONFIGURATION: Release
SOLUTION_PATH: 'src\vcxproj\salamand.sln'
REMOVE_PROJ_PATH: 'src\vcxproj\setup\remove.vcxproj'
OPENSAL_BUILD_DIR: 'D:\a\FileManager\FileManager\build_stage\'
# Important: Use a relative path within the workspace for reliability
OPENSAL_BUILD_DIR: '${{ github.workspace }}\build_stage\'

steps:
- name: Checkout
Expand All @@ -29,14 +30,17 @@ jobs:
- name: Build Solution (Release | x64)
run: |
New-Item -ItemType Directory -Force -Path $env:OPENSAL_BUILD_DIR
msbuild $env:SOLUTION_PATH /m /t:Build /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:PreferredToolArchitecture=x64
msbuild $env:SOLUTION_PATH /m /t:Build /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:PreferredToolArchitecture=x64 /p:OutDir=$env:OPENSAL_BUILD_DIR

- name: Build Uninstaller (Release | x64)
run: |
msbuild $env:REMOVE_PROJ_PATH /m /t:Build /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:PreferredToolArchitecture=x64
# OutDir for remove needs to be specific to avoid overwriting or missing files if not handled by the solution OutDir
msbuild $env:REMOVE_PROJ_PATH /m /t:Build /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:PreferredToolArchitecture=x64 /p:OutDir="${{ env.OPENSAL_BUILD_DIR }}remove\Release_x64\"

- name: Prepare and Create Installer
run: |
# We need to make sure the expected structure exists in build_stage for our script
# Some projects might not follow the global OutDir perfectly if they have hardcoded paths in props
powershell.exe -File tools\prepare_installer.ps1 -BuildDir $env:OPENSAL_BUILD_DIR -OutputPath "OpenSalamander_5.0.${{ github.run_number }}.exe"

- name: Create Release
Expand Down
Binary file added Installer/lang/english.slg
Binary file not shown.
Binary file added Installer/setup.exe
Binary file not shown.
39 changes: 35 additions & 4 deletions tools/prepare_installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,41 @@ Copy-Item "Installer\setup.exe" "$StagingDir\"
Copy-Item "Installer\LICENSE" "$StagingDir\"
Copy-Item "Installer\x64" "$StagingDir\"

# 2. Copy main executables (from Release_x64)
Copy-Item "src\vcxproj\salamander\Release_x64\salamand.exe" "$StagingDir\"
Copy-Item "src\vcxproj\salmon\salamander\Release_x64\utils\salmon.exe" "$StagingDir\"
Copy-Item "$BuildDir\remove\Release_x64\remove.exe" "$StagingDir\"
# 2. Copy main executables
function Copy-Exe($srcPatterns, $dest) {
foreach ($pattern in $srcPatterns) {
$found = Get-ChildItem -Path $pattern -ErrorAction SilentlyContinue | Select-Object -First 1
if ($found) {
Copy-Item $found.FullName $dest
return $true
}
}
return $false
}

$salamandCopied = Copy-Exe @(
"$BuildDir\salamander\Release_x64\salamand.exe",
"$BuildDir\Release_x64\salamand.exe",
"$BuildDir\salamand.exe",
"src\vcxproj\salamander\Release_x64\salamand.exe"
) "$StagingDir\"

$salmonCopied = Copy-Exe @(
"$BuildDir\salmon\Release_x64\utils\salmon.exe",
"$BuildDir\Release_x64\salmon.exe",
"$BuildDir\salmon.exe",
"src\vcxproj\salmon\salamander\Release_x64\utils\salmon.exe"
) "$StagingDir\"

$removeCopied = Copy-Exe @(
"$BuildDir\remove\Release_x64\remove.exe",
"$BuildDir\Release_x64\remove.exe",
"$BuildDir\remove.exe"
) "$StagingDir\"

if (-not $salamandCopied) { Write-Error "Could not find salamand.exe" }
if (-not $salmonCopied) { Write-Error "Could not find salmon.exe" }
if (-not $removeCopied) { Write-Error "Could not find remove.exe" }

# 3. Copy lang (main app)
Copy-Item "Installer\lang\*" "$StagingDir\lang\" -Recurse
Expand Down
Loading