diff --git a/src/NxEditor.Launcher/Helpers/AppUpdater.cs b/src/NxEditor.Launcher/Helpers/AppUpdater.cs index 5374ba0..442be31 100644 --- a/src/NxEditor.Launcher/Helpers/AppUpdater.cs +++ b/src/NxEditor.Launcher/Helpers/AppUpdater.cs @@ -20,10 +20,13 @@ public class AppUpdater public static bool IsInstalled => File.Exists(_versionFile); - public static async Task Install(bool addToPath = true) + public static async Task Install(bool addToPath = true, bool createShortcuts = true) { CopyRunningLauncherToOutput(); - CreateDesktopShortcuts(); + if (createShortcuts) { + CreateDesktopShortcuts(); + } + Directory.CreateDirectory(_outputPath); (Stream stream, string tag) = await GithubHelper.GetRelease(GITHUB_ORG, GITHUB_REPO, _zipFileName); diff --git a/src/NxEditor.Launcher/ViewModels/ShellViewModel.cs b/src/NxEditor.Launcher/ViewModels/ShellViewModel.cs index bb508c5..0b49e66 100644 --- a/src/NxEditor.Launcher/ViewModels/ShellViewModel.cs +++ b/src/NxEditor.Launcher/ViewModels/ShellViewModel.cs @@ -34,6 +34,9 @@ public partial class ShellViewModel : ObservableObject [ObservableProperty] private bool _isLoading = false; + [ObservableProperty] + private bool _createShortcuts = true; + [ObservableProperty] private ObservableCollection _plugins = new(PluginManager.GetPluginInfo()); @@ -81,7 +84,7 @@ public async Task InstallUpdates() IsLoading = true; if (_canUpdate) { - await AppUpdater.Install(); + await AppUpdater.Install(createShortcuts: CreateShortcuts); } await PluginUpdater.InstallAll(Plugins); @@ -95,7 +98,10 @@ public async Task PrimaryButton() { IsLoading = true; if (IsEditorInstalled) { - await PluginUpdater.InstallAll(Plugins); + await Task.Run(async () => { + await PluginUpdater.InstallAll(Plugins); + }); + Process.Start( Path.Combine(GlobalConfig.StaticPath, "bin", PlatformHelper.GetExecutableName()) ); @@ -105,8 +111,10 @@ public async Task PrimaryButton() } - await AppUpdater.Install(); - await PluginUpdater.InstallAll(Plugins); + await Task.Run(async () => { + await AppUpdater.Install(createShortcuts: CreateShortcuts); + await PluginUpdater.InstallAll(Plugins); + }); IsEditorInstalled = true; PrimaryButtonContent = "Open NX Editor"; diff --git a/src/NxEditor.Launcher/Views/ShellView.axaml b/src/NxEditor.Launcher/Views/ShellView.axaml index 81a00d3..4de1ff6 100644 --- a/src/NxEditor.Launcher/Views/ShellView.axaml +++ b/src/NxEditor.Launcher/Views/ShellView.axaml @@ -1,40 +1,44 @@ - + - + - + - + @@ -42,60 +46,73 @@ - - - - + + + + - + - - + + +