@@ -218,36 +218,23 @@ const downloadAndUnzipFrontendMac = async (tag = undefined) => {
218
218
} ;
219
219
220
220
/**
221
- * Spawn a PowerShell process to launch the InnoSetup installer executable, which contains the frontend and backend
221
+ * Spawn a process to launch the InnoSetup installer executable, which contains the frontend and backend
222
222
* upon confirmation from the user, the installer will be launched & Electron will exit
223
223
* @returns {Promise<boolean> } true if the installer executable was launched successfully, false otherwise
224
224
*/
225
225
const spawnScriptToLaunchInstaller = ( ) => {
226
-
227
- const shellScript = `Start-Process -FilePath "${ installerExePath } "` ;
228
-
229
- return new Promise ( ( resolve , reject ) => {
230
- const ps = spawn ( "powershell.exe" , [ "-Command" , shellScript ] ) ;
231
- currentChildProcess = ps ;
232
-
233
- ps . stdout . on ( "data" , ( data ) => {
234
- console . log ( data . toString ( ) ) ;
235
- } ) ;
236
-
237
- ps . stderr . on ( "data" , ( data ) => {
238
- currentChildProcess = null ;
239
- console . error ( data . toString ( ) ) ;
240
- } ) ;
241
-
242
- ps . on ( "exit" , ( code ) => {
243
- currentChildProcess = null ;
244
- if ( code === 0 ) {
245
- resolve ( true ) ;
246
- } else {
247
- resolve ( false ) ;
248
- }
226
+ try {
227
+ // Launch the installer executable directly without waiting for it to finish
228
+ const child = spawn ( installerExePath , [ ] , {
229
+ detached : true ,
230
+ stdio : "ignore"
249
231
} ) ;
250
- } ) ;
232
+ child . unref ( ) ;
233
+ return true ;
234
+ } catch ( e ) {
235
+ consoleLogger . error ( `Failed to launch installer: ${ e . message } ` ) ;
236
+ return false ;
237
+ }
251
238
} ;
252
239
253
240
0 commit comments