fix updater
This commit is contained in:
parent
67c4697134
commit
26df20827f
3 changed files with 8 additions and 27 deletions
|
@ -9,7 +9,7 @@ namespace EnvyUpdate
|
||||||
public static readonly string exeloc = System.Reflection.Assembly.GetEntryAssembly().Location;
|
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 exepath = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "\\";
|
||||||
public static readonly string startmenu = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu);
|
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 appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\envyupdate\\";
|
||||||
public static readonly string startup = Environment.GetFolderPath(Environment.SpecialFolder.Startup);
|
public static readonly string startup = Environment.GetFolderPath(Environment.SpecialFolder.Startup);
|
||||||
public static readonly string desktopOverride = exepath + "desktop.envy";
|
public static readonly string desktopOverride = exepath + "desktop.envy";
|
||||||
|
|
|
@ -24,6 +24,12 @@ namespace EnvyUpdate
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Title += " " + GlobalVars.version;
|
Title += " " + GlobalVars.version;
|
||||||
|
|
||||||
|
if (Util.GetNewVer() != GlobalVars.version)
|
||||||
|
{
|
||||||
|
MessageBox.Show("yes");
|
||||||
|
}
|
||||||
|
MessageBox.Show(Util.GetNewVer());
|
||||||
|
|
||||||
// Try to get command line arguments
|
// Try to get command line arguments
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -51,7 +57,7 @@ namespace EnvyUpdate
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ((Util.GetNewVer() != GlobalVars.version) && (isDebug = false))
|
if (Util.GetNewVer() != GlobalVars.version)
|
||||||
{
|
{
|
||||||
Util.UpdateApp();
|
Util.UpdateApp();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,31 +16,6 @@ namespace EnvyUpdate
|
||||||
{
|
{
|
||||||
internal class Util
|
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>
|
/// <summary>
|
||||||
/// Gets local driver version.
|
/// Gets local driver version.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Reference in a new issue