diff --git a/public/electron.js b/public/electron.js index c68935a..8cde87a 100644 --- a/public/electron.js +++ b/public/electron.js @@ -765,7 +765,7 @@ ipcMain.on(Constants.IPC_Install_Upgrade, (event, data) => { .executeAsync(command, args) .then(() => { cleanupFiles(); - closeApplication(); + standardIPCReply(event, Constants.IPC_Install_Upgrade_Reply) }) .catch(error => { errorHandler(error); @@ -791,7 +791,11 @@ ipcMain.on(Constants.IPC_Install_Upgrade, (event, data) => { errorHandler(Error('Failed to verify installation package hash')); }); } else { - executeInstall(); + if (platform === 'darwin') { + setTimeout(executeInstall, 3000); + } else { + executeInstall(); + } } } else { errorHandler(Error('Unsupported upgrade: ' + data.Source)); diff --git a/src/App.js b/src/App.js index bf97832..a4c5dd4 100644 --- a/src/App.js +++ b/src/App.js @@ -53,6 +53,7 @@ class App extends IPCContainer { this.props.checkInstalled(dependencies, selectedVersion); } else { this.props.setInstalledVersion('none'); + this.props.setAllowDownload(true); } }; @@ -113,7 +114,7 @@ class App extends IPCContainer { handleDownloadUpgrade = () => { const url = this.props.UpgradeData.urls[0]; - const name = this.props.Platform === 'win32' ? 'upgrade.exe' : extractFileNameFromURL(url); + const name = this.props.Platform === 'win32' ? 'upgrade.exe' : this.props.Platform === 'darwin' ? 'upgrade.dmg' : extractFileNameFromURL(url); this.props.downloadItem(name, Constants.INSTALL_TYPES.Upgrade, url, this.onDownloadFileComplete); }; @@ -136,9 +137,9 @@ class App extends IPCContainer { installUpgrade = result => { if (result.Success) { - const info = this.props.LocationsLookup[this.props.AppPlatform][this.props.VersionLookup[this.props.AppPlatform][0]]; - const sha256 = info.sha256; - const signature = info.sig; + //const info = this.props.LocationsLookup[this.props.AppPlatform][this.props.VersionLookup[this.props.AppPlatform][0]]; + const sha256 = null;//info.sha256; + const signature = null;//info.sig; this.props.installUpgrade(result.Destination, sha256, signature, !!result.SkipVerification, this.onInstallUpgradeComplete); } }; @@ -239,7 +240,8 @@ class App extends IPCContainer { !this.props.DisplayError && !showConfig && !this.props.DownloadActive && - !this.props.UpgradeDismissed; + !this.props.UpgradeDismissed && + !this.props.InstallActive; const showDependencies = !showUpgrade && missingDependencies && diff --git a/src/redux/actions/install_actions.js b/src/redux/actions/install_actions.js index 4a9bc65..16c8384 100644 --- a/src/redux/actions/install_actions.js +++ b/src/redux/actions/install_actions.js @@ -8,6 +8,10 @@ import { setInstalledVersion, setReleaseUpgradeAvailable } from './release_version_actions'; +import { + setApplicationReady, + shutdownApplication +} from './common_actions'; const ipcRenderer = getIPCRenderer(); @@ -126,16 +130,18 @@ export const installRelease = (source, version, completedCallback) => { export const installUpgrade = (source, sha256, signature, skipVerification, completedCallback) => { return (dispatch, getState) => { if (ipcRenderer && !getState().install.InstallActive) { - dispatch(setInstallActive(Constants.INSTALL_TYPES.Dependency)); + dispatch(setInstallActive(Constants.INSTALL_TYPES.Upgrade)); + dispatch(setApplicationReady(false)); const installUpgradeComplete = (event, arg) => { ipcRenderer.removeListener(Constants.IPC_Install_Upgrade_Reply, installUpgradeComplete); - ipcRenderer.send(Constants.IPC_Delete_File, { - FilePath: source, - }); - - dispatch(setInstallComplete(arg.data)); - completedCallback(source, arg.data); + if (arg.data.Success) { + dispatch(shutdownApplication()); + } else { + dispatch(setApplicationReady(true)); + dispatch(setInstallComplete(arg.data)); + completedCallback(source, arg.data); + } }; ipcRenderer.on(Constants.IPC_Install_Upgrade_Reply, installUpgradeComplete);