mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 18:11:27 -07:00
Add program size estimation
conditions are kinda messy but its fine
This commit is contained in:
parent
54b65f8728
commit
57e6454fd7
@ -188,7 +188,10 @@ namespace Bloxstrap
|
|||||||
await ApplyModifications();
|
await ApplyModifications();
|
||||||
|
|
||||||
if (App.IsFirstRun || FreshInstall)
|
if (App.IsFirstRun || FreshInstall)
|
||||||
|
{
|
||||||
Register();
|
Register();
|
||||||
|
RegisterProgramSize();
|
||||||
|
}
|
||||||
|
|
||||||
CheckInstall();
|
CheckInstall();
|
||||||
|
|
||||||
@ -425,6 +428,20 @@ namespace Bloxstrap
|
|||||||
App.Logger.WriteLine("[Bootstrapper::StartRoblox] Registered application");
|
App.Logger.WriteLine("[Bootstrapper::StartRoblox] Registered application");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RegisterProgramSize()
|
||||||
|
{
|
||||||
|
App.Logger.WriteLine("[Bootstrapper::RegisterProgramSize] Registering approximate program size...");
|
||||||
|
|
||||||
|
using RegistryKey uninstallKey = Registry.CurrentUser.CreateSubKey($"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{App.ProjectName}");
|
||||||
|
|
||||||
|
// sum compressed and uncompressed package sizes and convert to kilobytes
|
||||||
|
int totalSize = (_versionPackageManifest.Sum(x => x.Size) + _versionPackageManifest.Sum(x => x.PackedSize)) / 1000;
|
||||||
|
|
||||||
|
uninstallKey.SetValue("EstimatedSize", totalSize);
|
||||||
|
|
||||||
|
App.Logger.WriteLine($"[Bootstrapper::RegisterProgramSize] Registered as {totalSize} KB");
|
||||||
|
}
|
||||||
|
|
||||||
private void CheckInstallMigration()
|
private void CheckInstallMigration()
|
||||||
{
|
{
|
||||||
// check if we've changed our install location since the last time we started
|
// check if we've changed our install location since the last time we started
|
||||||
@ -785,6 +802,10 @@ namespace Bloxstrap
|
|||||||
|
|
||||||
App.State.Prop.VersionGuid = _latestVersionGuid;
|
App.State.Prop.VersionGuid = _latestVersionGuid;
|
||||||
|
|
||||||
|
// don't register program size until the program is registered
|
||||||
|
if (!App.IsFirstRun && !FreshInstall)
|
||||||
|
RegisterProgramSize();
|
||||||
|
|
||||||
if (Dialog is not null)
|
if (Dialog is not null)
|
||||||
Dialog.CancelEnabled = false;
|
Dialog.CancelEnabled = false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user