diff --git a/src/AutoUpdate/Program.cs b/src/AutoUpdate/Program.cs index c9f0f08..ca8dc38 100644 --- a/src/AutoUpdate/Program.cs +++ b/src/AutoUpdate/Program.cs @@ -1,7 +1,6 @@ using Microsoft.Extensions.Logging; using System.CommandLine; using System.Diagnostics; -using System.Text; using var factory = LoggerFactory.Create(builder => builder.AddConsole()); var logger = factory.CreateLogger("AutoUpdate"); diff --git a/src/LipUI/Models/Main.cs b/src/LipUI/Models/Main.cs index ae5e42c..1ffddeb 100644 --- a/src/LipUI/Models/Main.cs +++ b/src/LipUI/Models/Main.cs @@ -41,24 +41,31 @@ private static void Initialize() InitializeWorkingDir(); InitializeConfig(); InternalServices.WindowClosed += SaveConfig; - AutoUpdate(); + //AutoUpdate(); } - private static void AutoUpdate() - { - var autoupdateDir = new DirectoryInfo(Path.Combine(ProgramDirectory, ".autoupdate")); - if (autoupdateDir.Exists is false) - return; - - if (autoupdateDir.EnumerateFiles().Count() is 0) - { - autoupdateDir.Delete(); - return; - } - - Process.Start(Path.Combine(autoupdateDir.FullName, "AutoUpdate.exe"), "--type lip_postinstall"); - Environment.Exit(0); - } + //private static void AutoUpdate() + //{ + // var autoupdateDir = new DirectoryInfo(Path.Combine(ProgramDirectory, ".autoupdate")); + // if (autoupdateDir.Exists is false) + // return; + + // if (autoupdateDir.EnumerateFiles().Count() is 0) + // { + // autoupdateDir.Delete(); + // return; + // } + + // var process = new Process() + // { + // StartInfo = new(Path.Combine(autoupdateDir.FullName, "AutoUpdate.exe")) + // { + // Arguments = "--type lip_postinstall" + // } + // }; + // process.Start(); + // Environment.Exit(0); + //} [MemberNotNull(nameof(WorkingDirectory), nameof(ProgramDirectory))] private static void InitializeWorkingDir() diff --git a/src/LipUI/Pages/Settings/SettingsAndAboutView.xaml.cs b/src/LipUI/Pages/Settings/SettingsAndAboutView.xaml.cs index b0426de..a601f1f 100644 --- a/src/LipUI/Pages/Settings/SettingsAndAboutView.xaml.cs +++ b/src/LipUI/Pages/Settings/SettingsAndAboutView.xaml.cs @@ -48,15 +48,21 @@ await InternalServices.ShowInfoBarAsync( return; } - var args = @$"--type lipui_autoupdate --lip-path ""{path}"" --working-dir ""{Main.ProgramDirectory}"""; + var args = "install --yes --force-reinstall --no-dependencies github.com/lippkg/LipUI"; InternalServices.ShowInfoBar( interval: TimeSpan.FromSeconds(3), message: $"Running {args}"); - Process.Start( - Path.Combine(Main.ProgramDirectory, "AutoUpdate.exe"), args); - + var process = new Process() + { + StartInfo = new(path) + { + WorkingDirectory = Main.ProgramDirectory, + Arguments = args, + } + }; + process.Start(); Environment.Exit(0); } } diff --git a/tooth.json b/tooth.json index a932baf..022ec43 100644 --- a/tooth.json +++ b/tooth.json @@ -15,16 +15,12 @@ "goos": "windows", "goarch": "amd64", "asset_url": "https://github.com/lippkg/LipUI/releases/download/v0.4.6/LipUI-win-x64.zip", - "commands": { - "post-install": [ - "./LipUI.exe" - ] - }, + "commands": {}, "files": { "place": [ { "src": "lipui/*", - "dest": ".autoupdate" + "dest": "./" } ] } @@ -33,16 +29,12 @@ "goos": "windows", "goarch": "arm64", "asset_url": "https://github.com/lippkg/LipUI/releases/download/v0.4.6/LipUI-win-arm64.zip", - "commands": { - "post-install": [ - "./LipUI.exe" - ] - }, + "commands": {}, "files": { "place": [ { "src": "lipui/*", - "dest": ".autoupdate" + "dest": "./" } ] }