diff --git a/EnvyUpdate/EnvyUpdate.csproj b/EnvyUpdate/EnvyUpdate.csproj
index dc75b16..edc0a08 100644
--- a/EnvyUpdate/EnvyUpdate.csproj
+++ b/EnvyUpdate/EnvyUpdate.csproj
@@ -1,5 +1,6 @@
+
@@ -64,6 +65,8 @@
..\packages\Hardcodet.NotifyIcon.Wpf.1.0.8\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll
+
+
..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll
@@ -97,6 +100,11 @@
InfoWindow.xaml
+
+ Resources.de.resx
+ True
+ True
+
@@ -130,8 +138,12 @@
Settings.settings
True
+
+ PublicResXFileCodeGenerator
+ Resources.de.Designer.cs
+
- ResXFileCodeGenerator
+ PublicResXFileCodeGenerator
Resources.Designer.cs
@@ -161,16 +173,15 @@
True
-
-
-
+
This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
+
+
-
+
\ No newline at end of file
diff --git a/EnvyUpdate/GlobalVars.cs b/EnvyUpdate/GlobalVars.cs
index 4556a87..9b85493 100644
--- a/EnvyUpdate/GlobalVars.cs
+++ b/EnvyUpdate/GlobalVars.cs
@@ -1,14 +1,18 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.IO;
namespace EnvyUpdate
{
class GlobalVars
{
- public static string gpuName = null;
- public static bool mobile = false;
+ public static bool isMobile = false;
+ public static readonly string exeloc = System.Reflection.Assembly.GetEntryAssembly().Location;
+ public static readonly string exepath = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "\\";
+ public static readonly string startmenu = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu);
+ public static readonly string version = "2.0";
+ public static readonly string appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\envyupdate\\";
+ public static readonly string startup = Environment.GetFolderPath(Environment.SpecialFolder.Startup);
+ public static readonly string desktopOverride = exepath + "desktop.envy";
+ public static readonly string mobileOverride = exepath + "mobile.envy";
}
}
diff --git a/EnvyUpdate/InfoWindow.xaml b/EnvyUpdate/InfoWindow.xaml
index 08ba252..e05ca2d 100644
--- a/EnvyUpdate/InfoWindow.xaml
+++ b/EnvyUpdate/InfoWindow.xaml
@@ -4,10 +4,11 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:EnvyUpdate"
+ xmlns:p="clr-namespace:EnvyUpdate.Properties"
mc:Ignorable="d"
- Title="InfoWindow" Height="255" Width="286">
+ Title="" Height="255" Width="286" ResizeMode="NoResize" WindowStyle="ToolWindow" SizeToContent="WidthAndHeight">
-
+
@@ -16,6 +17,7 @@
+
diff --git a/EnvyUpdate/InfoWindow.xaml.cs b/EnvyUpdate/InfoWindow.xaml.cs
index 16a3915..071a352 100644
--- a/EnvyUpdate/InfoWindow.xaml.cs
+++ b/EnvyUpdate/InfoWindow.xaml.cs
@@ -1,5 +1,7 @@
-using System.Windows;
+using System;
+using System.Windows;
using System.Windows.Input;
+using System.IO;
namespace EnvyUpdate
{
@@ -8,12 +10,23 @@ namespace EnvyUpdate
///
public partial class InfoWindow : Window
{
+ bool defaultIsMobile = false;
+ bool isOverride = false;
public InfoWindow()
{
InitializeComponent();
+
+ if (GlobalVars.isMobile)
+ chkMobile.IsChecked = true;
+
+ if (Util.IsMobile())
+ defaultIsMobile = true;
+
+ if (defaultIsMobile != GlobalVars.isMobile)
+ isOverride = true;
}
- private void Button_Click(object sender, RoutedEventArgs e)
+ private void ButtonWeb_Click(object sender, RoutedEventArgs e)
{
System.Diagnostics.Process.Start("https://github.com/fyr77/EnvyUpdate/");
}
@@ -56,5 +69,62 @@ namespace EnvyUpdate
{
System.Diagnostics.Process.Start("https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md");
}
+
+ private void chkMobile_Checked(object sender, RoutedEventArgs e)
+ {
+ if (isOverride)
+ {
+ // If an override was present, delete it.
+ bool deleteSuccess = false;
+ while (!deleteSuccess)
+ {
+ try
+ {
+ File.Delete(GlobalVars.desktopOverride);
+ deleteSuccess = true;
+ }
+ catch (IOException)
+ {
+ // This is necessary in case someone ticks and unticks the option quickly, as the File.Create Method has sometimes yet to close the file.
+ }
+ }
+ isOverride = false;
+ }
+ else
+ {
+ File.Create(GlobalVars.mobileOverride).Close();
+ GlobalVars.isMobile = true;
+ isOverride = true;
+ }
+ }
+
+ private void chkMobile_Unchecked(object sender, RoutedEventArgs e)
+ {
+ if (isOverride)
+ {
+ // If an override was present, delete it.
+ bool deleteSuccess = false;
+ while (!deleteSuccess)
+ {
+ try
+ {
+ File.Delete(GlobalVars.mobileOverride);
+ deleteSuccess = true;
+ }
+ catch (IOException)
+ {
+ // This is necessary in case someone ticks and unticks the option quickly, as the File.Create Method has sometimes yet to close the file.
+ }
+ }
+
+ isOverride = false;
+ }
+ else
+ {
+ File.Create(GlobalVars.desktopOverride).Close();
+ GlobalVars.isMobile = false;
+ isOverride = true;
+ }
+ }
}
}
diff --git a/EnvyUpdate/MainWindow.xaml b/EnvyUpdate/MainWindow.xaml
index 078c8d0..d7300b3 100644
--- a/EnvyUpdate/MainWindow.xaml
+++ b/EnvyUpdate/MainWindow.xaml
@@ -4,18 +4,24 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:EnvyUpdate"
+ xmlns:p="clr-namespace:EnvyUpdate.Properties"
xmlns:tb="http://www.hardcodet.net/taskbar"
mc:Ignorable="d"
- Title="EnvyUpdate" Height="140" Width="463" Icon="icon.ico" ResizeMode="CanMinimize" StateChanged="Window_StateChanged" Closing="Window_Closing">
-
-
-
-
-
-
-
-
-
-
+ Title="EnvyUpdate" Height="159" Width="290.5" Icon="icon.ico" StateChanged="Window_StateChanged" Closing="Window_Closing" ResizeMode="CanMinimize">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EnvyUpdate/MainWindow.xaml.cs b/EnvyUpdate/MainWindow.xaml.cs
index ba23958..e38b963 100644
--- a/EnvyUpdate/MainWindow.xaml.cs
+++ b/EnvyUpdate/MainWindow.xaml.cs
@@ -1,5 +1,4 @@
using System;
-using System.Globalization;
using System.IO;
using System.Net;
using System.Text.RegularExpressions;
@@ -16,50 +15,43 @@ namespace EnvyUpdate
{
private string localDriv = null;
private string onlineDriv = null;
- private readonly string appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\envyupdate\\";
- private readonly string startup = Environment.GetFolderPath(Environment.SpecialFolder.Startup);
private string gpuURL = null;
- private readonly string exeloc = System.Reflection.Assembly.GetEntryAssembly().Location;
- private readonly string exepath = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "\\";
- private readonly string startmenu = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu);
- private readonly string version = "2.0";
private string argument = null;
private bool isDebug = false;
public MainWindow()
{
InitializeComponent();
- Title += " " + version;
+ Title += " " + GlobalVars.version;
// Try to get command line arguments
try
{
argument = Environment.GetCommandLineArgs()[1];
- Console.WriteLine("Starting in debug mode.");
}
catch (IndexOutOfRangeException)
{
// This is necessary, since .NET throws an exception if you check for a non-existant arg.
- Console.WriteLine("Starting in release mode.");
}
// Check if EnvyUpdate is already running
if (Util.IsInstanceOpen("EnvyUpdate"))
{
- MessageBox.Show("Application is already running.");
+ MessageBox.Show(Properties.Resources.instance_already_running);
Environment.Exit(1);
}
// Set correct ticks
- if (File.Exists(startup + "\\EnvyUpdate.lnk"))
+ if (File.Exists(GlobalVars.startup + "\\EnvyUpdate.lnk"))
chkAutostart.IsChecked = true;
- if (File.Exists(appdata + "EnvyUpdate.exe"))
+ if (File.Exists(GlobalVars.appdata + "EnvyUpdate.exe"))
chkInstall.IsChecked = true;
+
// Check if application is installed and update
- if (exepath == appdata)
+ if (GlobalVars.exepath == GlobalVars.appdata)
{
try
{
- if (Util.GetNewVer() != version)
+ if ((Util.GetNewVer() != GlobalVars.version) && (isDebug = false))
{
Util.UpdateApp();
}
@@ -71,10 +63,25 @@ namespace EnvyUpdate
// Also set correct ticks.
chkInstall.IsChecked = true;
}
- if (Util.GetLocDriv() != null)
+
+ // Check for overrides
+ if (File.Exists(GlobalVars.desktopOverride))
+ GlobalVars.isMobile = false;
+ else if (File.Exists(GlobalVars.mobileOverride))
+ GlobalVars.isMobile = true;
+ // Check if mobile, if no override is present
+ else
+ GlobalVars.isMobile = Util.IsMobile();
+
+ string locDriv = Util.GetLocDriv();
+ if (locDriv != null)
{
- localDriv = Util.GetLocDriv();
- textblockGPU.Text = localDriv;
+ localDriv = locDriv;
+ textblockGPU.Text = locDriv;
+ if (GlobalVars.isMobile)
+ textblockGPUName.Text = Util.GetGPUName(false) + " (mobile)";
+ else
+ textblockGPUName.Text = Util.GetGPUName(false);
}
else
{
@@ -85,14 +92,15 @@ namespace EnvyUpdate
isDebug = true;
break;
default:
- MessageBox.Show("No NVIDIA GPU found. Application will exit.");
+ MessageBox.Show(Properties.Resources.no_compatible_gpu);
Environment.Exit(255);
break;
}
}
-
+
DispatcherTimer Dt = new DispatcherTimer();
Dt.Tick += new EventHandler(Dt_Tick);
+ // Check for new updates every 5 hours.
Dt.Interval = new TimeSpan(5, 0, 0);
Dt.Start();
Load();
@@ -107,7 +115,6 @@ namespace EnvyUpdate
{
InfoWindow infoWin = new InfoWindow();
infoWin.ShowDialog();
- //System.Diagnostics.Process.Start("https://github.com/fyr77/EnvyUpdate/");
}
private void Load()
@@ -145,7 +152,7 @@ namespace EnvyUpdate
textblockOnline.Foreground = Brushes.Green;
}
- if (exepath == appdata)
+ if (GlobalVars.exepath == GlobalVars.appdata)
{
WindowState = WindowState.Minimized;
Hide();
@@ -176,47 +183,64 @@ namespace EnvyUpdate
{
chkAutostart.IsEnabled = true;
}
- if (exepath != appdata)
+ if (GlobalVars.exepath != GlobalVars.appdata)
{
- if (!Directory.Exists(appdata))
+ if (!Directory.Exists(GlobalVars.appdata))
{
- Directory.CreateDirectory(appdata);
+ Directory.CreateDirectory(GlobalVars.appdata);
}
- File.Copy(exeloc, appdata + "EnvyUpdate.exe", true);
- Util.CreateShortcut("EnvyUpdate", startmenu, appdata + "EnvyUpdate.exe", "Nvidia Updater Application.");
+ File.Copy(GlobalVars.exeloc, GlobalVars.appdata + "EnvyUpdate.exe", true);
+
+ if (File.Exists(GlobalVars.mobileOverride))
+ File.Copy(GlobalVars.mobileOverride, GlobalVars.appdata + "mobile.envy", true);
+ if (File.Exists(GlobalVars.desktopOverride))
+ File.Copy(GlobalVars.desktopOverride, GlobalVars.appdata + "desktop.envy", true);
+
+ Util.CreateShortcut("EnvyUpdate", GlobalVars.startmenu, GlobalVars.appdata + "EnvyUpdate.exe", Properties.Resources.app_description);
}
}
private void chkInstall_Unchecked(object sender, RoutedEventArgs e)
{
- if (chkAutostart != null)
+ // Only uninstall if user confirms. Prevents accidental uninstalls.
+ if (MessageBox.Show(Properties.Resources.uninstall_confirm, Properties.Resources.uninstall_heading, MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
{
- chkAutostart.IsEnabled = false;
- chkAutostart.IsChecked = false;
- }
- if (Directory.Exists(appdata))
- {
- File.Delete(appdata + "EnvyUpdate.exe");
- File.Delete(startup + "\\EnvyUpdate.lnk");
- File.Delete(startmenu + "\\EnvyUpdate.lnk");
+ if (chkAutostart != null)
+ {
+ chkAutostart.IsEnabled = false;
+ chkAutostart.IsChecked = false;
+ }
+ if ((GlobalVars.exepath == GlobalVars.appdata) && File.Exists(GlobalVars.appdata + "EnvyUpdate.exe"))
+ Util.SelfDelete();
+ else if (File.Exists(GlobalVars.appdata + "EnvyUpdate.exe"))
+ File.Delete(GlobalVars.appdata + "EnvyUpdate.exe");
+
+ File.Delete(GlobalVars.appdata + "desktop.envy");
+ File.Delete(GlobalVars.appdata + "mobile.envy");
+
+ File.Delete(GlobalVars.startup + "\\EnvyUpdate.lnk");
+ File.Delete(GlobalVars.startmenu + "\\EnvyUpdate.lnk");
}
+ else
+ chkInstall.IsChecked = true;
}
private void chkAutostart_Checked(object sender, RoutedEventArgs e)
{
- Util.CreateShortcut("EnvyUpdate", startup, appdata + "EnvyUpdate.exe", "Nvidia Updater Application.");
+ Util.CreateShortcut("EnvyUpdate", GlobalVars.startup, GlobalVars.appdata + "EnvyUpdate.exe", Properties.Resources.app_description);
}
private void chkAutostart_Unchecked(object sender, RoutedEventArgs e)
{
- File.Delete(startup + "\\EnvyUpdate.lnk");
+ File.Delete(GlobalVars.startup + "\\EnvyUpdate.lnk");
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
- var window = MessageBox.Show("Exit EnvyUpdate?", "", MessageBoxButton.YesNo);
- e.Cancel = (window == MessageBoxResult.No);
- Application.Current.Shutdown();
+ if (MessageBox.Show(Properties.Resources.exit_confirm, "", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
+ Application.Current.Shutdown();
+ else
+ e.Cancel = true;
}
}
}
\ No newline at end of file
diff --git a/EnvyUpdate/Notify.cs b/EnvyUpdate/Notify.cs
index a7c944c..7afaecf 100644
--- a/EnvyUpdate/Notify.cs
+++ b/EnvyUpdate/Notify.cs
@@ -11,7 +11,7 @@ namespace EnvyUpdate
notificationManager.Show(new NotificationContent
{
Title = "EnvyUpdate",
- Message = "A new driver update is available for your graphics card. Click for more info.",
+ Message = Properties.Resources.update_popup_message,
Type = NotificationType.Information
}, onClick: Util.ShowMain);
}
diff --git a/EnvyUpdate/Properties/Resources.Designer.cs b/EnvyUpdate/Properties/Resources.Designer.cs
index dfd994e..33ad0e8 100644
--- a/EnvyUpdate/Properties/Resources.Designer.cs
+++ b/EnvyUpdate/Properties/Resources.Designer.cs
@@ -8,10 +8,10 @@
//
//------------------------------------------------------------------------------
-namespace EnvyUpdate.Properties
-{
-
-
+namespace EnvyUpdate.Properties {
+ using System;
+
+
///
/// A strongly-typed resource class, for looking up localized strings, etc.
///
@@ -19,53 +19,189 @@ namespace EnvyUpdate.Properties
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
+ public class Resources {
+
private static global::System.Resources.ResourceManager resourceMan;
-
+
private static global::System.Globalization.CultureInfo resourceCulture;
-
+
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
+ internal Resources() {
}
-
+
///
/// Returns the cached ResourceManager instance used by this class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
+ public static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("EnvyUpdate.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
-
+
///
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
+ public static global::System.Globalization.CultureInfo Culture {
+ get {
return resourceCulture;
}
- set
- {
+ set {
resourceCulture = value;
}
}
+
+ ///
+ /// Looks up a localized string similar to NVIDIA Updater Application..
+ ///
+ public static string app_description {
+ get {
+ return ResourceManager.GetString("app_description", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Exit EnvyUpdate?.
+ ///
+ public static string exit_confirm {
+ get {
+ return ResourceManager.GetString("exit_confirm", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Preference reset..
+ ///
+ public static string info_reset_caption {
+ get {
+ return ResourceManager.GetString("info_reset_caption", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Preference reset.\nEnvyUpdate will ask for computer form factor the next time it is started..
+ ///
+ public static string info_reset_message {
+ get {
+ return ResourceManager.GetString("info_reset_message", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Application is already running..
+ ///
+ public static string instance_already_running {
+ get {
+ return ResourceManager.GetString("instance_already_running", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to New version of EnvyUpdate found. Application will restart.\nThis will probably take a few seconds..
+ ///
+ public static string message_new_version {
+ get {
+ return ResourceManager.GetString("message_new_version", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No NVIDIA GPU found. Application will exit..
+ ///
+ public static string no_compatible_gpu {
+ get {
+ return ResourceManager.GetString("no_compatible_gpu", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Autostart.
+ ///
+ public static string ui_autostart {
+ get {
+ return ResourceManager.GetString("ui_autostart", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Mobile GPU (Laptop, etc)?.
+ ///
+ public static string ui_info_mobile {
+ get {
+ return ResourceManager.GetString("ui_info_mobile", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to EnvyUpdate website.
+ ///
+ public static string ui_info_website {
+ get {
+ return ResourceManager.GetString("ui_info_website", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Install.
+ ///
+ public static string ui_install {
+ get {
+ return ResourceManager.GetString("ui_install", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Local driver version:.
+ ///
+ public static string ui_localdriver {
+ get {
+ return ResourceManager.GetString("ui_localdriver", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Online driver version:.
+ ///
+ public static string ui_onlinedriver {
+ get {
+ return ResourceManager.GetString("ui_onlinedriver", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Are you sure you want to uninstall EnvyUpdate?.
+ ///
+ public static string uninstall_confirm {
+ get {
+ return ResourceManager.GetString("uninstall_confirm", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Uninstall?.
+ ///
+ public static string uninstall_heading {
+ get {
+ return ResourceManager.GetString("uninstall_heading", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to A new driver update is available for your graphics card. Click for more info..
+ ///
+ public static string update_popup_message {
+ get {
+ return ResourceManager.GetString("update_popup_message", resourceCulture);
+ }
+ }
}
}
diff --git a/EnvyUpdate/Properties/Resources.de.Designer.cs b/EnvyUpdate/Properties/Resources.de.Designer.cs
new file mode 100644
index 0000000..e69de29
diff --git a/EnvyUpdate/Properties/Resources.de.resx b/EnvyUpdate/Properties/Resources.de.resx
new file mode 100644
index 0000000..36a36bf
--- /dev/null
+++ b/EnvyUpdate/Properties/Resources.de.resx
@@ -0,0 +1,168 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ NVIDIA Aktualisierungsanwendung.
+
+
+ EnvyUpdate schließen?
+
+
+ Einstellung zurückgesetzt.
+
+
+ Einstellung zurückgesetzt.\nBeim nächsten Start wird EnvyUpdate erneut nach dem Computerformfaktor fragen.
+
+
+ Anwendung läuft bereits.
+
+
+ Neue Version von EnvyUpdate gefunden. Die Anwendung wird neu starten.\nDies wird wahrscheinlich einige Sekunden dauern.
+
+
+ Keine NVIDIA GPU gefunden. EnvyUpdate wird sich nun schließen.
+
+
+ Autostart
+
+
+ Mobile Grafikkarte (Laptop, etc)?
+
+
+ EnvyUpdate Webseite
+
+
+ Installieren
+
+
+ Lokale Treiberversion:
+
+
+ Online Treiberversion:
+
+
+ Sind Sie sich sicher, dass Sie EnvyUpdate deinstallieren wollen?
+
+
+ Deinstallieren?
+
+
+ Eine neue Treiberversion ist verfügbar. Hier klicken für mehr Info.
+
+
\ No newline at end of file
diff --git a/EnvyUpdate/Properties/Resources.resx b/EnvyUpdate/Properties/Resources.resx
index af7dbeb..67f12e1 100644
--- a/EnvyUpdate/Properties/Resources.resx
+++ b/EnvyUpdate/Properties/Resources.resx
@@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
- : System.Serialization.Formatters.Binary.BinaryFormatter
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
@@ -60,6 +60,7 @@
: and then encoded with base64 encoding.
-->
+
@@ -68,9 +69,10 @@
-
+
+
@@ -85,9 +87,10 @@
-
+
+
@@ -109,9 +112,57 @@
2.0
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ NVIDIA Updater Application.
+
+
+ Exit EnvyUpdate?
+
+
+ Preference reset.
+
+
+ Preference reset.\nEnvyUpdate will ask for computer form factor the next time it is started.
+
+
+ Application is already running.
+
+
+ New version of EnvyUpdate found. Application will restart.\nThis will probably take a few seconds.
+
+
+ No NVIDIA GPU found. Application will exit.
+
+
+ Autostart
+
+
+ Mobile GPU (Laptop, etc)?
+
+
+ EnvyUpdate website
+
+
+ Install
+
+
+ Local driver version:
+
+
+ Online driver version:
+
+
+ Are you sure you want to uninstall EnvyUpdate?
+
+
+ Uninstall?
+
+
+ A new driver update is available for your graphics card. Click for more info.
+
\ No newline at end of file
diff --git a/EnvyUpdate/Util.cs b/EnvyUpdate/Util.cs
index 1d8aa7b..46a9681 100644
--- a/EnvyUpdate/Util.cs
+++ b/EnvyUpdate/Util.cs
@@ -9,6 +9,8 @@ using System.Windows;
using Newtonsoft.Json;
using System.Xml;
using System.Xml.Linq;
+using System.Text.RegularExpressions;
+using System.Runtime.InteropServices;
namespace EnvyUpdate
{
@@ -153,11 +155,11 @@ namespace EnvyUpdate
client.DownloadFile("https://github.com/fyr77/EnvyUpdate/releases/latest/download/EnvyUpdate.exe", appdata + "EnvyUpdated.exe");
}
- MessageBox.Show("New version of EnvyUpdate found. Application will restart.\nThis will probably take a few seconds.");
+ MessageBox.Show(Properties.Resources.message_new_version);
// Replace exe with new one.
// This starts a seperate cmd process which will wait a bit, then delete EnvyUpdate and rename the previously downloaded EnvyUpdated.exe to EnvyUpdate.exe
- // I know this is a bit dumb, but I honestly couldn't think of a different way to solve this properly, since the Application would need to delete itself.
+ // I know this is a bit dumb, but I honestly couldn't think of a different way to solve this properly, since the Application has to delete itself.
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo
{
@@ -171,6 +173,21 @@ namespace EnvyUpdate
Environment.Exit(2);
}
+ public static void SelfDelete()
+ {
+ string appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\envyupdate\\";
+
+ Process process = new Process();
+ ProcessStartInfo startInfo = new ProcessStartInfo
+ {
+ WindowStyle = ProcessWindowStyle.Hidden,
+ WorkingDirectory = appdata,
+ FileName = "cmd.exe",
+ Arguments = "/C timeout 5 && del EnvyUpdate.exe"
+ };
+ process.StartInfo = startInfo;
+ process.Start();
+ }
public static int GetIDs(string IDtype)
{
// TODO: check for 2 occurences of GPU - if yes ask if mobile!!!
@@ -196,7 +213,7 @@ namespace EnvyUpdate
}
}
XDocument xDoc = XDocument.Parse(xmlcontent);
- string gpuName = GetGPUName();
+ string gpuName = GetGPUName(true);
switch (IDtype)
{
@@ -266,7 +283,7 @@ namespace EnvyUpdate
value = value1;
- if (GlobalVars.mobile)
+ if (GlobalVars.isMobile)
{
value = value2;
}
@@ -317,7 +334,7 @@ namespace EnvyUpdate
/// Returns GPU name in lower case.
///
///
- private static string GetGPUName()
+ public static string GetGPUName(bool lower)
{
string GPUName = null;
foreach (ManagementObject obj in new ManagementObjectSearcher("SELECT * FROM Win32_VideoController").Get())
@@ -333,12 +350,35 @@ namespace EnvyUpdate
if (obj["Description"].ToString().ToLower().Contains("nvidia"))
{
// If it's an Nvidia GPU, use VideoProcessor so we don't have to truncate the resulting string.
- GPUName = obj["VideoProcessor"].ToString().ToLower();
+ if (lower)
+ {
+ GPUName = obj["VideoProcessor"].ToString().ToLower();
+ // Remove any 3GB, 6GB or similar from name. We don't need to know the VRAM to get results.
+ GPUName = Regex.Replace(GPUName, "\\d+GB", "");
+ }
+ else
+ GPUName = obj["VideoProcessor"].ToString();
+
break;
}
}
// This should NEVER return null outside of debugging mode, since EnvyUpdate should refuse to start without and Nvidia GPU.
return GPUName;
}
+ public static bool IsMobile()
+ {
+ bool result = false;
+
+ foreach (ManagementObject obj in new ManagementObjectSearcher("SELECT * FROM Win32_Battery").Get())
+ {
+ result = true;
+ }
+ foreach (ManagementObject obj in new ManagementObjectSearcher("SELECT * FROM Win32_PortableBattery").Get())
+ {
+ result = true;
+ }
+
+ return result;
+ }
}
}
\ No newline at end of file
diff --git a/EnvyUpdate/packages.config b/EnvyUpdate/packages.config
index d83496a..5bbda94 100644
--- a/EnvyUpdate/packages.config
+++ b/EnvyUpdate/packages.config
@@ -1,8 +1,9 @@
-
+
+
\ No newline at end of file