Fix upgrades
This commit is contained in:
@@ -765,7 +765,7 @@ ipcMain.on(Constants.IPC_Install_Upgrade, (event, data) => {
|
|||||||
.executeAsync(command, args)
|
.executeAsync(command, args)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
cleanupFiles();
|
cleanupFiles();
|
||||||
closeApplication();
|
standardIPCReply(event, Constants.IPC_Install_Upgrade_Reply)
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
errorHandler(error);
|
errorHandler(error);
|
||||||
@@ -791,7 +791,11 @@ ipcMain.on(Constants.IPC_Install_Upgrade, (event, data) => {
|
|||||||
errorHandler(Error('Failed to verify installation package hash'));
|
errorHandler(Error('Failed to verify installation package hash'));
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
executeInstall();
|
if (platform === 'darwin') {
|
||||||
|
setTimeout(executeInstall, 3000);
|
||||||
|
} else {
|
||||||
|
executeInstall();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
errorHandler(Error('Unsupported upgrade: ' + data.Source));
|
errorHandler(Error('Unsupported upgrade: ' + data.Source));
|
||||||
|
|||||||
12
src/App.js
12
src/App.js
@@ -53,6 +53,7 @@ class App extends IPCContainer {
|
|||||||
this.props.checkInstalled(dependencies, selectedVersion);
|
this.props.checkInstalled(dependencies, selectedVersion);
|
||||||
} else {
|
} else {
|
||||||
this.props.setInstalledVersion('none');
|
this.props.setInstalledVersion('none');
|
||||||
|
this.props.setAllowDownload(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -113,7 +114,7 @@ class App extends IPCContainer {
|
|||||||
|
|
||||||
handleDownloadUpgrade = () => {
|
handleDownloadUpgrade = () => {
|
||||||
const url = this.props.UpgradeData.urls[0];
|
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);
|
this.props.downloadItem(name, Constants.INSTALL_TYPES.Upgrade, url, this.onDownloadFileComplete);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -136,9 +137,9 @@ class App extends IPCContainer {
|
|||||||
|
|
||||||
installUpgrade = result => {
|
installUpgrade = result => {
|
||||||
if (result.Success) {
|
if (result.Success) {
|
||||||
const info = this.props.LocationsLookup[this.props.AppPlatform][this.props.VersionLookup[this.props.AppPlatform][0]];
|
//const info = this.props.LocationsLookup[this.props.AppPlatform][this.props.VersionLookup[this.props.AppPlatform][0]];
|
||||||
const sha256 = info.sha256;
|
const sha256 = null;//info.sha256;
|
||||||
const signature = info.sig;
|
const signature = null;//info.sig;
|
||||||
this.props.installUpgrade(result.Destination, sha256, signature, !!result.SkipVerification, this.onInstallUpgradeComplete);
|
this.props.installUpgrade(result.Destination, sha256, signature, !!result.SkipVerification, this.onInstallUpgradeComplete);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -239,7 +240,8 @@ class App extends IPCContainer {
|
|||||||
!this.props.DisplayError &&
|
!this.props.DisplayError &&
|
||||||
!showConfig &&
|
!showConfig &&
|
||||||
!this.props.DownloadActive &&
|
!this.props.DownloadActive &&
|
||||||
!this.props.UpgradeDismissed;
|
!this.props.UpgradeDismissed &&
|
||||||
|
!this.props.InstallActive;
|
||||||
|
|
||||||
const showDependencies = !showUpgrade &&
|
const showDependencies = !showUpgrade &&
|
||||||
missingDependencies &&
|
missingDependencies &&
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ import {
|
|||||||
setInstalledVersion,
|
setInstalledVersion,
|
||||||
setReleaseUpgradeAvailable
|
setReleaseUpgradeAvailable
|
||||||
} from './release_version_actions';
|
} from './release_version_actions';
|
||||||
|
import {
|
||||||
|
setApplicationReady,
|
||||||
|
shutdownApplication
|
||||||
|
} from './common_actions';
|
||||||
|
|
||||||
const ipcRenderer = getIPCRenderer();
|
const ipcRenderer = getIPCRenderer();
|
||||||
|
|
||||||
@@ -126,16 +130,18 @@ export const installRelease = (source, version, completedCallback) => {
|
|||||||
export const installUpgrade = (source, sha256, signature, skipVerification, completedCallback) => {
|
export const installUpgrade = (source, sha256, signature, skipVerification, completedCallback) => {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
if (ipcRenderer && !getState().install.InstallActive) {
|
if (ipcRenderer && !getState().install.InstallActive) {
|
||||||
dispatch(setInstallActive(Constants.INSTALL_TYPES.Dependency));
|
dispatch(setInstallActive(Constants.INSTALL_TYPES.Upgrade));
|
||||||
|
dispatch(setApplicationReady(false));
|
||||||
|
|
||||||
const installUpgradeComplete = (event, arg) => {
|
const installUpgradeComplete = (event, arg) => {
|
||||||
ipcRenderer.removeListener(Constants.IPC_Install_Upgrade_Reply, installUpgradeComplete);
|
ipcRenderer.removeListener(Constants.IPC_Install_Upgrade_Reply, installUpgradeComplete);
|
||||||
ipcRenderer.send(Constants.IPC_Delete_File, {
|
if (arg.data.Success) {
|
||||||
FilePath: source,
|
dispatch(shutdownApplication());
|
||||||
});
|
} else {
|
||||||
|
dispatch(setApplicationReady(true));
|
||||||
dispatch(setInstallComplete(arg.data));
|
dispatch(setInstallComplete(arg.data));
|
||||||
completedCallback(source, arg.data);
|
completedCallback(source, arg.data);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ipcRenderer.on(Constants.IPC_Install_Upgrade_Reply, installUpgradeComplete);
|
ipcRenderer.on(Constants.IPC_Install_Upgrade_Reply, installUpgradeComplete);
|
||||||
|
|||||||
Reference in New Issue
Block a user