This commit is contained in:
Alessandro Autiero
2024-06-03 16:26:04 +02:00
parent 3069f3aa05
commit 46034aa1fa
24 changed files with 242 additions and 189 deletions

View File

@@ -46,16 +46,26 @@ class _HomePageState extends State<HomePage> with WindowListener, AutomaticKeepA
@override
void initState() {
windowManager.addListener(this);
WidgetsBinding.instance.addPostFrameCallback((_) {
_updateController.notifyLauncherUpdate();
_updateController.updateReboot();
watchDlls().listen((filePath) => showDllDeletedDialog(() {
downloadCriticalDllInteractive(filePath);
}));
});
WidgetsBinding.instance.addPostFrameCallback((_) => _checkUpdates());
super.initState();
}
void _checkUpdates() {
_updateController.notifyLauncherUpdate();
if(!dllsDirectory.existsSync()) {
dllsDirectory.createSync(recursive: true);
}
for(final injectable in InjectableDll.values) {
downloadCriticalDllInteractive("${injectable.name}.dll");
}
watchDlls().listen((filePath) => showDllDeletedDialog(() {
downloadCriticalDllInteractive(filePath);
}));
}
@override
void onWindowClose() {
exit(0); // Force closing