Loading...
Loading...
Builds Windows executables (x64 and ARM64) for XerahS using the packaging script. Handles common file locking issues during compilation by killing processes, clearing locks, and using single-threaded builds when needed. Ensures successful creation of Inno Setup installers.
npx skill4agent add sharex/xerahs build-windows-execd 'ShareX Team\XerahS'
git submodule update --remote --merge ImageEditorGet-Process | Where-Object {
$_.Name -like '*XerahS*' -or
$_.Name -like '*dotnet*' -or
$_.Name -like '*MSBuild*' -or
$_.Name -like '*VBCSCompiler*'
} | Stop-Process -Force -ErrorAction SilentlyContinuecd 'ShareX Team\XerahS'
dotnet clean src/desktop/XerahS.sln --nologo -c ReleaseRemove-Item 'ShareX Team\XerahS\ImageEditor\src\ShareX.ImageEditor\obj' -Recurse -Force -ErrorAction SilentlyContinuecd 'ShareX Team\XerahS\build\windows'
.\package-windows.ps1distCS2012: Cannot open '...ShareX.ImageEditor.dll' for writingThe process cannot access the file ... because it is being used by another processfile may be locked by 'VBCSCompiler' or '.NET Host' or 'csc'Get-Process | Where-Object {
$_.Name -like '*VBCSCompiler*' -or
$_.Name -like '*dotnet*' -or
$_.Name -like '*csc*'
} | Stop-Process -Force -ErrorAction SilentlyContinue
Start-Sleep -Seconds 2Remove-Item 'ShareX Team\XerahS\ImageEditor\src\ShareX.ImageEditor\obj\Release' -Recurse -Force -ErrorAction SilentlyContinuedotnet build 'ShareX Team\XerahS\ImageEditor\src\ShareX.ImageEditor\ShareX.ImageEditor.csproj' -c Release -p:UseSharedCompilation=false /m:1/m:1UseSharedCompilation=falsecd 'ShareX Team\XerahS\build\windows'
.\package-windows.ps1Get-Process | Where-Object { $_.Name -like '*VBCSCompiler*' -or $_.Name -like '*dotnet*' } | Stop-Process -Force -ErrorAction SilentlyContinue
Remove-Item 'ShareX Team\XerahS\ImageEditor\src\ShareX.ImageEditor\obj\Release' -Recurse -Force -ErrorAction SilentlyContinuedotnet build 'ShareX Team\XerahS\ImageEditor\src\ShareX.ImageEditor\ShareX.ImageEditor.csproj' -c Release -p:UseSharedCompilation=false /m:1$root = 'ShareX Team\XerahS'
$project = "$root\src\desktop\app\XerahS.App\XerahS.App.csproj"
$publishOutput = "$root\build\publish-temp-win-arm64"
dotnet publish $project -c Release -p:OS=Windows_NT -r win-arm64 -p:PublishSingleFile=false -p:SkipBundlePlugins=true -p:UseSharedCompilation=false --self-contained true -o $publishOutput$pluginsDir = "$publishOutput\Plugins"
New-Item -ItemType Directory -Force -Path $pluginsDir | Out-Null
Get-ChildItem "$root\src\desktop\plugins" -Filter "*.csproj" -Recurse | ForEach-Object {
$pluginId = $_.BaseName
$pluginJsonPath = Join-Path $_.Directory.FullName "plugin.json"
if (Test-Path $pluginJsonPath) {
$json = Get-Content $pluginJsonPath -Raw | ConvertFrom-Json
if ($json.pluginId) { $pluginId = $json.pluginId }
}
Write-Host "Publishing plugin: $pluginId"
dotnet publish $_.FullName -c Release -r win-arm64 -p:UseSharedCompilation=false --self-contained false -o "$pluginsDir\$pluginId"
}$isccPath = "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe"
$issScript = "$root\build\windows\XerahS-setup.iss"
$version = ([xml](Get-Content "$root\Directory.Build.props")).SelectSingleNode("//Version").InnerText.Trim()
$outputDir = "$root\dist"
& $isccPath "/dMyAppReleaseDirectory=$publishOutput" "/dOutputBaseFilename=XerahS-$version-win-arm64" "/dOutputDir=$outputDir" $issScriptGet-ChildItem 'ShareX Team\XerahS\dist' -Filter '*.exe' | Select-Object Name, Length, LastWriteTime | Format-Table -AutoSizeName Length LastWriteTime
---- ------ -------------
XerahS-{version}-win-arm64.exe ~55-60MB [Today's date]
XerahS-{version}-win-x64.exe ~55-60MB [Today's date]net9.0net10.0net9.0-windows10.0.26100.0net10.0-windows10.0.26100.0ShareX.ImageEditor.dllCS2012package-windows.ps1win-x64win-arm64foreach/m:1dotnet publishdotnet build-server shutdown-p:UseSharedCompilation=false-p:nodeReuse=false/m:1-p:SkipBundlePlugins=true| Symptom | Solution |
|---|---|
| "XerahS.exe" does not exist (Inno Setup) | The main app didn't publish; check for earlier build errors |
| CS2012 file lock error | Kill VBCSCompiler, delete obj folder, rebuild with |
| Installer created but old timestamp | Build failed silently; check logs in |
| Only x64 succeeds, ARM64 fails | Use Phase 4 manual ARM64 build process |
| All builds fail | Clean solution, restart terminal, ensure no XerahS instances running |
build/windows/iscc_log_win-{arch}.txt