mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-20 23:54:26 +08:00
Add automatic release version stamping and multiple launcher reliability improvements. The Release workflow now runs scripts/Set-ReleaseVersion.ps1 in build jobs to inject tag-derived Version/AssemblyVersion into project metadata; several .csproj/Directory.Build.props and app.manifest files were changed to use a dev placeholder. Introduced AppVersionProvider (and related runtime metadata) to centralize version resolution and updated DeploymentLocator to use it and to prefer package-root/version.json. Launcher startup flow was hardened: added startup success tracking, public-activation recovery path, improved success/fallback semantics, and related IPC handling. UI/UX fixes include OOBE entrance/exit animation improvements (scaling-aware, concurrent fade+translate) and minor window lifecycle reorder in DesktopShellHost. CommandContext now recognizes restart and key=value args. New DesktopTrayService and .trae spec files (spec, checklist, tasks) document shell/tray hardening work. Miscellaneous logging, comments and housekeeping edits across launcher and shared contracts to support the above.
57 lines
1.8 KiB
PowerShell
57 lines
1.8 KiB
PowerShell
param(
|
|
[Parameter(Mandatory = $true)]
|
|
[string]$Version,
|
|
|
|
[Parameter(Mandatory = $true)]
|
|
[string]$AssemblyVersion
|
|
)
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
function Update-XmlNodeValue {
|
|
param(
|
|
[Parameter(Mandatory = $true)]
|
|
[string]$Path,
|
|
|
|
[Parameter(Mandatory = $true)]
|
|
[string]$XPath,
|
|
|
|
[Parameter(Mandatory = $true)]
|
|
[string]$Value,
|
|
|
|
[hashtable]$NamespaceMap = @{}
|
|
)
|
|
|
|
[xml]$document = Get-Content -Path $Path -Raw
|
|
$navigator = $document.CreateNavigator()
|
|
$namespaceManager = New-Object System.Xml.XmlNamespaceManager($navigator.NameTable)
|
|
foreach ($entry in $NamespaceMap.GetEnumerator()) {
|
|
$namespaceManager.AddNamespace($entry.Key, $entry.Value)
|
|
}
|
|
|
|
$node = $document.SelectSingleNode($XPath, $namespaceManager)
|
|
if ($null -eq $node) {
|
|
throw "Node '$XPath' was not found in '$Path'."
|
|
}
|
|
|
|
$node.InnerText = $Value
|
|
$document.Save($Path)
|
|
}
|
|
|
|
$projectFiles = @(
|
|
'Directory.Build.props',
|
|
'LanMountainDesktop/LanMountainDesktop.csproj',
|
|
'LanMountainDesktop.Launcher/LanMountainDesktop.Launcher.csproj',
|
|
'LanMountainDesktop.Shared.Contracts/LanMountainDesktop.Shared.Contracts.csproj'
|
|
)
|
|
|
|
foreach ($projectFile in $projectFiles) {
|
|
Update-XmlNodeValue -Path $projectFile -XPath '/Project/PropertyGroup/Version' -Value $Version
|
|
}
|
|
|
|
$manifestNamespace = @{ asm = 'urn:schemas-microsoft-com:asm.v1' }
|
|
Update-XmlNodeValue -Path 'LanMountainDesktop/app.manifest' -XPath '/asm:assembly/asm:assemblyIdentity/@version' -Value $AssemblyVersion -NamespaceMap $manifestNamespace
|
|
Update-XmlNodeValue -Path 'LanMountainDesktop.Launcher/app.manifest' -XPath '/asm:assembly/asm:assemblyIdentity/@version' -Value $AssemblyVersion -NamespaceMap $manifestNamespace
|
|
|
|
Write-Host "Stamped release version metadata. Version=$Version AssemblyVersion=$AssemblyVersion"
|