Skip to content

Offer explorer.exe restart instead of full reboot on uninstall #216

Offer explorer.exe restart instead of full reboot on uninstall

Offer explorer.exe restart instead of full reboot on uninstall #216

name: Build Windows projects and create Inno Setup installer
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
workflow_dispatch: {}
jobs:
build-and-package:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Restore NuGet packages
run: nuget restore Convertster.sln
- name: Build any solution (MSBuild if .sln exists)
shell: powershell
run: |
$sln = Get-ChildItem -Path . -Filter *.sln -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1
if ($null -ne $sln) {
Write-Host "Found solution: $($sln.FullName). Building with MSBuild..."
msbuild $sln.FullName /p:Configuration=Release /p:Platform=x64
} else {
Write-Host "No .sln found; skipping MSBuild step."
}
# FlaUI tests are not passing in GitHub Actions.
- name: Run tests
shell: powershell
run: |
$testDll = "ImageConverter.Tests\bin\Release\ImageConverter.Tests.dll"
if (Test-Path $testDll) {
Write-Host "Running tests from $testDll"
# Find vstest.console.exe using vswhere
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vsPath = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.ManagedDesktop.Core -property installationPath
$vstest = Join-Path $vsPath "Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"
if (Test-Path $vstest) {
Write-Host "Found vstest at: $vstest"
& $vstest $testDll /Logger:trx /TestCaseFilter:"TestCategory!=UI"
} else {
Write-Error "vstest.console.exe not found"
exit 1
}
} else {
Write-Host "Test assembly not found at $testDll, skipping tests"
}
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: TestResults/*.trx
- name: Download installation prerequisites
shell: powershell
run: |
New-Item -ItemType Directory -Force -Path Installer\Prerequisites | Out-Null
$out = 'Installer\Prerequisites\VC_redist.x64.exe'
Write-Host "Downloading VC++ redistributable to $out"
Invoke-WebRequest -Uri 'https://aka.ms/vs/17/release/vc_redist.x64.exe' -OutFile $out
if (-Not (Test-Path $out)) { Write-Error "Failed to download $out" }
- name: Build Inno Setup installer
shell: powershell
run: |
cd Installer
& ISCC.exe -Q "Installer.iss"
- name: Upload installer artifact
uses: actions/upload-artifact@v4
with:
name: installer
path: |
Installer/Output/Convertster-1.2-Setup.exe
- name: Upload build logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-logs
path: |
**/*.log
**/msbuild*.log