1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-31 09:43:46 +00:00

Added automatic removal of Squirrel version

This commit is contained in:
SpoinkyNL 2017-11-28 21:26:28 +01:00
parent bc64ac33f8
commit 821f09d259
2 changed files with 26 additions and 2 deletions

View File

@ -30,6 +30,7 @@ namespace Artemis
DllManager.RestoreLogitechDll(); DllManager.RestoreLogitechDll();
// Check compatibility before trying to boot further // Check compatibility before trying to boot further
CompatibilityService.CheckRivaTuner(); CompatibilityService.CheckRivaTuner();
Updater.CleanSquirrel();
Initialize(); Initialize();
BindSpecialValues(); BindSpecialValues();

View File

@ -147,7 +147,7 @@ namespace Artemis.Utilities
private static object ConvertBytesToMegabytes(long bytes) private static object ConvertBytesToMegabytes(long bytes)
{ {
return Math.Round((bytes / 1024f) / 1024f, 2); return Math.Round(bytes / 1024f / 1024f, 2);
} }
/// <summary> /// <summary>
@ -189,6 +189,29 @@ namespace Artemis.Utilities
} }
} }
/// <summary>
/// Removes the old Squirrel-based version of Artemis if present
/// </summary>
public static void CleanSquirrel()
{
var squirrelPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Artemis";
if (!Directory.Exists(squirrelPath))
return;
var psi = new ProcessStartInfo
{
FileName = squirrelPath + "\\Update.exe",
Arguments = "--uninstall",
Verb = "runas"
};
var process = new System.Diagnostics.Process {StartInfo = psi};
process.Start();
process.WaitForExit();
Directory.Delete(squirrelPath, true);
}
/// <summary> /// <summary>
/// JSON default value handling can only go so far, so the update will take care of defaults /// JSON default value handling can only go so far, so the update will take care of defaults
/// on the offsets if they are null /// on the offsets if they are null