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:
parent
bc64ac33f8
commit
821f09d259
@ -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();
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user