Skip to content

Commit

Permalink
自动更新
Browse files Browse the repository at this point in the history
  • Loading branch information
STBBRD committed Feb 9, 2024
1 parent 5f26d01 commit 47bdc7d
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 11 deletions.
12 changes: 11 additions & 1 deletion ZongziTEK_Blackboard_Sticker/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using System;
using System.Windows;
using System.Windows.Data;
using MessageBox = iNKORE.UI.WPF.Modern.Controls.MessageBox;
using AutoUpdaterDotNET;

namespace ZongziTEK_Blackboard_Sticker
{
Expand All @@ -25,9 +27,17 @@ void App_Startup(object sender, StartupEventArgs e)

if (!ret)
{
MessageBox.Show("已有一个黑板贴正在运行");
MessageBox.Show("已有一个黑板贴正在运行", "ZongziTEK 黑板贴", MessageBoxButton.OK, MessageBoxImage.Warning);
Environment.Exit(0);
}

// Auto Updater
AutoUpdater.PersistenceProvider = new JsonFilePersistenceProvider("AutoUpdater.json");
AutoUpdater.Start($"http://s.zztek.top:1573/zbsupdate.xml");
AutoUpdater.ApplicationExitEvent += () =>
{
Environment.Exit(0);
};
}
}

Expand Down
16 changes: 13 additions & 3 deletions ZongziTEK_Blackboard_Sticker/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -342,17 +342,27 @@
</GroupBox>
<GroupBox Header="关于" Foreground="{DynamicResource ForegroundColor}">
<ui:SimpleStackPanel Spacing="12">
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="4">
<TextBlock FontSize="14">
<Bold>当前版本:</Bold>
</TextBlock>
<TextBlock FontSize="14" Text="" Name="TextBlockVersion"/>
</ui:SimpleStackPanel>
<TextBlock FontSize="14" Foreground="{DynamicResource ForegroundColor}">
<Bold>开发者:</Bold>ZongziTEK
<LineBreak/>
<Bold>贡献者:</Bold>Puran Lai
<Bold>开发者:</Bold> ZongziTEK
</TextBlock>
<TextBlock FontSize="14">
<Bold>贡献者:</Bold> Puran Lai
</TextBlock>
<TextBlock FontSize="14" Foreground="{DynamicResource ForegroundColor}">
<Bold>开源地址:</Bold>
<Hyperlink Click="Hyperlink_Click">
<TextBlock Text="https://github.com/STBBRD/ZongziTEK-Blackboard-Sticker"></TextBlock>
</Hyperlink>
</TextBlock>
<TextBlock FontSize="14">
<Bold>开源协议:</Bold> GNU General Public License v3.0
</TextBlock>
</ui:SimpleStackPanel>
</GroupBox>
</ui:SimpleStackPanel>
Expand Down
5 changes: 5 additions & 0 deletions ZongziTEK_Blackboard_Sticker/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
using Page = System.Windows.Controls.Page;
using ZongziTEK_Blackboard_Sticker.Pages;
using System.Collections;
using System.Reflection;

namespace ZongziTEK_Blackboard_Sticker
{
Expand Down Expand Up @@ -94,6 +95,10 @@ public MainWindow()

//小黑板 2
CheckIsBlackboardLocked();

//显示版本号
Version version = Assembly.GetExecutingAssembly().GetName().Version;
TextBlockVersion.Text = version.ToString();
}
#region Window
private void window_StateChanged(object sender, EventArgs e)
Expand Down
12 changes: 6 additions & 6 deletions ZongziTEK_Blackboard_Sticker/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("ZongziTEK_Blackboard_Sticker")]
[assembly: AssemblyTitle("ZongziTEK 黑板贴")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ZongziTEK_Blackboard_Sticker")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyCompany("ZongziTEK")]
[assembly: AssemblyProduct("ZongziTEK Blackboard Sticker")]
[assembly: AssemblyCopyright("Copyright © ZongziTEK 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down Expand Up @@ -49,5 +49,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,11 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Autoupdater.NET.Official">
<Version>1.8.4</Version>
</PackageReference>
<PackageReference Include="iNKORE.UI.WPF.Modern">
<Version>0.9.24.1</Version>
<Version>0.9.26.1</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>13.0.3</Version>
Expand Down

0 comments on commit 47bdc7d

Please sign in to comment.