fix self-deletion
This commit is contained in:
parent
b8afdb35a8
commit
82b32eaf42
2 changed files with 7 additions and 4 deletions
|
@ -210,16 +210,17 @@ namespace EnvyUpdate
|
||||||
chkAutostart.IsEnabled = false;
|
chkAutostart.IsEnabled = false;
|
||||||
chkAutostart.IsChecked = 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 + "desktop.envy");
|
||||||
File.Delete(GlobalVars.appdata + "mobile.envy");
|
File.Delete(GlobalVars.appdata + "mobile.envy");
|
||||||
|
|
||||||
File.Delete(GlobalVars.startup + "\\EnvyUpdate.lnk");
|
File.Delete(GlobalVars.startup + "\\EnvyUpdate.lnk");
|
||||||
File.Delete(GlobalVars.startmenu + "\\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
|
else
|
||||||
chkInstall.IsChecked = true;
|
chkInstall.IsChecked = true;
|
||||||
|
|
|
@ -187,6 +187,8 @@ namespace EnvyUpdate
|
||||||
};
|
};
|
||||||
process.StartInfo = startInfo;
|
process.StartInfo = startInfo;
|
||||||
process.Start();
|
process.Start();
|
||||||
|
|
||||||
|
Environment.Exit(2);
|
||||||
}
|
}
|
||||||
public static int GetIDs(string IDtype)
|
public static int GetIDs(string IDtype)
|
||||||
{
|
{
|
||||||
|
|
Reference in a new issue