fix updater

This commit is contained in:
fyr77 2020-08-04 18:11:04 +02:00
parent 67c4697134
commit 26df20827f
3 changed files with 8 additions and 27 deletions

View file

@ -9,7 +9,7 @@ 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 string version = "2.1";
public static readonly string version = "2.2";
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";

View file

@ -24,6 +24,12 @@ namespace EnvyUpdate
InitializeComponent();
Title += " " + GlobalVars.version;
if (Util.GetNewVer() != GlobalVars.version)
{
MessageBox.Show("yes");
}
MessageBox.Show(Util.GetNewVer());
// Try to get command line arguments
try
{
@ -51,7 +57,7 @@ namespace EnvyUpdate
{
try
{
if ((Util.GetNewVer() != GlobalVars.version) && (isDebug = false))
if (Util.GetNewVer() != GlobalVars.version)
{
Util.UpdateApp();
}

View file

@ -16,31 +16,6 @@ namespace EnvyUpdate
{
internal class Util
{
/// <summary>
/// Parses GPU info from a cookie file
/// </summary>
/// <param name="path"></param>
/// <param name="term"></param>
/// <returns></returns>
public static int GetData(string path, string term)
{
string found = null;
string line;
using (StreamReader file = new StreamReader(path))
{
while ((line = file.ReadLine()) != null)
{
if (line.Contains(term))
{
found = line;
break;
}
}
}
int lastno = Convert.ToInt32(found.Split().Last());
return lastno;
}
/// <summary>
/// Gets local driver version.
/// </summary>