@@ -14,21 +14,19 @@ const remote: typeof import("@electron/remote") = require("@electron/remote");
1414const argon2 : typeof import ( "argon2" ) = require ( "argon2" ) ;
1515const logger = createLogger ( path . join ( WINBOAT_DIR , "install.log" ) ) ;
1616
17- export const InstallStates = {
18- IDLE : "Preparing" ,
19- CREATING_COMPOSE_FILE : "Creating Compose File" ,
20- CREATING_OEM : "Creating OEM Assets" ,
21- STARTING_CONTAINER : "Starting Container" ,
22- MONITORING_PREINSTALL : "Monitoring Preinstall" ,
23- INSTALLING_WINDOWS : "Installing Windows" ,
24- COMPLETED : "Completed" ,
25- INSTALL_ERROR : "Install Error" ,
26- } as const ;
27-
28- export type InstallState = ( typeof InstallStates ) [ keyof typeof InstallStates ] ;
17+ export enum InstallStates {
18+ IDLE = "Preparing" ,
19+ CREATING_COMPOSE_FILE = "Creating Compose File" ,
20+ CREATING_OEM = "Creating OEM Assets" ,
21+ STARTING_CONTAINER = "Starting Container" ,
22+ MONITORING_PREINSTALL = "Monitoring Preinstall" ,
23+ INSTALLING_WINDOWS = "Installing Windows" ,
24+ COMPLETED = "Completed" ,
25+ INSTALL_ERROR = "Install Error" ,
26+ } ;
2927
3028interface InstallEvents {
31- stateChanged : ( state : InstallState ) => void ;
29+ stateChanged : ( state : InstallStates ) => void ;
3230 preinstallMsg : ( msg : string ) => void ;
3331 error : ( error : Error ) => void ;
3432 vncPortChanged : ( port : number ) => void ;
@@ -37,7 +35,7 @@ interface InstallEvents {
3735export class InstallManager {
3836 conf : InstallConfiguration ;
3937 emitter : Emitter < InstallEvents > ;
40- state : InstallState ;
38+ state : InstallStates ;
4139 preinstallMsg : string ;
4240 container : ContainerManager ;
4341
@@ -49,7 +47,7 @@ export class InstallManager {
4947 this . container = createContainer ( conf . container ) ;
5048 }
5149
52- changeState ( newState : InstallState ) {
50+ changeState ( newState : InstallStates ) {
5351 this . state = newState ;
5452 this . emitter . emit ( "stateChanged" , newState ) ;
5553 logger . info ( `New state: "${ newState } "` ) ;
0 commit comments