diff --git a/EnvyUpdate/GlobalVars.cs b/EnvyUpdate/GlobalVars.cs
index c5ab17d..9804523 100644
--- a/EnvyUpdate/GlobalVars.cs
+++ b/EnvyUpdate/GlobalVars.cs
@@ -9,7 +9,6 @@ namespace EnvyUpdate
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 float version = 2.8F;
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";
diff --git a/EnvyUpdate/InfoWindow.xaml b/EnvyUpdate/InfoWindow.xaml
index 66d475f..3b31e26 100644
--- a/EnvyUpdate/InfoWindow.xaml
+++ b/EnvyUpdate/InfoWindow.xaml
@@ -17,8 +17,7 @@
-
-
+
diff --git a/EnvyUpdate/InfoWindow.xaml.cs b/EnvyUpdate/InfoWindow.xaml.cs
index 8cdd852..76eded5 100644
--- a/EnvyUpdate/InfoWindow.xaml.cs
+++ b/EnvyUpdate/InfoWindow.xaml.cs
@@ -10,21 +10,15 @@ namespace EnvyUpdate
///
public partial class InfoWindow : Window
{
- bool defaultIsMobile = false;
- bool isOverride = false;
public InfoWindow()
{
InitializeComponent();
- if (GlobalVars.isMobile)
- chkMobile.IsChecked = true;
+ System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
+ System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
+ string version = fvi.FileVersion;
- defaultIsMobile = Util.IsMobile();
-
- if (defaultIsMobile != GlobalVars.isMobile)
- isOverride = true;
-
- chkDCH.IsChecked = Util.IsDCH();
+ labelVer.Content += " " + version;
}
private void ButtonWeb_Click(object sender, RoutedEventArgs e)
@@ -74,62 +68,5 @@ namespace EnvyUpdate
{
System.Diagnostics.Process.Start("https://github.com/MarcStan/resource-embedder/blob/master/LICENSE");
}
-
- 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.cs b/EnvyUpdate/MainWindow.xaml.cs
index 3b1c2b9..4df3f60 100644
--- a/EnvyUpdate/MainWindow.xaml.cs
+++ b/EnvyUpdate/MainWindow.xaml.cs
@@ -23,7 +23,6 @@ namespace EnvyUpdate
public MainWindow()
{
InitializeComponent();
- Title += " " + GlobalVars.version;
// Try to get command line arguments
try
@@ -41,35 +40,8 @@ namespace EnvyUpdate
MessageBox.Show(Properties.Resources.instance_already_running);
Environment.Exit(1);
}
- // Set correct ticks
- /*
- if (File.Exists(GlobalVars.startup + "\\EnvyUpdate.lnk"))
- chkAutostart.IsChecked = true;
- if (File.Exists(GlobalVars.appdata + "EnvyUpdate.exe"))
- chkInstall.IsChecked = true;*/
- //ALSO BROKEN
- // Check if application is installed and update
- /*
- if (GlobalVars.exepath == GlobalVars.appdata)
- {
- try
- {
- if (Util.GetNewVer() > GlobalVars.version)
- {
- Util.UpdateApp();
- }
- }
- catch (WebException)
- {
- // Silently fail.
- }
- // Also set correct ticks.
- chkInstall.IsChecked = true;
- }*/
- //BROKEN
-
- // Delete installed versions
+ // Delete installed legacy versions
UninstallAll();
// Check for overrides
@@ -196,66 +168,6 @@ namespace EnvyUpdate
}
}
- /*private void chkInstall_Checked(object sender, RoutedEventArgs e)
- {
- if (chkAutostart != null)
- {
- chkAutostart.IsEnabled = true;
- }
- if (GlobalVars.exepath != GlobalVars.appdata)
- {
- if (!Directory.Exists(GlobalVars.appdata))
- {
- Directory.CreateDirectory(GlobalVars.appdata);
- }
- 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)
- {
- // 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)
- {
- if (chkAutostart != null)
- {
- chkAutostart.IsEnabled = false;
- chkAutostart.IsChecked = false;
- }
-
- File.Delete(GlobalVars.appdata + "desktop.envy");
- File.Delete(GlobalVars.appdata + "mobile.envy");
-
- File.Delete(GlobalVars.startup + "\\EnvyUpdate.lnk");
- File.Delete(GlobalVars.startmenu + "\\EnvyUpdate.lnk");
-
- 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");
- }
- else
- chkInstall.IsChecked = true;
- }
-
- private void chkAutostart_Checked(object sender, RoutedEventArgs e)
- {
- Util.CreateShortcut("EnvyUpdate", GlobalVars.startup, GlobalVars.appdata + "EnvyUpdate.exe", Properties.Resources.app_description);
- }
-
- private void chkAutostart_Unchecked(object sender, RoutedEventArgs e)
- {
- File.Delete(GlobalVars.startup + "\\EnvyUpdate.lnk");
- }
- */
-
public void UninstallAll()
{
if (File.Exists(GlobalVars.startup + "\\EnvyUpdate.lnk"))
diff --git a/EnvyUpdate/Properties/AssemblyInfo.cs b/EnvyUpdate/Properties/AssemblyInfo.cs
index a86b276..1847b65 100644
--- a/EnvyUpdate/Properties/AssemblyInfo.cs
+++ b/EnvyUpdate/Properties/AssemblyInfo.cs
@@ -49,5 +49,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2.8")]
-[assembly: AssemblyFileVersion("2.8")]
+[assembly: AssemblyVersion("2.9.0")]
+[assembly: AssemblyFileVersion("2.9.0")]