Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions dotnet/AstroForge.App/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down
81 changes: 81 additions & 0 deletions installer/AstroProjectForge.iss
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 :=
Expand All @@ -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);

Expand All @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions scripts/check-ui-contract.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down Expand Up @@ -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"')
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.1.1",
"version": "1.1.2",
"channel": "Stable",
"releaseDate": "2026-07-28",
"minimumWindowsBuild": 19045
Expand Down
Loading