diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index af61e52c..a7ff00e9 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -1373,7 +1373,7 @@ export class CodeApplication extends Disposable { private async openDeploylWindow(accessor: ServicesAccessor): Promise { const DeployMainService = accessor.get(IDeployMainService); await new Promise((resolve, reject) => { - DeployMainService.openDeployWindow().then(() => { + DeployMainService.openDeployWindow(true).then(() => { resolve(void 0); }).catch((error) => { console.log(error); diff --git a/src/vs/code/electron-sandbox/deploy/deployWindowMain.ts b/src/vs/code/electron-sandbox/deploy/deployWindowMain.ts index 99deddf6..2cdf4dc8 100644 --- a/src/vs/code/electron-sandbox/deploy/deployWindowMain.ts +++ b/src/vs/code/electron-sandbox/deploy/deployWindowMain.ts @@ -457,8 +457,8 @@ class deployWindow { if (this.notNowRadio && this.notNowRadio instanceof HTMLInputElement && this.notNowRadio.checked) { this.justDownLoadTabArrayIndex = 0; this.localInstallTabArrayIndex = 0; - console.log('renderer send kylinide.installWizard.skipWizard'); - ipcRenderer.send('kylinide.installWizard.skipWizard'); + // console.log('renderer send kylinide.installWizard.skipWizard'); + ipcRenderer.send('kylinide.installWizard.closeWizard', { type: "skip" }); } else if (this.onlineInstallRadio && this.onlineInstallRadio instanceof HTMLInputElement && this.onlineInstallRadio.checked) { this.justDownLoadTabArrayIndex = 0; this.localInstallTabArrayIndex = 0; @@ -773,10 +773,10 @@ class deployWindow { ipcRenderer.send('kylinide.installWizard.helpLink', { type: "helpLink" }) }); - document.getElementById('skipAll')?.addEventListener('click', () => { - console.log("render send kylinide.installWizard.skipWizard"); - ipcRenderer.send('kylinide.installWizard.skipWizard'); - }); + // document.getElementById('skipAll')?.addEventListener('click', () => { + // console.log("render send kylinide.installWizard.skipWizard"); + // ipcRenderer.send('kylinide.installWizard.skipWizard'); + // }); this.prevBtn!.addEventListener('click', () => { console.log('click prevStep'); diff --git a/src/vs/platform/issue/electron-main/deployMainService.ts b/src/vs/platform/issue/electron-main/deployMainService.ts index eea571ca..df85148d 100644 --- a/src/vs/platform/issue/electron-main/deployMainService.ts +++ b/src/vs/platform/issue/electron-main/deployMainService.ts @@ -136,9 +136,6 @@ export class DeployMainService implements IDeployMainService { this.loggerSoft = this.loggerMainService.createLogger(URI.file(this.installConfig + "/log/softdetail.log")); this.removeListeners(); this.registerListeners(); - this.deployWindowrParentWindow?.on('close', () => { - this.deployWindowrParentWindow = null; - }) } reset() { this.localConfigObject = { depConfigInfo: "", res: 0, g_index_Object: {}, osinfo: "", localConfigMatch: 0, osrelease: "", supportList: [] }; @@ -201,14 +198,18 @@ export class DeployMainService implements IDeployMainService { this.logger.info("最小化窗口"); this.minWindow(); }; - listenerCloseWindow = (event: IpcMainEvent) => { - //删除新下载但是没被使用的配置文件 - if (this.updateConfigDir) { - if (this.selectObject.updateFlag == false) - if (fs.existsSync(this.updateConfigDir)) - fs.rmdirSync(this.updateConfigDir, { recursive: true }); + listenerCloseWindow = (event: IpcMainEvent, msg: any) => { + if (msg.type === 'skip') { + this.logger.info("跳过配置"); + } + if (msg.type === "close") { + //删除新下载但是没被使用的配置文件 + if (this.updateConfigDir) { + if (this.selectObject.updateFlag == false) + if (fs.existsSync(this.updateConfigDir)) + fs.rmdirSync(this.updateConfigDir, { recursive: true }); + } } - this.closeWindow(); }; @@ -1233,23 +1234,25 @@ export class DeployMainService implements IDeployMainService { this.DeployWindow.on('close', () => { this.logger.info("关闭窗口"); this.DeployWindow = null; - validatedIpcMain.removeListener('kylinide.installWizard.skipWizard', listenerSkipWizard - ); - // validatedIpcMain.removeListener('kylinide.installWizard.init', listenerInit); - DeployDisposables.dispose(); - if (flag) { - // 第一次打开时,关闭窗口,继续 - resolve(void 0); + try { + DeployDisposables.dispose(); + } catch { + this.logger.error("deployDisposables.dispose() catch"); } + + resolve(void 0); }); - const listenerSkipWizard = async (event: IpcMainEvent) => { - this.logger.info("跳过配置"); - if (this.DeployWindow && this.DeployWindow != undefined) { - this.DeployWindow.close(); - } - } - validatedIpcMain.on('kylinide.installWizard.skipWizard', listenerSkipWizard - ); + this.deployWindowrParentWindow?.on('close', () => { + this.deployWindowrParentWindow = null; + }) + // const listenerSkipWizard = async (event: IpcMainEvent) => { + // this.logger.info("跳过配置"); + // if (this.DeployWindow && this.DeployWindow != undefined) { + // this.DeployWindow.close(); + // } + // } + // validatedIpcMain.on('kylinide.installWizard.skipWizard', listenerSkipWizard + // ); } if (this.DeployWindow) { this.focusWindow(this.DeployWindow);