Skip to content

Commit faf7c5e

Browse files
authored
0.8.20 - an update comes back as the same copy it was (#34)
Found by running a real 0.8.18 and watching it update to 0.8.19.
2 parents 48adba1 + d0555ca commit faf7c5e

3 files changed

Lines changed: 34 additions & 4 deletions

File tree

Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
<Copyright>Copyright © nekron</Copyright>
1111
<Description>A pilot's logbook for Star Citizen: second-screen dashboard, in-game overlay, and flight-log analysis for Star Citizen, driven by Game.log.</Description>
1212

13-
<Version>0.8.19</Version>
14-
<AssemblyVersion>0.8.19.0</AssemblyVersion>
15-
<FileVersion>0.8.19.0</FileVersion>
13+
<Version>0.8.20</Version>
14+
<AssemblyVersion>0.8.20.0</AssemblyVersion>
15+
<FileVersion>0.8.20.0</FileVersion>
1616

1717
<RepositoryUrl>https://github.com/peans99/QuantumWake</RepositoryUrl>
1818
<PackageProjectUrl>https://github.com/peans99/QuantumWake</PackageProjectUrl>

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,13 @@ affiliated with or endorsed by Cloud Imperium Games.
353353
Newest first. Each version's section is what the GitHub release says too — the
354354
release workflow lifts it from here, so it is written once.
355355

356+
### 0.8.20
357+
358+
- **An update keeps the settings it was started with.** Restarting after an
359+
update dropped any `--data`, `--path` or `-Lan` given on the command line,
360+
so a copy deliberately pointed at its own folder came back pointed at the
361+
default one. It now comes back as the same copy it was.
362+
356363
### 0.8.19
357364

358365
- **The update button says what the download costs.** Ninety megabytes is

src/Quantumwake.Overlay/App.xaml.cs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public partial class App : System.Windows.Application
3030
private const string DashboardUrl = "http://127.0.0.1:31337/";
3131

3232
private WebApplication? _server;
33+
private string[] _arguments = [];
3334
private TrayPresence? _tray;
3435
private MainWindow? _overlay;
3536
private Settings _settings = new();
@@ -45,6 +46,10 @@ protected override async void OnStartup(StartupEventArgs e)
4546

4647
// Before Settings.Load, so --data moves the whole app - overlay
4748
// preferences and WebView2 profile included - and not just the server.
49+
// Kept for Restart: an update replaces the file and starts it again,
50+
// and it has to come back as the same copy rather than the default one.
51+
_arguments = e.Args;
52+
4853
Core.AppPaths.UseFromArguments(e.Args);
4954

5055
_settings = Settings.Load();
@@ -170,11 +175,29 @@ private void PickInstallFolder()
170175
Restart();
171176
}
172177

178+
/// <summary>
179+
/// Starts this application again and stands down.
180+
/// </summary>
181+
/// <remarks>
182+
/// The arguments come too. Dropping them looks harmless because most people
183+
/// pass none, but --data moves every store and --path names the install, so
184+
/// a restart without them silently points a second copy at the default
185+
/// folder - somebody else's real data, if this one was deliberately kept
186+
/// away from it. Found by updating a copy running on --data and watching the
187+
/// new process come back with none.
188+
/// </remarks>
173189
private void Restart()
174190
{
175191
var exe = Environment.ProcessPath;
192+
176193
if (exe is not null)
177-
Process.Start(new ProcessStartInfo(exe) { UseShellExecute = true });
194+
{
195+
var start = new ProcessStartInfo(exe) { UseShellExecute = true };
196+
foreach (var argument in _arguments)
197+
start.ArgumentList.Add(argument);
198+
199+
Process.Start(start);
200+
}
178201

179202
Quit();
180203
}

0 commit comments

Comments
 (0)