Skip to content

Commit

Permalink
fix: v0.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Pd233 committed Mar 5, 2024
1 parent 82fe235 commit a0f3333
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
16 changes: 14 additions & 2 deletions src/LipUI/Models/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using LipUI.Pages.LipExecutionPanel;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;

Expand Down Expand Up @@ -40,9 +41,17 @@ private static void Initialize()
InitializeWorkingDir();
InitializeConfig();
InternalServices.WindowClosed += SaveConfig;
AutoUpdate();
}

private static void AutoUpdate()
{
var autoupdateDir = Path.Combine(WorkingDirectory, ".autoupdate");
if (Directory.Exists(autoupdateDir))
Directory.Delete(autoupdateDir);
if (Directory.Exists(autoupdateDir) is false)
return;

Process.Start(Path.Combine(autoupdateDir, "AutoUpdate.exe"), "--type lip_postinstall");
Environment.Exit(0);
}

[MemberNotNull(nameof(WorkingDirectory), nameof(ProgramDirectory))]
Expand Down Expand Up @@ -95,6 +104,9 @@ private static void InitializeConfig()
return (true, Config.GeneralSettings.LipPath);
else
{
if (Path.GetDirectoryName(Config.GeneralSettings.LipPath) != WorkingDirectory)
return (false, string.Empty);

var dialog = new ContentDialog()
{
XamlRoot = xamlRoot,
Expand Down
20 changes: 5 additions & 15 deletions tooth.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"format_version": 2,
"tooth": "github.com/lippkg/LipUI",
"version": "0.4.4",
"version": "0.4.5",
"info": {
"name": "LipUI",
"description": "A GUI client for lip",
Expand All @@ -14,13 +14,8 @@
{
"goos": "windows",
"goarch": "amd64",
"asset_url": "https://github.com/lippkg/LipUI/releases/download/v0.4.4/LipUI-win-x64.zip",
"commands": {
"post-install": [
"echo Copy files",
"IF EXIST .autoupdate/current_lipui_path.txt (.autoupdate/AutoUpdate.exe --type lip_postinstall)"
]
},
"asset_url": "https://github.com/lippkg/LipUI/releases/download/v0.4.5/LipUI-win-x64.zip",
"commands": {},
"files": {
"place": [
{
Expand All @@ -33,13 +28,8 @@
{
"goos": "windows",
"goarch": "arm64",
"asset_url": "https://github.com/lippkg/LipUI/releases/download/v0.4.4/LipUI-win-arm64.zip",
"commands": {
"post-install": [
"echo Copy files",
"IF EXIST .autoupdate/current_lipui_path.txt (.autoupdate/AutoUpdate.exe --type lip_postinstall)"
]
},
"asset_url": "https://github.com/lippkg/LipUI/releases/download/v0.4.5/LipUI-win-arm64.zip",
"commands": {},
"files": {
"place": [
{
Expand Down

0 comments on commit a0f3333

Please sign in to comment.