Skip to content

Commit 2ba822e

Browse files
committed
release: Fix packages not being deleted.
1 parent bc78cf9 commit 2ba822e

File tree

4 files changed

+10
-23
lines changed

4 files changed

+10
-23
lines changed

src/Flarial.Launcher.Runtime/Versions/VersionItem.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,15 @@ public virtual async Task InstallAsync(Action<int, bool> callback)
3030
throw new Win32Exception((int)ERROR_UNSIGNED_PACKAGE_INVALID_CONTENT);
3131

3232
var path = Path.Combine(s_path, Path.GetRandomFileName());
33-
await HttpService.DownloadAsync(await GetUriAsync(), path, (_) => callback(_, false));
34-
await Task.Run(() => PackageService.Add(new(path), _ => callback(_, true)));
33+
try
34+
{
35+
await HttpService.DownloadAsync(await GetUriAsync(), path, (_) => callback(_, false));
36+
await Task.Run(() => PackageService.Add(new(path), _ => callback(_, true)));
37+
}
38+
finally
39+
{
40+
try { File.Delete(path); }
41+
catch { }
42+
}
3543
}
3644
}

src/Flarial.Launcher/Interface/Dialogs/UnsignedInstallDialog.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/Flarial.Launcher/Interface/MainDialog.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ internal async Task<ContentDialogResult> PromptAsync()
4343
internal static LaunchFailureDialog LaunchFailure => field ??= new();
4444
internal static SelectVersionDialog SelectVersion => field ??= new();
4545
internal static InstallVersionDialog InstallVersion => field ??= new();
46-
internal static UnsignedInstallDialog UnsignedInstall => field ??= new();
4746
internal static InvalidCustomDllDialog InvalidCustomDll => field ??= new();
4847
internal static ConnectionFailureDialog ConnectionFailure => field ??= new();
4948
internal static UnpackagedInstallDialog UnpackagedInstall => field ??= new();

src/Flarial.Launcher/Pages/HomePage.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,6 @@ async void OnButtonClick(object sender, RoutedEventArgs args)
115115
return;
116116
}
117117

118-
if (!Minecraft.IsPackaged)
119-
{
120-
if (!await MainDialog.UnsignedInstall.ShowAsync())
121-
return;
122-
}
123-
124118
if (!custom && !registry.IsSupported)
125119
{
126120
switch (await UnsupportedVersion.PromptAsync())

0 commit comments

Comments
 (0)