diff --git a/src/LipUI/Models/Main.cs b/src/LipUI/Models/Main.cs index 61e5516..ae5e42c 100644 --- a/src/LipUI/Models/Main.cs +++ b/src/LipUI/Models/Main.cs @@ -46,11 +46,17 @@ private static void Initialize() private static void AutoUpdate() { - var autoupdateDir = Path.Combine(WorkingDirectory, ".autoupdate"); - if (Directory.Exists(autoupdateDir) is false) + var autoupdateDir = new DirectoryInfo(Path.Combine(ProgramDirectory, ".autoupdate")); + if (autoupdateDir.Exists is false) return; - Process.Start(Path.Combine(autoupdateDir, "AutoUpdate.exe"), "--type lip_postinstall"); + if (autoupdateDir.EnumerateFiles().Count() is 0) + { + autoupdateDir.Delete(); + return; + } + + Process.Start(Path.Combine(autoupdateDir.FullName, "AutoUpdate.exe"), "--type lip_postinstall"); Environment.Exit(0); } diff --git a/src/LipUI/Pages/Settings/SettingsAndAboutView.xaml.cs b/src/LipUI/Pages/Settings/SettingsAndAboutView.xaml.cs index 1012870..b0426de 100644 --- a/src/LipUI/Pages/Settings/SettingsAndAboutView.xaml.cs +++ b/src/LipUI/Pages/Settings/SettingsAndAboutView.xaml.cs @@ -50,7 +50,7 @@ await InternalServices.ShowInfoBarAsync( var args = @$"--type lipui_autoupdate --lip-path ""{path}"" --working-dir ""{Main.ProgramDirectory}"""; - await InternalServices.ShowInfoBarAsync( + InternalServices.ShowInfoBar( interval: TimeSpan.FromSeconds(3), message: $"Running {args}"); diff --git a/tooth.json b/tooth.json index b08ccbf..a932baf 100644 --- a/tooth.json +++ b/tooth.json @@ -1,7 +1,7 @@ { "format_version": 2, "tooth": "github.com/lippkg/LipUI", - "version": "0.4.5", + "version": "0.4.6", "info": { "name": "LipUI", "description": "A GUI client for lip", @@ -14,8 +14,12 @@ { "goos": "windows", "goarch": "amd64", - "asset_url": "https://github.com/lippkg/LipUI/releases/download/v0.4.5/LipUI-win-x64.zip", - "commands": {}, + "asset_url": "https://github.com/lippkg/LipUI/releases/download/v0.4.6/LipUI-win-x64.zip", + "commands": { + "post-install": [ + "./LipUI.exe" + ] + }, "files": { "place": [ { @@ -28,8 +32,12 @@ { "goos": "windows", "goarch": "arm64", - "asset_url": "https://github.com/lippkg/LipUI/releases/download/v0.4.5/LipUI-win-arm64.zip", - "commands": {}, + "asset_url": "https://github.com/lippkg/LipUI/releases/download/v0.4.6/LipUI-win-arm64.zip", + "commands": { + "post-install": [ + "./LipUI.exe" + ] + }, "files": { "place": [ {