fix self-deletion

This commit is contained in:
fyr77 2020-08-04 17:51:48 +02:00
parent b8afdb35a8
commit 82b32eaf42
2 changed files with 7 additions and 4 deletions

View file

@ -210,16 +210,17 @@ namespace EnvyUpdate
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");
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;

View file

@ -187,6 +187,8 @@ namespace EnvyUpdate
};
process.StartInfo = startInfo;
process.Start();
Environment.Exit(2);
}
public static int GetIDs(string IDtype)
{