diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4bd98ce..f88cce8 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,11 @@ # AstroProject Forge — note di rilascio +## 1.1.2 — 28 luglio 2026 + +- Anche gli aggiornamenti avviati dalle versioni precedenti mostrano ora una finestra + di avanzamento compatibile, con fase corrente e percentuale. +- Le versioni recenti continuano a usare direttamente la finestra nativa di Inno Setup. + ## 1.1.1 — 28 luglio 2026 - Durante l'aggiornamento automatico Windows l'installer mostra ora una finestra con diff --git a/dotnet/AstroForge.App/MainWindow.xaml.cs b/dotnet/AstroForge.App/MainWindow.xaml.cs index 5288d65..24428b4 100644 --- a/dotnet/AstroForge.App/MainWindow.xaml.cs +++ b/dotnet/AstroForge.App/MainWindow.xaml.cs @@ -294,6 +294,7 @@ private async void DownloadUpdate_Click(object sender, RoutedEventArgs e) startInfo.ArgumentList.Add("/CLOSEAPPLICATIONS"); startInfo.ArgumentList.Add("/FORCECLOSEAPPLICATIONS"); startInfo.ArgumentList.Add("/APFUPDATE=1"); + startInfo.ArgumentList.Add("/APFVISIBLE=1"); startInfo.ArgumentList.Add($"/LOG={logPath}"); if (Process.Start(startInfo) is null) throw new InvalidOperationException("Impossibile avviare l'installer dell'aggiornamento."); diff --git a/installer/AstroProjectForge.iss b/installer/AstroProjectForge.iss index dba85fa..e20d8c1 100644 --- a/installer/AstroProjectForge.iss +++ b/installer/AstroProjectForge.iss @@ -56,6 +56,14 @@ DisableProgramGroupPage=yes Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl" Name: "english"; MessagesFile: "compiler:Default.isl" +[CustomMessages] +italian.UpdateProgressTitle=Aggiornamento di AstroProject Forge +italian.UpdateProgressDescription=Installazione in corso. L'app si riavvierà automaticamente. +italian.UpdateProgressPhase=Aggiornamento dei file… +english.UpdateProgressTitle=Updating AstroProject Forge +english.UpdateProgressDescription=Installation in progress. The app will restart automatically. +english.UpdateProgressPhase=Updating files… + [Tasks] Name: "desktopicon"; Description: "Crea un collegamento sul desktop"; GroupDescription: "Collegamenti aggiuntivi:"; Flags: unchecked @@ -84,6 +92,10 @@ Root: HKA; Subkey: "Software\Classes\AstroProjectForge.Project\shell\open\comman var LegacyInstallDirectories: TArrayOfString; LegacyUninstallRegistryKeys: TArrayOfString; + UpdateProgressForm: TSetupForm; + UpdateProgressBar: TNewProgressBar; + UpdateProgressLabel: TNewStaticText; + UpdatePercentLabel: TNewStaticText; function LegacyUninstallId(): String; begin @@ -146,6 +158,52 @@ begin Result := True; end; +function IsAutomaticUpdate(): Boolean; forward; + +function NeedsCompatibilityProgress(): Boolean; +begin + Result := + IsAutomaticUpdate() and + (CompareText(ExpandConstant('{param:APFVISIBLE|0}'), '1') <> 0); +end; + +procedure InitializeWizard(); +begin + if not NeedsCompatibilityProgress() then + Exit; + + UpdateProgressForm := CreateCustomForm(ScaleX(480), ScaleY(150), False, False); + UpdateProgressForm.Caption := ExpandConstant('{cm:UpdateProgressTitle}'); + UpdateProgressForm.Position := poScreenCenter; + + UpdateProgressLabel := TNewStaticText.Create(UpdateProgressForm); + UpdateProgressLabel.Parent := UpdateProgressForm; + UpdateProgressLabel.Left := ScaleX(24); + UpdateProgressLabel.Top := ScaleY(22); + UpdateProgressLabel.Width := ScaleX(432); + UpdateProgressLabel.Height := ScaleY(42); + UpdateProgressLabel.AutoSize := False; + UpdateProgressLabel.WordWrap := True; + UpdateProgressLabel.Caption := ExpandConstant('{cm:UpdateProgressDescription}'); + + UpdateProgressBar := TNewProgressBar.Create(UpdateProgressForm); + UpdateProgressBar.Parent := UpdateProgressForm; + UpdateProgressBar.Left := ScaleX(24); + UpdateProgressBar.Top := ScaleY(82); + UpdateProgressBar.Width := ScaleX(432); + UpdateProgressBar.Height := ScaleY(18); + UpdateProgressBar.Min := 0; + UpdateProgressBar.Max := 100; + + UpdatePercentLabel := TNewStaticText.Create(UpdateProgressForm); + UpdatePercentLabel.Parent := UpdateProgressForm; + UpdatePercentLabel.Left := ScaleX(24); + UpdatePercentLabel.Top := ScaleY(111); + UpdatePercentLabel.Width := ScaleX(432); + UpdatePercentLabel.Alignment := taCenter; + UpdatePercentLabel.Caption := ExpandConstant('{cm:UpdateProgressPhase}'); +end; + function ShouldCreateDesktopIcon(): Boolean; begin Result := @@ -171,8 +229,17 @@ procedure CurStepChanged(CurStep: TSetupStep); var Index: Integer; begin + if (UpdateProgressForm <> nil) and (CurStep = ssInstall) then + begin + UpdateProgressForm.Show(); + UpdateProgressForm.Update(); + end; + if CurStep = ssPostInstall then begin + if UpdateProgressForm <> nil then + UpdateProgressForm.Hide(); + for Index := 0 to GetArrayLength(LegacyInstallDirectories) - 1 do DelTree(LegacyInstallDirectories[Index], True, True, True); @@ -181,6 +248,20 @@ begin end; end; +procedure CurInstallProgressChanged(CurProgress, MaxProgress: Integer); +var + Percent: Integer; +begin + if (UpdateProgressForm = nil) or (MaxProgress <= 0) then + Exit; + + Percent := (CurProgress * 100) div MaxProgress; + UpdateProgressBar.Position := Percent; + UpdatePercentLabel.Caption := + ExpandConstant('{cm:UpdateProgressPhase}') + ' ' + IntToStr(Percent) + '%'; + UpdateProgressForm.Update(); +end; + function InitializeUninstall(): Boolean; var Choice: Integer; diff --git a/scripts/check-ui-contract.ps1 b/scripts/check-ui-contract.ps1 index bcf1ef2..2758f71 100644 --- a/scripts/check-ui-contract.ps1 +++ b/scripts/check-ui-contract.ps1 @@ -10,6 +10,7 @@ $wpfCodePath = Join-Path $root 'dotnet\AstroForge.App\MainWindow.xaml.cs' $avaloniaCodePath = Join-Path $root 'dotnet\AstroForge.CrossPlatform\MainWindow.axaml.cs' $wpfAdapterPath = Join-Path $root 'dotnet\AstroForge.App\Services\WpfLocalizationAdapter.cs' $avaloniaAdapterPath = Join-Path $root 'dotnet\AstroForge.CrossPlatform\AvaloniaLocalizationAdapter.cs' +$installerPath = Join-Path $root 'installer\AstroProjectForge.iss' function Read-Raw([string]$Path) { if (-not (Test-Path -LiteralPath $Path)) { throw "File mancante: $Path" } @@ -44,6 +45,7 @@ $wpfCode = Read-Raw $wpfCodePath $avaloniaCode = Read-Raw $avaloniaCodePath $wpfAdapter = Read-Raw $wpfAdapterPath $avaloniaAdapter = Read-Raw $avaloniaAdapterPath +$installer = Read-Raw $installerPath $contracts = @{ 'WPF preview keyboard handler' = $wpfXaml.Contains('PreviewKeyDown="Window_PreviewKeyDown"') @@ -54,6 +56,7 @@ $contracts = @{ 'Save and Save As behavior (WPF)' = $wpfCode.Contains('SaveProject(bool saveAs)') 'Save and Save As behavior (Avalonia)' = $avaloniaCode.Contains('SaveProjectAsync(bool saveAs)') 'Visible Windows update progress' = $wpfCode.Contains('startInfo.ArgumentList.Add("/SILENT")') -and -not $wpfCode.Contains('startInfo.ArgumentList.Add("/VERYSILENT")') + 'Visible progress from legacy updaters' = $wpfCode.Contains('startInfo.ArgumentList.Add("/APFVISIBLE=1")') -and $installer.Contains('CurInstallProgressChanged') -and $installer.Contains('NeedsCompatibilityProgress') } $failed = @($contracts.GetEnumerator() | Where-Object { -not $_.Value } | ForEach-Object Key) diff --git a/version.json b/version.json index 8b62a0e..1b2b99c 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { - "version": "1.1.1", + "version": "1.1.2", "channel": "Stable", "releaseDate": "2026-07-28", "minimumWindowsBuild": 19045