Merge pull request #38 from Zagrios/hotfix/install-version-process-was-not-killed

hotfix/fix get main window from windows service
This commit is contained in:
MathieuG-P
2022-12-28 20:42:49 +01:00
committed by GitHub
2 changed files with 8 additions and 1 deletions
+4 -1
View File
@@ -8,6 +8,7 @@ import { InstallationLocationService } from "./installation-location.service";
import { ctrlc } from "ctrlc-windows";
import { BSLocalVersionService } from "./bs-local-version.service";
import isOnline from 'is-online';
import { WindowManagerService } from "./window-manager.service";
export class BSInstallerService{
@@ -16,6 +17,7 @@ export class BSInstallerService{
private readonly utils: UtilsService;
private readonly installLocationService: InstallationLocationService;
private readonly localVersionService: BSLocalVersionService;
private readonly windows: WindowManagerService;
private downloadProcess: ChildProcessWithoutNullStreams;
@@ -23,8 +25,9 @@ export class BSInstallerService{
this.utils = UtilsService.getInstance();
this.installLocationService = InstallationLocationService.getInstance();
this.localVersionService = BSLocalVersionService.getInstance();
this.windows = WindowManagerService.getInstance();
this.utils.getMainWindow().on("close", () => {
this.windows.getWindows("index.html").on("close", () => {
this.killDownloadProcess();
});
}
@@ -75,4 +75,8 @@ export class WindowManagerService{
});
}
public getWindows(window: AppWindow): BrowserWindow{
return this.windows.get(window);
}
}