diff --git a/WeeXnes/Core/Global.cs b/WeeXnes/Core/Global.cs
index d332197..072c18f 100644
--- a/WeeXnes/Core/Global.cs
+++ b/WeeXnes/Core/Global.cs
@@ -6,7 +6,7 @@ namespace WeeXnes.Core
{
public class Information
{
- public const string Version = "4.0.3";
+ public const string Version = "4.0.4";
public const string EncryptionHash = "8zf5#RdyQ]$4x4_";
public const string ApiUrl = "https://api.github.com/repos/weexnes/weexnessuite/releases/latest";
}
diff --git a/WeeXnes/Views/Settings/SettingsView.xaml b/WeeXnes/Views/Settings/SettingsView.xaml
index 5459bcf..358d05b 100644
--- a/WeeXnes/Views/Settings/SettingsView.xaml
+++ b/WeeXnes/Views/Settings/SettingsView.xaml
@@ -11,12 +11,13 @@
-
+ Click="ButtonCheckForUpdates_OnClick"
+ Margin="0,10,0,0">
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WeeXnes/Views/Settings/SettingsView.xaml.cs b/WeeXnes/Views/Settings/SettingsView.xaml.cs
index 9a13b3d..7fcbd62 100644
--- a/WeeXnes/Views/Settings/SettingsView.xaml.cs
+++ b/WeeXnes/Views/Settings/SettingsView.xaml.cs
@@ -17,7 +17,7 @@ namespace WeeXnes.Views.Settings
public static class Data
{
public static INIFile settingsFile = new INIFile(Global.AppDataPath + "\\" + Global.SettingsFile, true);
- public static GithubApiResponse updateResponse = null;
+
}
public SettingsView()
{
@@ -39,45 +39,11 @@ namespace WeeXnes.Views.Settings
KeyManagerView.Data.censorKeys.Value = false;
}
- private void DialogUpdate_OnButtonLeftClick(object sender, RoutedEventArgs e)
- {
- Console.WriteLine("Do Update");
- if(Data.updateResponse == null)
- return;
-
- if (File.Exists(Data.updateResponse.assets[0].name))
- {
- File.Delete(Data.updateResponse.assets[0].name);
- }
- using(WebClient webClient = new WebClient())
- {;
-
- webClient.DownloadFile(
- Data.updateResponse.assets[0].browser_download_url,
- Data.updateResponse.assets[0].name
- );
- }
- try
- {
- string path = Application.StartupPath;
- string fileName = Path.GetFileName(Application.ExecutablePath);
- string pid = Process.GetCurrentProcess().Id.ToString();
- Process updateProc = Process.Start("Update.exe", "\"" + path + "\"" + " " + "\"" + fileName + "\"" + " " + "\"" + pid + "\"" + " " + "\"" + Data.updateResponse.assets[0].name + "\"");
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex);
- }
- }
-
- private void DialogUpdate_OnButtonRightClick(object sender, RoutedEventArgs e)
- {
- DialogUpdate.Hide();
- }
private void ButtonCheckForUpdates_OnClick(object sender, RoutedEventArgs e)
{
+
try
{
using(WebClient webClient = new WebClient())
@@ -88,9 +54,8 @@ namespace WeeXnes.Views.Settings
GithubApiResponse apiResponseData = JsonConvert.DeserializeObject(downloadString);
if (apiResponseData.tag_name != Information.Version)
{
- Data.updateResponse = apiResponseData;
- DialogUpdate.Content = apiResponseData.tag_name + " is avaiable";
- DialogUpdate.Show();
+ UpdateFoundView.Data.updateResponse = apiResponseData;
+ NavigationService.Navigate(new Uri("/Views/Settings/UpdateFoundView.xaml",UriKind.Relative));
}
}
}
@@ -139,5 +104,6 @@ namespace WeeXnes.Views.Settings
MessageBox.Show(ex.Message);
}
}
+
}
}
\ No newline at end of file
diff --git a/WeeXnes/Views/Settings/UpdateFoundView.xaml b/WeeXnes/Views/Settings/UpdateFoundView.xaml
new file mode 100644
index 0000000..fe857d8
--- /dev/null
+++ b/WeeXnes/Views/Settings/UpdateFoundView.xaml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WeeXnes/Views/Settings/UpdateFoundView.xaml.cs b/WeeXnes/Views/Settings/UpdateFoundView.xaml.cs
new file mode 100644
index 0000000..48e571e
--- /dev/null
+++ b/WeeXnes/Views/Settings/UpdateFoundView.xaml.cs
@@ -0,0 +1,68 @@
+using System;
+using System.Diagnostics;
+using System.IO;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using WeeXnes.Core;
+using Application = System.Windows.Forms.Application;
+
+namespace WeeXnes.Views.Settings
+{
+
+ public partial class UpdateFoundView : Page
+ {
+ public static class Data
+ {
+ public static GithubApiResponse updateResponse = null;
+ }
+ public UpdateFoundView()
+ {
+ InitializeComponent();
+ }
+
+ private void ButtonInstallUpdate_OnClick(object sender, RoutedEventArgs e)
+ {
+ Console.WriteLine("Do Update");
+ if(Data.updateResponse == null)
+ return;
+
+ if (File.Exists(Data.updateResponse.assets[0].name))
+ {
+ File.Delete(Data.updateResponse.assets[0].name);
+ }
+ using(WebClient webClient = new WebClient())
+ {;
+
+ webClient.DownloadFile(
+ Data.updateResponse.assets[0].browser_download_url,
+ Data.updateResponse.assets[0].name
+ );
+ }
+ try
+ {
+ string path = Application.StartupPath;
+ string fileName = Path.GetFileName(Application.ExecutablePath);
+ string pid = Process.GetCurrentProcess().Id.ToString();
+ Process updateProc = Process.Start("Update.exe", "\"" + path + "\"" + " " + "\"" + fileName + "\"" + " " + "\"" + pid + "\"" + " " + "\"" + Data.updateResponse.assets[0].name + "\"");
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(ex);
+
+ }
+ }
+
+ private void VersionNumberLoaded_OnLoaded(object sender, RoutedEventArgs e)
+ {
+ TextBlock tb = (TextBlock)sender;
+ tb.Text = "New Version: " + Data.updateResponse.tag_name;
+ }
+
+ private void CurrentVersionNumberLoaded_OnLoaded(object sender, RoutedEventArgs e)
+ {
+ TextBlock tb = (TextBlock)sender;
+ tb.Text = "Current Version: " + Information.Version;
+ }
+ }
+}
\ No newline at end of file
diff --git a/WeeXnes/WeeXnes.csproj b/WeeXnes/WeeXnes.csproj
index 14a0d60..6db1329 100644
--- a/WeeXnes/WeeXnes.csproj
+++ b/WeeXnes/WeeXnes.csproj
@@ -4,7 +4,7 @@
Debug
AnyCPU
- 4.0.3
+ 4.0.4
{4B33CEE7-C74D-43B9-B99A-8B273D5195BC}
WinExe
WeeXnes
@@ -94,6 +94,9 @@
SettingsView.xaml
+
+ UpdateFoundView.xaml
+
MSBuild:Compile
Designer
@@ -117,6 +120,7 @@
+