跳到主要内容

github/tai

公开

Tai · Windows 软件与网站使用时长统计。上游 Planshit/Tai 的源码镜像,非灵栈原创;MIT 许可。来源:https://github.com/Planshit/Tai 。本次为手动同步,暂不提供安装包。

提交记录
修改Tai.sln+10 −0看文件
@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UI", "UI\UI.csproj", "{2427
99EndProject
1010Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TaiBug", "TaiBug\TaiBug.csproj", "{758D59B2-C438-4DE4-B135-7FF0614FE4B7}"
1111EndProject
12新增:Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Updater", "Updater\Updater.csproj", "{7A2F2592-3079-441C-8704-E71CE75BC593}"
13新增:EndProject
1214Global
1315 GlobalSection(SolutionConfigurationPlatforms) = preSolution
1416 Debug|Any CPU = Debug|Any CPU
@@ -41,6 +43,14 @@ Global
4143 {758D59B2-C438-4DE4-B135-7FF0614FE4B7}.Release|Any CPU.Build.0 = Release|Any CPU
4244 {758D59B2-C438-4DE4-B135-7FF0614FE4B7}.Release|x64.ActiveCfg = Release|Any CPU
4345 {758D59B2-C438-4DE4-B135-7FF0614FE4B7}.Release|x64.Build.0 = Release|Any CPU
46新增: {7A2F2592-3079-441C-8704-E71CE75BC593}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47新增: {7A2F2592-3079-441C-8704-E71CE75BC593}.Debug|Any CPU.Build.0 = Debug|Any CPU
48新增: {7A2F2592-3079-441C-8704-E71CE75BC593}.Debug|x64.ActiveCfg = Debug|Any CPU
49新增: {7A2F2592-3079-441C-8704-E71CE75BC593}.Debug|x64.Build.0 = Debug|Any CPU
50新增: {7A2F2592-3079-441C-8704-E71CE75BC593}.Release|Any CPU.ActiveCfg = Release|Any CPU
51新增: {7A2F2592-3079-441C-8704-E71CE75BC593}.Release|Any CPU.Build.0 = Release|Any CPU
52新增: {7A2F2592-3079-441C-8704-E71CE75BC593}.Release|x64.ActiveCfg = Release|Any CPU
53新增: {7A2F2592-3079-441C-8704-E71CE75BC593}.Release|x64.Build.0 = Release|Any CPU
4454 EndGlobalSection
4555 GlobalSection(SolutionProperties) = preSolution
4656 HideSolutionNode = FALSE
修改UI/Models/SettingPageModel.cs+5 −1看文件
@@ -5,6 +5,7 @@ using System.Collections.ObjectModel;
55using System.Linq;
66using System.Text;
77using System.Threading.Tasks;
8新增:using System.Windows;
89
910namespace UI.Models
1011{
@@ -29,7 +30,10 @@ namespace UI.Models
2930 /// <summary>
3031 /// 软件版本号
3132 /// </summary>
32删除: public string Version{ get { return version; } set { version = value; OnPropertyChanged(); } }
33新增: public string Version { get { return version; } set { version = value; OnPropertyChanged(); } }
34新增:
35新增: private Visibility CheckUpdateBtnVisibility_= Visibility.Visible;
36新增: public Visibility CheckUpdateBtnVisibility { get { return CheckUpdateBtnVisibility_; } set { CheckUpdateBtnVisibility_ = value; OnPropertyChanged(); } }
3337
3438 }
3539}
修改UI/ViewModels/SettingPageVM.cs+48 −2看文件
@@ -1,9 +1,11 @@
1删除:using Core.Models.Config;
1新增:using Core.Librarys;
2新增:using Core.Models.Config;
23using Core.Models.Config.Link;
34using Core.Servicers.Interfaces;
45using System;
56using System.Collections.Generic;
67using System.Diagnostics;
8新增:using System.IO;
79using System.Linq;
810using System.Reflection;
911using System.Text;
@@ -17,15 +19,59 @@ namespace UI.ViewModels
1719 {
1820 private ConfigModel config;
1921 private readonly IAppConfig appConfig;
22新增: private readonly MainViewModel mainVM;
2023 public Command OpenURL { get; set; }
21删除: public SettingPageVM(IAppConfig appConfig)
24新增: public Command CheckUpdate { get; set; }
25新增:
26新增: public SettingPageVM(IAppConfig appConfig, MainViewModel mainVM)
2227 {
2328 this.appConfig = appConfig;
29新增: this.mainVM = mainVM;
2430
2531 OpenURL = new Command(new Action<object>(OnOpenURL));
32新增: CheckUpdate = new Command(new Action<object>(OnCheckUpdate));
2633
2734 Init();
35新增: }
36新增:
37新增: private void OnCheckUpdate(object obj)
38新增: {
39新增: try
40新增: {
41新增: CheckUpdateBtnVisibility = System.Windows.Visibility.Collapsed;
42新增: string updaterExePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
43新增: "Updater.exe");
44新增: string updaterCacheExePath = Path.Combine(
45新增: AppDomain.CurrentDomain.BaseDirectory,
46新增: "Update",
47新增: "Updater.exe");
48新增: string updateDirPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Update");
49新增: if (!Directory.Exists(updateDirPath))
50新增: {
51新增: Directory.CreateDirectory(updateDirPath);
52新增: }
2853
54新增: if (!File.Exists(updaterExePath))
55新增: {
56新增: mainVM.Toast("升级程序似乎已被删除,请手动前往发布页查看新版本", Controls.Base.IconTypes.None);
57新增: return;
58新增: }
59新增: File.Copy(updaterExePath, updaterCacheExePath, true);
60新增:
61新增: File.Copy(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Newtonsoft.Json.dll"), Path.Combine(
62新增: AppDomain.CurrentDomain.BaseDirectory,
63新增: "Update",
64新增: "Newtonsoft.Json.dll"), true);
65新增:
66新增: ProcessHelper.Run(updaterCacheExePath, new string[] { Version });
67新增: }
68新增: catch (Exception ex)
69新增: {
70新增: CheckUpdateBtnVisibility = System.Windows.Visibility.Visible;
71新增:
72新增: Logger.Error(ex.Message);
73新增: mainVM.Toast("无法正确启动检查更新程序", Controls.Base.IconTypes.None);
74新增: }
2975 }
3076
3177 private void OnOpenURL(object obj)
修改UI/Views/SettingPage.xaml+13 −10看文件
@@ -13,7 +13,7 @@
1313
1414 <Grid Margin="20">
1515 <StackPanel>
16删除:
16新增:
1717 <TextBlock Text="设置" FontSize="18" Margin="0,5,0,20"/>
1818 <Tabbar:Tabbar Data="{Binding TabbarData}" SelectedIndex="{Binding TabbarSelectedIndex,Mode=TwoWay}"/>
1919
@@ -47,25 +47,28 @@
4747 <TabItem>
4848 <!--关于-->
4949 <Border Background="White" Padding="20" CornerRadius="6">
50删除: <StackPanel HorizontalAlignment="Left">
51删除: <Image Width="25" Source="/Resources/Icons/tai.ico" HorizontalAlignment="Left"/>
52删除: <TextBlock Margin="0,20,0,0">
53删除: <Run Text="Tai "/><Run Text="{Binding Version}"/>
54删除: </TextBlock>
55删除: <TextBlock Margin="0,5,0,0">
50新增: <StackPanel HorizontalAlignment="Left">
51新增: <Image Width="25" Source="/Resources/Icons/tai.ico" HorizontalAlignment="Left"/>
52新增: <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
53新增: <TextBlock VerticalAlignment="Center">
54新增: <Run Text="Tai版本号 "/><Run Text="{Binding Version}"/>
55新增: </TextBlock>
56新增: <Btn:Button Visibility="{Binding CheckUpdateBtnVisibility}" Command="{Binding CheckUpdate}" Margin="20,0,0,0" VerticalAlignment="Center" Width="120" Icon="CloudImportExport" Content="检查更新"/>
57新增: </StackPanel>
58新增: <TextBlock Margin="0,30,0,0">
5659 <Run Text="开源 "/><Hyperlink Command="{Binding OpenURL}" CommandParameter="https://github.com/Planshit/Tai">https://github.com/Planshit/Tai</Hyperlink>
5760 </TextBlock>
5861 <TextBlock Margin="0,5,0,0">
5962 <Run Text="讨论 "/><Hyperlink Command="{Binding OpenURL}" CommandParameter="https://github.com/Planshit/Tai/discussions">https://github.com/Planshit/Tai/discussions</Hyperlink>
6063 </TextBlock>
61删除: <TextBlock Margin="0,30,0,0">
64新增: <TextBlock Margin="0,10,0,0">
6265 <Run Text="外部资源声明 "/>
6366 </TextBlock>
64删除: <TextBlock Margin="0,5,0,0" Text="Icon 来自微软 Emoji"/>
67新增: <TextBlock Foreground="Gray" Margin="0,5,0,0" Text="Icon 来自微软 Emoji"/>
6568 </StackPanel>
6669 </Border>
6770 </TabItem>
68删除:
71新增:
6972 </TabControl>
7073 </StackPanel>
7174
新增Updater/App.config+6 −0看文件
@@ -0,0 +1,6 @@
1新增:<?xml version="1.0" encoding="utf-8" ?>
2新增:<configuration>
3新增: <startup>
4新增: <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
5新增: </startup>
6新增:</configuration>
文件末尾没有换行
新增Updater/App.xaml+9 −0看文件
@@ -0,0 +1,9 @@
1新增:<Application x:Class="Updater.App"
2新增: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3新增: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4新增: xmlns:local="clr-namespace:Updater"
5新增: StartupUri="MainWindow.xaml">
6新增: <Application.Resources>
7新增:
8新增: </Application.Resources>
9新增:</Application>
新增Updater/App.xaml.cs+61 −0看文件
@@ -0,0 +1,61 @@
1新增:using System;
2新增:using System.Collections.Generic;
3新增:using System.Configuration;
4新增:using System.Data;
5新增:using System.Linq;
6新增:using System.Threading.Tasks;
7新增:using System.Windows;
8新增:
9新增:namespace Updater
10新增:{
11新增: /// <summary>
12新增: /// App.xaml 的交互逻辑
13新增: /// </summary>
14新增: public partial class App : Application
15新增: {
16新增: private System.Threading.Mutex mutex;
17新增:
18新增: protected override void OnStartup(StartupEventArgs e)
19新增: {
20新增: base.OnStartup(e);
21新增: // 阻止多开和用户主动启动
22新增: if (e.Args.Length == 0 || IsRuned())
23新增: {
24新增: Shutdown();
25新增: }
26新增:
27新增: Activated += (s, e2) =>
28新增: {
29新增: var mainWindow = App.Current.MainWindow;
30新增: if (mainWindow.DataContext != null)
31新增: {
32新增: var mainModel = mainWindow.DataContext as MainModel;
33新增: if (string.IsNullOrEmpty(mainModel.Version))
34新增: {
35新增: mainModel.Version = e.Args[0];
36新增: }
37新增: }
38新增: };
39新增: }
40新增:
41新增:
42新增:
43新增:
44新增:
45新增: #region 获取当前程序是否已运行
46新增: /// <summary>
47新增: /// 获取当前程序是否已运行
48新增: /// </summary>
49新增: private bool IsRuned()
50新增: {
51新增: bool ret;
52新增: mutex = new System.Threading.Mutex(true, System.Reflection.Assembly.GetEntryAssembly().ManifestModule.Name, out ret);
53新增: if (!ret)
54新增: {
55新增: return true;
56新增: }
57新增: return false;
58新增: }
59新增: #endregion
60新增: }
61新增:}
新增Updater/GithubRelease.cs+113 −0看文件
@@ -0,0 +1,113 @@
1新增:using Newtonsoft.Json;
2新增:using System;
3新增:using System.Collections.Generic;
4新增:using System.IO;
5新增:using System.Linq;
6新增:using System.Net;
7新增:using System.Text;
8新增:using System.Threading;
9新增:using System.Threading.Tasks;
10新增:
11新增:namespace Updater
12新增:{
13新增:
14新增: public class GithubRelease
15新增: {
16新增: public class VersionInfo
17新增: {
18新增: /// <summary>
19新增: /// 版本标题
20新增: /// </summary>
21新增: public string Title { get; set; }
22新增: /// <summary>
23新增: /// 版本号
24新增: /// </summary>
25新增: public string Version { get; set; }
26新增: /// <summary>
27新增: /// 是否是预览版本
28新增: /// </summary>
29新增: public bool IsPre { get; set; }
30新增: /// <summary>
31新增: /// 下载路径
32新增: /// </summary>
33新增: public string DownloadUrl { get; set; }
34新增: /// <summary>
35新增: /// 版本更新内容网页链接
36新增: /// </summary>
37新增: public string HtmlUrl { get; set; }
38新增: }
39新增: public class GithubModel
40新增: {
41新增: public string tag_name { get; set; }
42新增: public string html_url { get; set; }
43新增: public string name { get; set; }
44新增: public bool prerelease { get; set; }
45新增:
46新增: public List<GithubAssetsModel> assets { get; set; }
47新增: }
48新增: public class GithubAssetsModel
49新增: {
50新增: public string browser_download_url { get; set; }
51新增: }
52新增: private string githubUrl;
53新增: private string nowVersion;
54新增: public VersionInfo Info { get; set; }
55新增:
56新增: //public event UpdaterEventHandler RequestCompleteEvent;
57新增: //public event UpdaterEventHandler RequestErrorEvent;
58新增: //public delegate void UpdaterEventHandler(object sender, object value);
59新增: public GithubRelease(string githubUrl, string nowVersion)
60新增: {
61新增: this.githubUrl = githubUrl;
62新增: this.nowVersion = nowVersion;
63新增: Info = new VersionInfo();
64新增: }
65新增: public bool IsCanUpdate()
66新增: {
67新增: return !(nowVersion == Info.Version);
68新增: }
69新增: public async Task<VersionInfo> GetRequest()
70新增: {
71新增: var result = await Task.Run(() =>
72新增: {
73新增: HttpWebResponse httpWebRespones = null;
74新增: try
75新增: {
76新增: System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
77新增: HttpWebRequest httpWebRequest = WebRequest.Create(githubUrl) as HttpWebRequest;
78新增: httpWebRequest.Timeout = 60 * 1000;
79新增: httpWebRequest.ReadWriteTimeout = 60000;
80新增: httpWebRequest.AllowAutoRedirect = true;
81新增: httpWebRequest.UserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36";
82新增: httpWebRespones = (HttpWebResponse)httpWebRequest.GetResponse();
83新增:
84新增:
85新增: using (Stream stream = httpWebRespones.GetResponseStream())
86新增: {
87新增: List<byte> lst = new List<byte>();
88新增: int nRead = 0;
89新增: while ((nRead = stream.ReadByte()) != -1) lst.Add((byte)nRead);
90新增: byte[] bodyBytes = lst.ToArray();
91新增:
92新增: string body = Encoding.UTF8.GetString(bodyBytes, 0, bodyBytes.Length);
93新增:
94新增: var data = JsonConvert.DeserializeObject<GithubModel>(body);
95新增: Info.IsPre = data.prerelease;
96新增: Info.Title = data.name;
97新增: Info.Version = data.tag_name;
98新增: Info.DownloadUrl = data.assets[0].browser_download_url;
99新增: Info.HtmlUrl = data.html_url;
100新增: return Info;
101新增: }
102新增:
103新增: }
104新增: catch (Exception ec)
105新增: {
106新增: return null;
107新增: }
108新增:
109新增: });
110新增: return result;
111新增: }
112新增: }
113新增:}
新增Updater/MainModel.cs+17 −0看文件
@@ -0,0 +1,17 @@
1新增:using System;
2新增:using System.Collections.Generic;
3新增:using System.Linq;
4新增:using System.Text;
5新增:using System.Threading.Tasks;
6新增:
7新增:namespace Updater
8新增:{
9新增: public class MainModel : UINotifyPropertyChanged
10新增: {
11新增: private double ProcessValue_;
12新增: public double ProcessValue { get { return ProcessValue_; } set { ProcessValue_ = value; OnPropertyChanged(); } }
13新增: private string Version_;
14新增: public string Version { get { return Version_; } set { Version_ = value; OnPropertyChanged(); } }
15新增:
16新增: }
17新增:}
新增Updater/MainWindow.xaml+42 −0看文件
@@ -0,0 +1,42 @@
1新增:<Window x:Class="Updater.MainWindow"
2新增: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3新增: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4新增: xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5新增: xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6新增: xmlns:local="clr-namespace:Updater"
7新增: mc:Ignorable="d"
8新增: Title="Tai 升级程序" ResizeMode="NoResize" Height="310" Width="435" WindowStartupLocation="CenterScreen">
9新增: <Grid Margin="10">
10新增: <Grid.RowDefinitions>
11新增: <RowDefinition Height="*"/>
12新增: <RowDefinition Height="50"/>
13新增:
14新增: </Grid.RowDefinitions>
15新增: <StackPanel>
16新增: <Border Background="#f3f3f3" Padding="10" CornerRadius="2">
17新增: <TextBlock x:Name="StatusLabel" Foreground="Gray" TextWrapping="WrapWithOverflow"/>
18新增: </Border>
19新增: <ProgressBar x:Name="ProgressBar" Height="10" Margin="0,10,0,10" Maximum="100" Value="{Binding ProcessValue}"/>
20新增: <StackPanel x:Name="NewVersionSP" Margin="10">
21新增: <StackPanel Orientation="Horizontal">
22新增: <TextBlock VerticalAlignment="Center"><Run>版本号</Run> <Run x:Name="Version" Foreground="Gray"/></TextBlock>
23新增: <Border x:Name="PreTag" ToolTip="预览版表示开发者没有进行过多的测试,相较于正式版可能会多一些bug,但也并不是一定" Background="OrangeRed" Padding="5,2" CornerRadius="4" VerticalAlignment="Center" Margin="10,0,0,0">
24新增: <TextBlock Text="预览版" Foreground="White" FontSize="10" VerticalAlignment="Center" HorizontalAlignment="Center"/>
25新增: </Border>
26新增: </StackPanel>
27新增: <TextBlock Margin="0,10,0,0" ToolTip="版本简介"><Run x:Name="VersionTitle" Foreground="Gray"/></TextBlock>
28新增: <TextBlock Margin="0,10,0,0" ToolTip="在浏览器中打开"><Hyperlink Click="Hyperlink_Click">查看详细更新内容</Hyperlink></TextBlock>
29新增:
30新增: </StackPanel>
31新增: </StackPanel>
32新增: <StackPanel Orientation="Horizontal" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Left">
33新增: <Button x:Name="UpdateBtn" Padding="10,8" Margin="0,0,10,0" Click="UpdateBtn_Click">升级到此新版本</Button>
34新增: <Button x:Name="ReCheckBtn" Padding="10,8" Click="ReCheckBtn_Click">重新检查</Button>
35新增:
36新增: </StackPanel>
37新增: <TextBlock Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Right">
38新增: <Run>当前版本号:</Run><Run Text="{Binding Version}"/>
39新增: </TextBlock>
40新增:
41新增: </Grid>
42新增:</Window>
新增Updater/MainWindow.xaml.cs+240 −0看文件
@@ -0,0 +1,240 @@
1新增:using System;
2新增:using System.Collections.Generic;
3新增:using System.Diagnostics;
4新增:using System.IO;
5新增:using System.Linq;
6新增:using System.Net;
7新增:using System.Text;
8新增:using System.Threading.Tasks;
9新增:using System.Windows;
10新增:using System.Windows.Controls;
11新增:using System.Windows.Data;
12新增:using System.Windows.Documents;
13新增:using System.Windows.Input;
14新增:using System.Windows.Media;
15新增:using System.Windows.Media.Imaging;
16新增:using System.Windows.Navigation;
17新增:using System.Windows.Shapes;
18新增:using static Updater.GithubRelease;
19新增:
20新增:namespace Updater
21新增:{
22新增: /// <summary>
23新增: /// MainWindow.xaml 的交互逻辑
24新增: /// </summary>
25新增: public partial class MainWindow : Window
26新增: {
27新增: GithubRelease githubRelease;
28新增:
29新增: /// <summary>
30新增: /// 新版本保存目录路径
31新增: /// </summary>
32新增: private string SaveDir = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory);
33新增: /// <summary>
34新增: /// 新版本保存名字
35新增: /// </summary>
36新增: private string SaveName = "update.zip";
37新增: /// <summary>
38新增: /// 新版本下载路径
39新增: /// </summary>
40新增: private string NewVersionZipURL;
41新增: /// <summary>
42新增: /// 新版本发布页路径
43新增: /// </summary>
44新增: private string NewVersionURL;
45新增: private MainModel mainModel;
46新增: public MainWindow()
47新增: {
48新增: InitializeComponent();
49新增:
50新增: mainModel = new MainModel();
51新增:
52新增: DataContext = mainModel;
53新增:
54新增: mainModel.PropertyChanged += MainModel_PropertyChanged;
55新增: }
56新增:
57新增: private void MainModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
58新增: {
59新增: if (e.PropertyName == nameof(mainModel.Version))
60新增: {
61新增: githubRelease = new GithubRelease("https://api.github.com/repos/planshit/tai/releases/latest", mainModel.Version);
62新增:
63新增: Check();
64新增: }
65新增: }
66新增:
67新增: private async void Download()
68新增: {
69新增: SetStatus("正在下载新版本文件...", false);
70新增:
71新增: UpdateBtn.Visibility = Visibility.Collapsed;
72新增: ReCheckBtn.Visibility = Visibility.Collapsed;
73新增: ProgressBar.Visibility = Visibility.Visible;
74新增: mainModel.ProcessValue = 0;
75新增:
76新增: var res = await Task.Run(() =>
77新增: {
78新增: try
79新增: {
80新增: // 确认保存目录
81新增: if (!Directory.Exists(SaveDir))
82新增: {
83新增: Directory.CreateDirectory(SaveDir);
84新增: }
85新增:
86新增: Uri uri = new Uri(NewVersionZipURL);
87新增: HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(uri);
88新增: httpWebRequest.Timeout = 120 * 1000;
89新增: HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
90新增:
91新增:
92新增: long totalBytes = httpWebResponse.ContentLength;
93新增:
94新增: Stream st = httpWebResponse.GetResponseStream();
95新增: Stream so = new FileStream(System.IO.Path.Combine(SaveDir, SaveName), FileMode.Create);
96新增:
97新增: long totalDownloadedByte = 0;
98新增: byte[] by = new byte[1024];
99新增: int osize = st.Read(by, 0, (int)by.Length);
100新增: while (osize > 0)
101新增: {
102新增:
103新增: totalDownloadedByte = osize + totalDownloadedByte;
104新增: so.Write(by, 0, osize);
105新增:
106新增: osize = st.Read(by, 0, (int)by.Length);
107新增:
108新增: //进度计算
109新增: double process = double.Parse(String.Format("{0:F}",
110新增: ((double)totalDownloadedByte / (double)totalBytes * 100)));
111新增: mainModel.ProcessValue = process;
112新增: //Debug.WriteLine(ProcessValue);
113新增: }
114新增: //关闭资源
115新增: httpWebResponse.Close();
116新增: so.Close();
117新增: st.Close();
118新增:
119新增: return true;
120新增:
121新增: }
122新增: catch (Exception ec)
123新增: {
124新增: return false;
125新增: }
126新增: });
127新增:
128新增: if (res)
129新增: {
130新增: // 准备更新
131新增: var process = Process.GetProcessesByName("Tai");
132新增: if (process != null && process.Length > 0)
133新增: {
134新增: process[0].Kill();
135新增: }
136新增:
137新增: SetStatus("下载完成,正在解压请勿关闭此窗口...");
138新增:
139新增: string unpath = Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory).Parent.FullName;
140新增:
141新增: var unresult = await Task.Run(async () =>
142新增: {
143新增: await Task.Delay(3000);
144新增: return Unzip.ExtractZipFile(System.IO.Path.Combine(SaveDir, SaveName), unpath);
145新增: });
146新增: if (unresult)
147新增: {
148新增: SetStatus("更新完成!", false);
149新增: Process tai = new Process();
150新增: ProcessStartInfo startInfo = new ProcessStartInfo(System.IO.Path.Combine(unpath, "Tai.exe"));
151新增: tai.StartInfo = startInfo;
152新增: tai.Start();
153新增: }
154新增: else
155新增: {
156新增: SetStatus("解压文件时发生异常,请重试!通常情况可能是因为Tai主程序尚未退出。", false);
157新增: UpdateBtn.Visibility = Visibility.Visible;
158新增:
159新增: }
160新增: }
161新增: else
162新增: {
163新增: //下载发生异常
164新增: SetStatus("下载时发生异常,请重试。", false);
165新增: UpdateBtn.Visibility = Visibility.Visible;
166新增: }
167新增: }
168新增:
169新增:
170新增: private async void Check()
171新增: {
172新增: NewVersionSP.Visibility = Visibility.Collapsed;
173新增: PreTag.Visibility = Visibility.Collapsed;
174新增:
175新增: SetStatus("正在检查更新");
176新增: UpdateBtn.Visibility = Visibility.Collapsed;
177新增: ReCheckBtn.IsEnabled = false;
178新增:
179新增: var info = await githubRelease.GetRequest();
180新增:
181新增: if (info != null)
182新增: {
183新增: if (githubRelease.IsCanUpdate())
184新增: {
185新增: UpdateBtn.Visibility = Visibility.Visible;
186新增:
187新增: NewVersionSP.Visibility = Visibility.Visible;
188新增: Version.Text = info.Version;
189新增: VersionTitle.Text = info.Title;
190新增: NewVersionZipURL = info.DownloadUrl;
191新增: NewVersionURL = info.HtmlUrl;
192新增: if (info.IsPre)
193新增: {
194新增: PreTag.Visibility = Visibility.Visible;
195新增: }
196新增: SetStatus("检测到新的版本!", false);
197新增: }
198新增: else
199新增: {
200新增: SetStatus("目前没有可用的更新。", false);
201新增: }
202新增: }
203新增: else
204新增: {
205新增: SetStatus("无法获取版本信息,请检查代理或网络。", false);
206新增: }
207新增: ReCheckBtn.IsEnabled = true;
208新增:
209新增: }
210新增:
211新增: private void SetStatus(string statusText, bool isLoading = true)
212新增: {
213新增: StatusLabel.Text = statusText;
214新增: ProgressBar.IsIndeterminate = isLoading;
215新增: if (isLoading)
216新增: {
217新增: ProgressBar.Visibility = Visibility.Visible;
218新增: }
219新增: else
220新增: {
221新增: ProgressBar.Visibility = Visibility.Collapsed;
222新增: }
223新增: }
224新增:
225新增: private void ReCheckBtn_Click(object sender, RoutedEventArgs e)
226新增: {
227新增: Check();
228新增: }
229新增:
230新增: private void UpdateBtn_Click(object sender, RoutedEventArgs e)
231新增: {
232新增: Download();
233新增: }
234新增:
235新增: private void Hyperlink_Click(object sender, RoutedEventArgs e)
236新增: {
237新增: Process.Start(new ProcessStartInfo(NewVersionURL));
238新增: }
239新增: }
240新增:}
新增Updater/Properties/AssemblyInfo.cs+55 −0看文件
@@ -0,0 +1,55 @@
1新增:using System.Reflection;
2新增:using System.Resources;
3新增:using System.Runtime.CompilerServices;
4新增:using System.Runtime.InteropServices;
5新增:using System.Windows;
6新增:
7新增:// 有关程序集的一般信息由以下
8新增:// 控制。更改这些特性值可修改
9新增:// 与程序集关联的信息。
10新增:[assembly: AssemblyTitle("Updater")]
11新增:[assembly: AssemblyDescription("")]
12新增:[assembly: AssemblyConfiguration("")]
13新增:[assembly: AssemblyCompany("")]
14新增:[assembly: AssemblyProduct("Updater")]
15新增:[assembly: AssemblyCopyright("Copyright © 2021")]
16新增:[assembly: AssemblyTrademark("")]
17新增:[assembly: AssemblyCulture("")]
18新增:
19新增:// 将 ComVisible 设置为 false 会使此程序集中的类型
20新增://对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
21新增://请将此类型的 ComVisible 特性设置为 true。
22新增:[assembly: ComVisible(false)]
23新增:
24新增://若要开始生成可本地化的应用程序,请设置
25新增://.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
26新增://例如,如果您在源文件中使用的是美国英语,
27新增://使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
28新增://对以下 NeutralResourceLanguage 特性的注释。 更新
29新增://以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
30新增:
31新增://[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32新增:
33新增:
34新增:[assembly: ThemeInfo(
35新增: ResourceDictionaryLocation.None, //主题特定资源词典所处位置
36新增: //(未在页面中找到资源时使用,
37新增: //或应用程序资源字典中找到时使用)
38新增: ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
39新增: //(未在页面中找到资源时使用,
40新增: //、应用程序或任何主题专用资源字典中找到时使用)
41新增:)]
42新增:
43新增:
44新增:// 程序集的版本信息由下列四个值组成:
45新增://
46新增:// 主版本
47新增:// 次版本
48新增:// 生成号
49新增:// 修订号
50新增://
51新增://可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
52新增://通过使用 "*",如下所示:
53新增:// [assembly: AssemblyVersion("1.0.*")]
54新增:[assembly: AssemblyVersion("1.0.0.0")]
55新增:[assembly: AssemblyFileVersion("1.0.0.0")]
新增Updater/Properties/Resources.Designer.cs+71 −0看文件
@@ -0,0 +1,71 @@
1新增://------------------------------------------------------------------------------
2新增:// <auto-generated>
3新增:// 此代码由工具生成。
4新增:// 运行时版本: 4.0.30319.42000
5新增://
6新增:// 对此文件的更改可能导致不正确的行为,如果
7新增:// 重新生成代码,则所做更改将丢失。
8新增:// </auto-generated>
9新增://------------------------------------------------------------------------------
10新增:
11新增:namespace Updater.Properties
12新增:{
13新增:
14新增:
15新增: /// <summary>
16新增: /// 强类型资源类,用于查找本地化字符串等。
17新增: /// </summary>
18新增: // 此类是由 StronglyTypedResourceBuilder
19新增: // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20新增: // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21新增: // (以 /str 作为命令选项),或重新生成 VS 项目。
22新增: [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23新增: [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24新增: [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25新增: internal class Resources
26新增: {
27新增:
28新增: private static global::System.Resources.ResourceManager resourceMan;
29新增:
30新增: private static global::System.Globalization.CultureInfo resourceCulture;
31新增:
32新增: [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33新增: internal Resources()
34新增: {
35新增: }
36新增:
37新增: /// <summary>
38新增: /// 返回此类使用的缓存 ResourceManager 实例。
39新增: /// </summary>
40新增: [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41新增: internal static global::System.Resources.ResourceManager ResourceManager
42新增: {
43新增: get
44新增: {
45新增: if ((resourceMan == null))
46新增: {
47新增: global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Updater.Properties.Resources", typeof(Resources).Assembly);
48新增: resourceMan = temp;
49新增: }
50新增: return resourceMan;
51新增: }
52新增: }
53新增:
54新增: /// <summary>
55新增: /// 重写当前线程的 CurrentUICulture 属性,对
56新增: /// 使用此强类型资源类的所有资源查找执行重写。
57新增: /// </summary>
58新增: [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59新增: internal static global::System.Globalization.CultureInfo Culture
60新增: {
61新增: get
62新增: {
63新增: return resourceCulture;
64新增: }
65新增: set
66新增: {
67新增: resourceCulture = value;
68新增: }
69新增: }
70新增: }
71新增:}
新增Updater/Properties/Resources.resx+117 −0看文件
@@ -0,0 +1,117 @@
1新增:<?xml version="1.0" encoding="utf-8"?>
2新增:<root>
3新增: <!--
4新增: Microsoft ResX Schema
5新增:
6新增: Version 2.0
7新增:
8新增: The primary goals of this format is to allow a simple XML format
9新增: that is mostly human readable. The generation and parsing of the
10新增: various data types are done through the TypeConverter classes
11新增: associated with the data types.
12新增:
13新增: Example:
14新增:
15新增: ... ado.net/XML headers & schema ...
16新增: <resheader name="resmimetype">text/microsoft-resx</resheader>
17新增: <resheader name="version">2.0</resheader>
18新增: <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19新增: <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20新增: <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21新增: <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22新增: <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23新增: <value>[base64 mime encoded serialized .NET Framework object]</value>
24新增: </data>
25新增: <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26新增: <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27新增: <comment>This is a comment</comment>
28新增: </data>
29新增:
30新增: There are any number of "resheader" rows that contain simple
31新增: name/value pairs.
32新增:
33新增: Each data row contains a name, and value. The row also contains a
34新增: type or mimetype. Type corresponds to a .NET class that support
35新增: text/value conversion through the TypeConverter architecture.
36新增: Classes that don't support this are serialized and stored with the
37新增: mimetype set.
38新增:
39新增: The mimetype is used for serialized objects, and tells the
40新增: ResXResourceReader how to depersist the object. This is currently not
41新增: extensible. For a given mimetype the value must be set accordingly:
42新增:
43新增: Note - application/x-microsoft.net.object.binary.base64 is the format
44新增: that the ResXResourceWriter will generate, however the reader can
45新增: read any of the formats listed below.
46新增:
47新增: mimetype: application/x-microsoft.net.object.binary.base64
48新增: value : The object must be serialized with
49新增: : System.Serialization.Formatters.Binary.BinaryFormatter
50新增: : and then encoded with base64 encoding.
51新增:
52新增: mimetype: application/x-microsoft.net.object.soap.base64
53新增: value : The object must be serialized with
54新增: : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55新增: : and then encoded with base64 encoding.
56新增:
57新增: mimetype: application/x-microsoft.net.object.bytearray.base64
58新增: value : The object must be serialized into a byte array
59新增: : using a System.ComponentModel.TypeConverter
60新增: : and then encoded with base64 encoding.
61新增: -->
62新增: <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63新增: <xsd:element name="root" msdata:IsDataSet="true">
64新增: <xsd:complexType>
65新增: <xsd:choice maxOccurs="unbounded">
66新增: <xsd:element name="metadata">
67新增: <xsd:complexType>
68新增: <xsd:sequence>
69新增: <xsd:element name="value" type="xsd:string" minOccurs="0" />
70新增: </xsd:sequence>
71新增: <xsd:attribute name="name" type="xsd:string" />
72新增: <xsd:attribute name="type" type="xsd:string" />
73新增: <xsd:attribute name="mimetype" type="xsd:string" />
74新增: </xsd:complexType>
75新增: </xsd:element>
76新增: <xsd:element name="assembly">
77新增: <xsd:complexType>
78新增: <xsd:attribute name="alias" type="xsd:string" />
79新增: <xsd:attribute name="name" type="xsd:string" />
80新增: </xsd:complexType>
81新增: </xsd:element>
82新增: <xsd:element name="data">
83新增: <xsd:complexType>
84新增: <xsd:sequence>
85新增: <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
86新增: <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
87新增: </xsd:sequence>
88新增: <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
89新增: <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
90新增: <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
91新增: </xsd:complexType>
92新增: </xsd:element>
93新增: <xsd:element name="resheader">
94新增: <xsd:complexType>
95新增: <xsd:sequence>
96新增: <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
97新增: </xsd:sequence>
98新增: <xsd:attribute name="name" type="xsd:string" use="required" />
99新增: </xsd:complexType>
100新增: </xsd:element>
101新增: </xsd:choice>
102新增: </xsd:complexType>
103新增: </xsd:element>
104新增: </xsd:schema>
105新增: <resheader name="resmimetype">
106新增: <value>text/microsoft-resx</value>
107新增: </resheader>
108新增: <resheader name="version">
109新增: <value>2.0</value>
110新增: </resheader>
111新增: <resheader name="reader">
112新增: <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
113新增: </resheader>
114新增: <resheader name="writer">
115新增: <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116新增: </resheader>
117新增:</root>
文件末尾没有换行
新增Updater/Properties/Settings.Designer.cs+30 −0看文件
@@ -0,0 +1,30 @@
1新增://------------------------------------------------------------------------------
2新增:// <auto-generated>
3新增:// This code was generated by a tool.
4新增:// Runtime Version:4.0.30319.42000
5新增://
6新增:// Changes to this file may cause incorrect behavior and will be lost if
7新增:// the code is regenerated.
8新增:// </auto-generated>
9新增://------------------------------------------------------------------------------
10新增:
11新增:namespace Updater.Properties
12新增:{
13新增:
14新增:
15新增: [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16新增: [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17新增: internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18新增: {
19新增:
20新增: private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21新增:
22新增: public static Settings Default
23新增: {
24新增: get
25新增: {
26新增: return defaultInstance;
27新增: }
28新增: }
29新增: }
30新增:}
新增Updater/Properties/Settings.settings+7 −0看文件
@@ -0,0 +1,7 @@
1新增:<?xml version='1.0' encoding='utf-8'?>
2新增:<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
3新增: <Profiles>
4新增: <Profile Name="(Default)" />
5新增: </Profiles>
6新增: <Settings />
7新增:</SettingsFile>
文件末尾没有换行
新增Updater/UINotifyPropertyChanged.cs+26 −0看文件
@@ -0,0 +1,26 @@
1新增:using System;
2新增:using System.Collections.Generic;
3新增:using System.ComponentModel;
4新增:using System.Linq;
5新增:using System.Runtime.CompilerServices;
6新增:using System.Text;
7新增:using System.Threading.Tasks;
8新增:
9新增:namespace Updater
10新增:{
11新增: public class UINotifyPropertyChanged : INotifyPropertyChanged
12新增: {
13新增: public event PropertyChangedEventHandler PropertyChanged;
14新增:
15新增: public void OnPropertyChanged([CallerMemberName] string propertyName = "")
16新增: {
17新增:
18新增: PropertyChangedEventHandler handler = PropertyChanged;
19新增: if (handler != null)
20新增: {
21新增: handler.Invoke(this, new PropertyChangedEventArgs(propertyName));
22新增: }
23新增:
24新增: }
25新增: }
26新增:}
新增Updater/Unzip.cs+88 −0看文件
@@ -0,0 +1,88 @@
1新增:using System;
2新增:using System.Collections.Generic;
3新增:using System.Diagnostics;
4新增:using System.IO;
5新增:using System.IO.Compression;
6新增:using System.Linq;
7新增:using System.Text;
8新增:using System.Threading.Tasks;
9新增:
10新增:namespace Updater
11新增:{
12新增: public class Unzip
13新增: {
14新增: /// <summary>
15新增: /// 忽略的文件列表
16新增: /// </summary>
17新增: static readonly string[] IgnoreFiles = { };
18新增: public static bool ExtractZipFile(string zipPath, string extractPath)
19新增: {
20新增: try
21新增: {
22新增: if (!extractPath.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal))
23新增: extractPath += Path.DirectorySeparatorChar;
24新增:
25新增: using (ZipArchive archive = ZipFile.OpenRead(zipPath))
26新增: {
27新增: foreach (ZipArchiveEntry entry in archive.Entries)
28新增: {
29新增:
30新增: if (!IsIgnoreFile(entry.FullName))
31新增: {
32新增: // Gets the full path to ensure that relative segments are removed.
33新增: string destinationPath = Path.GetFullPath(Path.Combine(extractPath, entry.FullName));
34新增: if (!IsDir(destinationPath))
35新增: {
36新增: // 判断路径是否存在
37新增: string dir = Path.GetDirectoryName(destinationPath);
38新增: if (!Directory.Exists(dir))
39新增: {
40新增: Directory.CreateDirectory(dir);
41新增: }
42新增:
43新增: if (File.Exists(destinationPath))
44新增: {
45新增: File.Delete(destinationPath);
46新增: }
47新增: // Ordinal match is safest, case-sensitive volumes can be mounted within volumes that
48新增: // are case-insensitive.
49新增: Debug.WriteLine($"抽取:{destinationPath}");
50新增: if (destinationPath.StartsWith(extractPath, StringComparison.Ordinal))
51新增: entry.ExtractToFile(destinationPath);
52新增: }
53新增: else
54新增: {
55新增: //创建目录
56新增: Directory.CreateDirectory(destinationPath);
57新增: }
58新增: }
59新增: }
60新增: return true;
61新增: }
62新增: }
63新增: catch
64新增: {
65新增: return false;
66新增: }
67新增: }
68新增:
69新增: /// <summary>
70新增: /// 指示文件是否是忽略的
71新增: /// </summary>
72新增: /// <param name="fileName"></param>
73新增: /// <returns></returns>
74新增: static bool IsIgnoreFile(string fileName)
75新增: {
76新增: return (Array.IndexOf(IgnoreFiles, fileName) != -1);
77新增: }
78新增: /// <summary>
79新增: /// 指示路径是否是目录
80新增: /// </summary>
81新增: /// <param name="path"></param>
82新增: /// <returns></returns>
83新增: static bool IsDir(string path)
84新增: {
85新增: return (path.Last() == '\\');
86新增: }
87新增: }
88新增:}
新增Updater/Updater.csproj+107 −0看文件
@@ -0,0 +1,107 @@
1新增:<?xml version="1.0" encoding="utf-8"?>
2新增:<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3新增: <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4新增: <PropertyGroup>
5新增: <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6新增: <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7新增: <ProjectGuid>{7A2F2592-3079-441C-8704-E71CE75BC593}</ProjectGuid>
8新增: <OutputType>WinExe</OutputType>
9新增: <RootNamespace>Updater</RootNamespace>
10新增: <AssemblyName>Updater</AssemblyName>
11新增: <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
12新增: <FileAlignment>512</FileAlignment>
13新增: <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14新增: <WarningLevel>4</WarningLevel>
15新增: <Deterministic>true</Deterministic>
16新增: </PropertyGroup>
17新增: <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18新增: <PlatformTarget>AnyCPU</PlatformTarget>
19新增: <DebugSymbols>true</DebugSymbols>
20新增: <DebugType>full</DebugType>
21新增: <Optimize>false</Optimize>
22新增: <OutputPath>bin\Debug\</OutputPath>
23新增: <DefineConstants>DEBUG;TRACE</DefineConstants>
24新增: <ErrorReport>prompt</ErrorReport>
25新增: <WarningLevel>4</WarningLevel>
26新增: </PropertyGroup>
27新增: <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28新增: <PlatformTarget>AnyCPU</PlatformTarget>
29新增: <DebugType>pdbonly</DebugType>
30新增: <Optimize>true</Optimize>
31新增: <OutputPath>bin\Release\</OutputPath>
32新增: <DefineConstants>TRACE</DefineConstants>
33新增: <ErrorReport>prompt</ErrorReport>
34新增: <WarningLevel>4</WarningLevel>
35新增: </PropertyGroup>
36新增: <ItemGroup>
37新增: <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
38新增: <HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
39新增: </Reference>
40新增: <Reference Include="System" />
41新增: <Reference Include="System.Data" />
42新增: <Reference Include="System.IO.Compression" />
43新增: <Reference Include="System.IO.Compression.FileSystem" />
44新增: <Reference Include="System.Xml" />
45新增: <Reference Include="Microsoft.CSharp" />
46新增: <Reference Include="System.Core" />
47新增: <Reference Include="System.Xml.Linq" />
48新增: <Reference Include="System.Data.DataSetExtensions" />
49新增: <Reference Include="System.Net.Http" />
50新增: <Reference Include="System.Xaml">
51新增: <RequiredTargetFramework>4.0</RequiredTargetFramework>
52新增: </Reference>
53新增: <Reference Include="WindowsBase" />
54新增: <Reference Include="PresentationCore" />
55新增: <Reference Include="PresentationFramework" />
56新增: </ItemGroup>
57新增: <ItemGroup>
58新增: <ApplicationDefinition Include="App.xaml">
59新增: <Generator>MSBuild:Compile</Generator>
60新增: <SubType>Designer</SubType>
61新增: </ApplicationDefinition>
62新增: <Compile Include="MainModel.cs" />
63新增: <Compile Include="UINotifyPropertyChanged.cs" />
64新增: <Compile Include="Unzip.cs" />
65新增: <Page Include="MainWindow.xaml">
66新增: <Generator>MSBuild:Compile</Generator>
67新增: <SubType>Designer</SubType>
68新增: </Page>
69新增: <Compile Include="App.xaml.cs">
70新增: <DependentUpon>App.xaml</DependentUpon>
71新增: <SubType>Code</SubType>
72新增: </Compile>
73新增: <Compile Include="GithubRelease.cs" />
74新增: <Compile Include="MainWindow.xaml.cs">
75新增: <DependentUpon>MainWindow.xaml</DependentUpon>
76新增: <SubType>Code</SubType>
77新增: </Compile>
78新增: </ItemGroup>
79新增: <ItemGroup>
80新增: <Compile Include="Properties\AssemblyInfo.cs">
81新增: <SubType>Code</SubType>
82新增: </Compile>
83新增: <Compile Include="Properties\Resources.Designer.cs">
84新增: <AutoGen>True</AutoGen>
85新增: <DesignTime>True</DesignTime>
86新增: <DependentUpon>Resources.resx</DependentUpon>
87新增: </Compile>
88新增: <Compile Include="Properties\Settings.Designer.cs">
89新增: <AutoGen>True</AutoGen>
90新增: <DependentUpon>Settings.settings</DependentUpon>
91新增: <DesignTimeSharedInput>True</DesignTimeSharedInput>
92新增: </Compile>
93新增: <EmbeddedResource Include="Properties\Resources.resx">
94新增: <Generator>ResXFileCodeGenerator</Generator>
95新增: <LastGenOutput>Resources.Designer.cs</LastGenOutput>
96新增: </EmbeddedResource>
97新增: <None Include="packages.config" />
98新增: <None Include="Properties\Settings.settings">
99新增: <Generator>SettingsSingleFileGenerator</Generator>
100新增: <LastGenOutput>Settings.Designer.cs</LastGenOutput>
101新增: </None>
102新增: </ItemGroup>
103新增: <ItemGroup>
104新增: <None Include="App.config" />
105新增: </ItemGroup>
106新增: <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
107新增:</Project>
文件末尾没有换行
新增Updater/packages.config+4 −0看文件
@@ -0,0 +1,4 @@
1新增:<?xml version="1.0" encoding="utf-8"?>
2新增:<packages>
3新增: <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net45" />
4新增:</packages>
文件末尾没有换行