mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
fix: temporary solution on MacOS for unsigned app updates
This commit is contained in:
@ -113,7 +113,6 @@ function startRenderer (callback) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const server = new WebpackDevServer(compiler, {
|
const server = new WebpackDevServer(compiler, {
|
||||||
static: path.join(__dirname, '../'),
|
|
||||||
hot: true,
|
hot: true,
|
||||||
port: 9080,
|
port: 9080,
|
||||||
client: {
|
client: {
|
||||||
|
@ -2,6 +2,7 @@ import { ipcMain } from 'electron';
|
|||||||
import { autoUpdater } from 'electron-updater';
|
import { autoUpdater } from 'electron-updater';
|
||||||
import Store from 'electron-store';
|
import Store from 'electron-store';
|
||||||
const persistentStore = new Store({ name: 'settings' });
|
const persistentStore = new Store({ name: 'settings' });
|
||||||
|
const isMacOS = process.platform === 'darwin';
|
||||||
|
|
||||||
let mainWindow;
|
let mainWindow;
|
||||||
autoUpdater.allowPrerelease = persistentStore.get('allow_prerelease', true);
|
autoUpdater.allowPrerelease = persistentStore.get('allow_prerelease', true);
|
||||||
@ -11,6 +12,9 @@ export default () => {
|
|||||||
mainWindow = event;
|
mainWindow = event;
|
||||||
if (process.windowsStore || (process.platform === 'linux' && !process.env.APPIMAGE))
|
if (process.windowsStore || (process.platform === 'linux' && !process.env.APPIMAGE))
|
||||||
mainWindow.reply('no-auto-update');
|
mainWindow.reply('no-auto-update');
|
||||||
|
else if (isMacOS) { // Temporary solution on MacOS for unsigned app updates
|
||||||
|
autoUpdater.autoDownload = false;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
autoUpdater.checkForUpdatesAndNotify().catch(() => {
|
autoUpdater.checkForUpdatesAndNotify().catch(() => {
|
||||||
mainWindow.reply('check-failed');
|
mainWindow.reply('check-failed');
|
||||||
@ -28,7 +32,10 @@ export default () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
autoUpdater.on('update-available', () => {
|
autoUpdater.on('update-available', () => {
|
||||||
mainWindow.reply('update-available');
|
if (isMacOS)
|
||||||
|
mainWindow.reply('link-to-download');
|
||||||
|
else
|
||||||
|
mainWindow.reply('update-available');
|
||||||
});
|
});
|
||||||
|
|
||||||
autoUpdater.on('update-not-available', () => {
|
autoUpdater.on('update-not-available', () => {
|
||||||
|
@ -396,7 +396,7 @@ export default {
|
|||||||
return locales;
|
return locales;
|
||||||
},
|
},
|
||||||
hasUpdates () {
|
hasUpdates () {
|
||||||
return ['available', 'downloading', 'downloaded'].includes(this.updateStatus);
|
return ['available', 'downloading', 'downloaded', 'link'].includes(this.updateStatus);
|
||||||
},
|
},
|
||||||
workspace () {
|
workspace () {
|
||||||
return this.getWorkspace(this.selectedWorkspace);
|
return this.getWorkspace(this.selectedWorkspace);
|
||||||
|
@ -29,12 +29,19 @@
|
|||||||
{{ $t('message.checkForUpdates') }}
|
{{ $t('message.checkForUpdates') }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="updateStatus === 'downloaded'"
|
v-else-if="updateStatus === 'downloaded'"
|
||||||
class="btn btn-primary"
|
class="btn btn-primary"
|
||||||
@click="restartToUpdate"
|
@click="restartToUpdate"
|
||||||
>
|
>
|
||||||
{{ $t('message.restartToInstall') }}
|
{{ $t('message.restartToInstall') }}
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
v-else-if="updateStatus === 'link'"
|
||||||
|
class="btn btn-primary"
|
||||||
|
@click="openOutside('https://antares-sql.app/download.html')"
|
||||||
|
>
|
||||||
|
{{ $t('message.goToDownloadPage') }}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group mt-4">
|
<div class="form-group mt-4">
|
||||||
<label class="form-switch d-inline-block disabled" @click.prevent="toggleAllowPrerelease">
|
<label class="form-switch d-inline-block disabled" @click.prevent="toggleAllowPrerelease">
|
||||||
@ -47,7 +54,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters, mapActions } from 'vuex';
|
import { mapGetters, mapActions } from 'vuex';
|
||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer, shell } from 'electron';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalSettingsUpdate',
|
name: 'ModalSettingsUpdate',
|
||||||
@ -71,6 +78,8 @@ export default {
|
|||||||
return this.$t('message.downloadingUpdate');
|
return this.$t('message.downloadingUpdate');
|
||||||
case 'downloaded':
|
case 'downloaded':
|
||||||
return this.$t('message.updateDownloaded');
|
return this.$t('message.updateDownloaded');
|
||||||
|
case 'link':
|
||||||
|
return this.$t('message.updateAvailable');
|
||||||
default:
|
default:
|
||||||
return this.updateStatus;
|
return this.updateStatus;
|
||||||
}
|
}
|
||||||
@ -80,6 +89,9 @@ export default {
|
|||||||
...mapActions({
|
...mapActions({
|
||||||
changeAllowPrerelease: 'settings/changeAllowPrerelease'
|
changeAllowPrerelease: 'settings/changeAllowPrerelease'
|
||||||
}),
|
}),
|
||||||
|
openOutside (link) {
|
||||||
|
shell.openExternal(link);
|
||||||
|
},
|
||||||
checkForUpdates () {
|
checkForUpdates () {
|
||||||
ipcRenderer.send('check-for-updates');
|
ipcRenderer.send('check-for-updates');
|
||||||
},
|
},
|
||||||
|
@ -92,7 +92,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
hasUpdates () {
|
hasUpdates () {
|
||||||
return ['available', 'downloading', 'downloaded'].includes(this.updateStatus);
|
return ['available', 'downloading', 'downloaded', 'link'].includes(this.updateStatus);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -246,7 +246,8 @@ module.exports = {
|
|||||||
thereIsNoQueriesYet: 'There is no queries yet',
|
thereIsNoQueriesYet: 'There is no queries yet',
|
||||||
searchForQueries: 'Search for queries',
|
searchForQueries: 'Search for queries',
|
||||||
killProcess: 'Kill process',
|
killProcess: 'Kill process',
|
||||||
closeTab: 'Close tab'
|
closeTab: 'Close tab',
|
||||||
|
goToDownloadPage: 'Go to download page'
|
||||||
},
|
},
|
||||||
faker: {
|
faker: {
|
||||||
address: 'Address',
|
address: 'Address',
|
||||||
|
@ -4,23 +4,33 @@ export default store => {
|
|||||||
ipcRenderer.on('checking-for-update', () => {
|
ipcRenderer.on('checking-for-update', () => {
|
||||||
store.commit('application/CHANGE_UPDATE_STATUS', 'checking');
|
store.commit('application/CHANGE_UPDATE_STATUS', 'checking');
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcRenderer.on('update-available', () => {
|
ipcRenderer.on('update-available', () => {
|
||||||
store.commit('application/CHANGE_UPDATE_STATUS', 'available');
|
store.commit('application/CHANGE_UPDATE_STATUS', 'available');
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcRenderer.on('update-not-available', () => {
|
ipcRenderer.on('update-not-available', () => {
|
||||||
store.commit('application/CHANGE_UPDATE_STATUS', 'noupdate');
|
store.commit('application/CHANGE_UPDATE_STATUS', 'noupdate');
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcRenderer.on('check-failed', () => {
|
ipcRenderer.on('check-failed', () => {
|
||||||
store.commit('application/CHANGE_UPDATE_STATUS', 'nocheck');
|
store.commit('application/CHANGE_UPDATE_STATUS', 'nocheck');
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcRenderer.on('no-auto-update', () => {
|
ipcRenderer.on('no-auto-update', () => {
|
||||||
store.commit('application/CHANGE_UPDATE_STATUS', 'disabled');
|
store.commit('application/CHANGE_UPDATE_STATUS', 'disabled');
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcRenderer.on('download-progress', (event, data) => {
|
ipcRenderer.on('download-progress', (event, data) => {
|
||||||
store.commit('application/CHANGE_UPDATE_STATUS', 'downloading');
|
store.commit('application/CHANGE_UPDATE_STATUS', 'downloading');
|
||||||
store.commit('application/CHANGE_PROGRESS_PERCENTAGE', data.percent);
|
store.commit('application/CHANGE_PROGRESS_PERCENTAGE', data.percent);
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcRenderer.on('update-downloaded', () => {
|
ipcRenderer.on('update-downloaded', () => {
|
||||||
store.commit('application/CHANGE_UPDATE_STATUS', 'downloaded');
|
store.commit('application/CHANGE_UPDATE_STATUS', 'downloaded');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ipcRenderer.on('link-to-download', () => {
|
||||||
|
store.commit('application/CHANGE_UPDATE_STATUS', 'link');
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user