mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-01-02 10:43:31 +00:00
Added automatic removal of Squirrel version
This commit is contained in:
parent
bc64ac33f8
commit
821f09d259
@ -30,6 +30,7 @@ namespace Artemis
|
||||
DllManager.RestoreLogitechDll();
|
||||
// Check compatibility before trying to boot further
|
||||
CompatibilityService.CheckRivaTuner();
|
||||
Updater.CleanSquirrel();
|
||||
|
||||
Initialize();
|
||||
BindSpecialValues();
|
||||
|
||||
@ -147,7 +147,7 @@ namespace Artemis.Utilities
|
||||
|
||||
private static object ConvertBytesToMegabytes(long bytes)
|
||||
{
|
||||
return Math.Round((bytes / 1024f) / 1024f, 2);
|
||||
return Math.Round(bytes / 1024f / 1024f, 2);
|
||||
}
|
||||
|
||||
/// <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>
|
||||
/// JSON default value handling can only go so far, so the update will take care of defaults
|
||||
/// on the offsets if they are null
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user