diff --git a/.github/workflows/fw-lite.yaml b/.github/workflows/fw-lite.yaml index 5b3c2ccc9..28b3252d5 100644 --- a/.github/workflows/fw-lite.yaml +++ b/.github/workflows/fw-lite.yaml @@ -172,16 +172,14 @@ jobs: - name: Publish Windows MAUI portable app working-directory: backend/FwLite/FwLiteDesktop run: | - dotnet publish -r win-x64 --artifacts-path ../artifacts -p:WindowsPackageType=None -p:ApplicationDisplayVersion=${{ needs.build-and-test.outputs.semver-version }} - dotnet publish -r win-arm64 --artifacts-path ../artifacts -p:WindowsPackageType=None -p:ApplicationDisplayVersion=${{ needs.build-and-test.outputs.semver-version }} + dotnet publish -r win-x64 --artifacts-path ../artifacts -p:WindowsPackageType=None -p:ApplicationDisplayVersion=${{ needs.build-and-test.outputs.semver-version }} -p:InformationalVersion=${{ needs.build-and-test.outputs.version }} mkdir -p ../artifacts/sign/portable cp -r ../artifacts/publish/FwLiteDesktop/* ../artifacts/sign/portable/ - name: Publish Windows MAUI msix app working-directory: backend/FwLite/FwLiteDesktop run: | - dotnet publish -r win-x64 --artifacts-path ../artifacts -p:ApplicationDisplayVersion=${{ needs.build-and-test.outputs.semver-version }} - dotnet publish -r win-arm64 --artifacts-path ../artifacts -p:ApplicationDisplayVersion=${{ needs.build-and-test.outputs.semver-version }} + dotnet publish -r win-x64 --artifacts-path ../artifacts -p:ApplicationDisplayVersion=${{ needs.build-and-test.outputs.semver-version }} -p:InformationalVersion=${{ needs.build-and-test.outputs.version }} mkdir -p ../artifacts/msix cp ../artifacts/bin/FwLiteDesktop/*/AppPackages/*/*.msix ../artifacts/msix/ diff --git a/backend/FwLite/FwDataMiniLcmBridge/FwDataMiniLcmBridge.csproj b/backend/FwLite/FwDataMiniLcmBridge/FwDataMiniLcmBridge.csproj index dd6ae3743..cd3878b24 100644 --- a/backend/FwLite/FwDataMiniLcmBridge/FwDataMiniLcmBridge.csproj +++ b/backend/FwLite/FwDataMiniLcmBridge/FwDataMiniLcmBridge.csproj @@ -1,8 +1,7 @@  - $(ApplicationDisplayVersion) - $(ApplicationDisplayVersion) + $(ApplicationDisplayVersion) diff --git a/backend/FwLite/FwLiteDesktop/AppVersion.cs b/backend/FwLite/FwLiteDesktop/AppVersion.cs index 16f9f3421..b6ac0424c 100644 --- a/backend/FwLite/FwLiteDesktop/AppVersion.cs +++ b/backend/FwLite/FwLiteDesktop/AppVersion.cs @@ -4,6 +4,17 @@ namespace FwLiteDesktop; public class AppVersion { - public static readonly string Version = typeof(AppVersion).Assembly - .GetCustomAttribute()?.InformationalVersion ?? "dev"; + static AppVersion() + { + var infoVersion = typeof(AppVersion).Assembly + .GetCustomAttribute()?.InformationalVersion; + //info version may look like v2024-12-12-3073dd1c+3073dd1ce2ff5510f54a9411366f55c958b9ea45. We want to strip off everything after the +, so we can compare versions + if (infoVersion is not null && infoVersion.Contains('+')) + { + infoVersion = infoVersion[..infoVersion.IndexOf('+')]; + } + Version = infoVersion ?? "dev"; + } + + public static readonly string Version; } diff --git a/backend/FwLite/FwLiteDesktop/FwLiteDesktop.csproj b/backend/FwLite/FwLiteDesktop/FwLiteDesktop.csproj index d37d8b546..f3e46e10c 100644 --- a/backend/FwLite/FwLiteDesktop/FwLiteDesktop.csproj +++ b/backend/FwLite/FwLiteDesktop/FwLiteDesktop.csproj @@ -33,14 +33,12 @@ 1.0 1 - - $(ApplicationDisplayVersion) 11.0 13.1 21.0 - 10.0.17763.0 - 10.0.17763.0 + 10.0.19041.0 + 10.0.19041.0 6.5 diff --git a/backend/FwLite/FwLiteDesktop/Platforms/Windows/AppUpdateService.cs b/backend/FwLite/FwLiteDesktop/Platforms/Windows/AppUpdateService.cs index ca8b0ba2b..bf0e9721d 100644 --- a/backend/FwLite/FwLiteDesktop/Platforms/Windows/AppUpdateService.cs +++ b/backend/FwLite/FwLiteDesktop/Platforms/Windows/AppUpdateService.cs @@ -45,14 +45,24 @@ private async Task TryUpdate() private async Task ApplyUpdate(FwLiteRelease latestRelease) { - logger.LogInformation("New version available: {Version}", latestRelease.Version); + logger.LogInformation("New version available: {Version}, Current version: {CurrentVersion}", latestRelease.Version, AppVersion.Version); var packageManager = new PackageManager(); - var asyncOperation = packageManager.AddPackageAsync(new Uri(latestRelease.Url), [], DeploymentOptions.None); + var asyncOperation = packageManager.AddPackageByUriAsync(new Uri(latestRelease.Url), + new AddPackageOptions() + { + DeferRegistrationWhenPackagesAreInUse = true, + ForceUpdateFromAnyVersion = true + }); asyncOperation.Progress = (info, progressInfo) => { + if (progressInfo.state == DeploymentProgressState.Queued) + { + logger.LogInformation("Queued update"); + return; + } logger.LogInformation("Downloading update: {ProgressPercentage}%", progressInfo.percentage); }; - var result = await asyncOperation.AsTask(); + var result = await asyncOperation; if (!string.IsNullOrEmpty(result.ErrorText)) { logger.LogError(result.ExtendedErrorCode, "Failed to download update: {ErrorText}", result.ErrorText); diff --git a/backend/FwLite/FwLiteProjectSync/FwLiteProjectSync.csproj b/backend/FwLite/FwLiteProjectSync/FwLiteProjectSync.csproj index 8cbde01b8..2b3a8d940 100644 --- a/backend/FwLite/FwLiteProjectSync/FwLiteProjectSync.csproj +++ b/backend/FwLite/FwLiteProjectSync/FwLiteProjectSync.csproj @@ -1,7 +1,6 @@  - $(ApplicationDisplayVersion) $(ApplicationDisplayVersion) diff --git a/backend/FwLite/LcmCrdt/LcmCrdt.csproj b/backend/FwLite/LcmCrdt/LcmCrdt.csproj index 66bd926ff..cbd1fa603 100644 --- a/backend/FwLite/LcmCrdt/LcmCrdt.csproj +++ b/backend/FwLite/LcmCrdt/LcmCrdt.csproj @@ -1,7 +1,6 @@  - $(ApplicationDisplayVersion) $(ApplicationDisplayVersion) diff --git a/backend/FwLite/LocalWebApp/LocalWebApp.csproj b/backend/FwLite/LocalWebApp/LocalWebApp.csproj index 6b480b782..14c3dbd0a 100644 --- a/backend/FwLite/LocalWebApp/LocalWebApp.csproj +++ b/backend/FwLite/LocalWebApp/LocalWebApp.csproj @@ -5,7 +5,6 @@ true false true - $(ApplicationDisplayVersion) $(ApplicationDisplayVersion) diff --git a/backend/FwLite/MiniLcm/MiniLcm.csproj b/backend/FwLite/MiniLcm/MiniLcm.csproj index e806ed4ff..3a89c7e9e 100644 --- a/backend/FwLite/MiniLcm/MiniLcm.csproj +++ b/backend/FwLite/MiniLcm/MiniLcm.csproj @@ -1,7 +1,6 @@  - $(ApplicationDisplayVersion) $(ApplicationDisplayVersion)