diff --git a/src-electron/main.js b/src-electron/main.js index bf741032..b83b41a1 100644 --- a/src-electron/main.js +++ b/src-electron/main.js @@ -54,6 +54,7 @@ const noInstall = args.includes('--no-install'); const x11 = args.includes('--x11'); const noDesktop = args.includes('--no-desktop'); const startup = args.includes('--startup'); +const noUpdater = args.includes('--no-updater'); if (process.defaultApp) { if (process.argv.length >= 2) { app.setAsDefaultProtocolClient(VRCX_URI_PREFIX, process.execPath, [ @@ -260,6 +261,10 @@ ipcMain.handle('app:getArch', () => { return process.arch.toString(); }); +ipcMain.handle('app:getNoUpdater', () => { + return noUpdater; +}); + ipcMain.handle('app:setTrayIconNotification', (event, notify) => { setTrayIconNotification(notify); }); diff --git a/src-electron/preload.js b/src-electron/preload.js index f26fbc2e..b16dd8a1 100644 --- a/src-electron/preload.js +++ b/src-electron/preload.js @@ -23,6 +23,7 @@ const validChannels = ['launch-command']; contextBridge.exposeInMainWorld('electron', { getArch: () => ipcRenderer.invoke('app:getArch'), + getNoUpdater: () => ipcRenderer.invoke('app:getNoUpdater'), setTrayIconNotification: (notify) => ipcRenderer.invoke('app:setTrayIconNotification', notify), openFileDialog: () => ipcRenderer.invoke('dialog:openFile'), diff --git a/src/localization/en/en.json b/src/localization/en/en.json index 2d4dc8a7..92e84ffa 100644 --- a/src/localization/en/en.json +++ b/src/localization/en/en.json @@ -366,7 +366,8 @@ "auto_update_off": "Off", "auto_update_notify": "Notify", "auto_update_download": "Auto Download", - "change_log": "Change Log" + "change_log": "Change Log", + "updater_disabled": "Updater disabled, updates are handled by your package manager." }, "application": { "header": "Application", diff --git a/src/stores/vrcxUpdater.js b/src/stores/vrcxUpdater.js index d2bdb963..824fcd7d 100644 --- a/src/stores/vrcxUpdater.js +++ b/src/stores/vrcxUpdater.js @@ -17,6 +17,7 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => { const { t } = useI18n(); const arch = ref('x64'); + const noUpdater = ref(false); const appVersion = ref(''); const autoUpdateVRCX = ref('Auto Download'); @@ -43,9 +44,9 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => { async function initVRCXUpdaterSettings() { if (!WINDOWS) { - const archResult = await window.electron.getArch(); - console.log('Architecture:', archResult); - arch.value = archResult; + arch.value = await window.electron.getArch(); + noUpdater.value = await window.electron.getNoUpdater(); + console.log('Architecture:', arch.value); } const [VRCX_autoUpdateVRCX, VRCX_id] = await Promise.all([ @@ -58,6 +59,9 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => { } else { autoUpdateVRCX.value = VRCX_autoUpdateVRCX; } + if (noUpdater.value) { + autoUpdateVRCX.value = 'Off'; + } appVersion.value = await AppApi.GetVersion(); vrcxId.value = VRCX_id; @@ -222,6 +226,9 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => { const releaseName = json.name; setLatestAppVersion(releaseName); VRCXUpdateDialog.value.updatePendingIsLatest = false; + if (autoUpdateVRCX.value === 'Off') { + return; + } if (releaseName === pendingVRCXInstall.value) { // update already downloaded VRCXUpdateDialog.value.updatePendingIsLatest = true; @@ -404,6 +411,7 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => { pendingVRCXInstall, updateInProgress, updateProgress, + noUpdater, setAutoUpdateVRCX, setBranch, diff --git a/src/types/globals.d.ts b/src/types/globals.d.ts index 34c9dbd8..dc504025 100644 --- a/src/types/globals.d.ts +++ b/src/types/globals.d.ts @@ -36,6 +36,7 @@ declare global { }; electron: { getArch: () => Promise; + getNoUpdater: () => Promise; setTrayIconNotification: (notify: boolean) => Promise; openFileDialog: () => Promise; openDirectoryDialog: () => Promise; diff --git a/src/views/Settings/components/Tabs/GeneralTab.vue b/src/views/Settings/components/Tabs/GeneralTab.vue index 7daea495..cb7efd82 100644 --- a/src/views/Settings/components/Tabs/GeneralTab.vue +++ b/src/views/Settings/components/Tabs/GeneralTab.vue @@ -38,11 +38,11 @@ {{ t('view.settings.general.vrcx_updater.change_log') }} - {{ + {{ t('view.settings.general.vrcx_updater.change_build') }} -
+
{{ t('view.settings.general.vrcx_updater.update_action') }}
+
+ {{ t('view.settings.general.vrcx_updater.updater_disabled') }} +
{{ t('view.settings.general.application.header') }} @@ -349,7 +352,7 @@ const { favoriteFriendGroups } = storeToRefs(favoriteStore); - const { appVersion, autoUpdateVRCX, latestAppVersion } = storeToRefs(vrcxUpdaterStore); + const { appVersion, autoUpdateVRCX, latestAppVersion, noUpdater } = storeToRefs(vrcxUpdaterStore); const { setAutoUpdateVRCX, checkForVRCXUpdate, showVRCXUpdateDialog, showChangeLogDialog } = vrcxUpdaterStore; const instanceTypes = ref([