Add --no-updater

This commit is contained in:
Natsumi
2025-11-05 16:45:44 +11:00
parent f5b29ea775
commit cca81067a1
6 changed files with 26 additions and 7 deletions
+5
View File
@@ -54,6 +54,7 @@ const noInstall = args.includes('--no-install');
const x11 = args.includes('--x11'); const x11 = args.includes('--x11');
const noDesktop = args.includes('--no-desktop'); const noDesktop = args.includes('--no-desktop');
const startup = args.includes('--startup'); const startup = args.includes('--startup');
const noUpdater = args.includes('--no-updater');
if (process.defaultApp) { if (process.defaultApp) {
if (process.argv.length >= 2) { if (process.argv.length >= 2) {
app.setAsDefaultProtocolClient(VRCX_URI_PREFIX, process.execPath, [ app.setAsDefaultProtocolClient(VRCX_URI_PREFIX, process.execPath, [
@@ -260,6 +261,10 @@ ipcMain.handle('app:getArch', () => {
return process.arch.toString(); return process.arch.toString();
}); });
ipcMain.handle('app:getNoUpdater', () => {
return noUpdater;
});
ipcMain.handle('app:setTrayIconNotification', (event, notify) => { ipcMain.handle('app:setTrayIconNotification', (event, notify) => {
setTrayIconNotification(notify); setTrayIconNotification(notify);
}); });
+1
View File
@@ -23,6 +23,7 @@ const validChannels = ['launch-command'];
contextBridge.exposeInMainWorld('electron', { contextBridge.exposeInMainWorld('electron', {
getArch: () => ipcRenderer.invoke('app:getArch'), getArch: () => ipcRenderer.invoke('app:getArch'),
getNoUpdater: () => ipcRenderer.invoke('app:getNoUpdater'),
setTrayIconNotification: (notify) => setTrayIconNotification: (notify) =>
ipcRenderer.invoke('app:setTrayIconNotification', notify), ipcRenderer.invoke('app:setTrayIconNotification', notify),
openFileDialog: () => ipcRenderer.invoke('dialog:openFile'), openFileDialog: () => ipcRenderer.invoke('dialog:openFile'),
+2 -1
View File
@@ -366,7 +366,8 @@
"auto_update_off": "Off", "auto_update_off": "Off",
"auto_update_notify": "Notify", "auto_update_notify": "Notify",
"auto_update_download": "Auto Download", "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": { "application": {
"header": "Application", "header": "Application",
+11 -3
View File
@@ -17,6 +17,7 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
const { t } = useI18n(); const { t } = useI18n();
const arch = ref('x64'); const arch = ref('x64');
const noUpdater = ref(false);
const appVersion = ref(''); const appVersion = ref('');
const autoUpdateVRCX = ref('Auto Download'); const autoUpdateVRCX = ref('Auto Download');
@@ -43,9 +44,9 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
async function initVRCXUpdaterSettings() { async function initVRCXUpdaterSettings() {
if (!WINDOWS) { if (!WINDOWS) {
const archResult = await window.electron.getArch(); arch.value = await window.electron.getArch();
console.log('Architecture:', archResult); noUpdater.value = await window.electron.getNoUpdater();
arch.value = archResult; console.log('Architecture:', arch.value);
} }
const [VRCX_autoUpdateVRCX, VRCX_id] = await Promise.all([ const [VRCX_autoUpdateVRCX, VRCX_id] = await Promise.all([
@@ -58,6 +59,9 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
} else { } else {
autoUpdateVRCX.value = VRCX_autoUpdateVRCX; autoUpdateVRCX.value = VRCX_autoUpdateVRCX;
} }
if (noUpdater.value) {
autoUpdateVRCX.value = 'Off';
}
appVersion.value = await AppApi.GetVersion(); appVersion.value = await AppApi.GetVersion();
vrcxId.value = VRCX_id; vrcxId.value = VRCX_id;
@@ -222,6 +226,9 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
const releaseName = json.name; const releaseName = json.name;
setLatestAppVersion(releaseName); setLatestAppVersion(releaseName);
VRCXUpdateDialog.value.updatePendingIsLatest = false; VRCXUpdateDialog.value.updatePendingIsLatest = false;
if (autoUpdateVRCX.value === 'Off') {
return;
}
if (releaseName === pendingVRCXInstall.value) { if (releaseName === pendingVRCXInstall.value) {
// update already downloaded // update already downloaded
VRCXUpdateDialog.value.updatePendingIsLatest = true; VRCXUpdateDialog.value.updatePendingIsLatest = true;
@@ -404,6 +411,7 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
pendingVRCXInstall, pendingVRCXInstall,
updateInProgress, updateInProgress,
updateProgress, updateProgress,
noUpdater,
setAutoUpdateVRCX, setAutoUpdateVRCX,
setBranch, setBranch,
+1
View File
@@ -36,6 +36,7 @@ declare global {
}; };
electron: { electron: {
getArch: () => Promise<string>; getArch: () => Promise<string>;
getNoUpdater: () => Promise<boolean>;
setTrayIconNotification: (notify: boolean) => Promise<void>; setTrayIconNotification: (notify: boolean) => Promise<void>;
openFileDialog: () => Promise<string>; openFileDialog: () => Promise<string>;
openDirectoryDialog: () => Promise<string>; openDirectoryDialog: () => Promise<string>;
@@ -38,11 +38,11 @@
<el-button size="small" :icon="Document" @click="showChangeLogDialog">{{ <el-button size="small" :icon="Document" @click="showChangeLogDialog">{{
t('view.settings.general.vrcx_updater.change_log') t('view.settings.general.vrcx_updater.change_log')
}}</el-button> }}</el-button>
<el-button size="small" :icon="Upload" @click="showVRCXUpdateDialog()">{{ <el-button v-if="!noUpdater" size="small" :icon="Upload" @click="showVRCXUpdateDialog()">{{
t('view.settings.general.vrcx_updater.change_build') t('view.settings.general.vrcx_updater.change_build')
}}</el-button> }}</el-button>
</div> </div>
<div class="options-container-item"> <div v-if="!noUpdater" class="options-container-item">
<span class="name">{{ t('view.settings.general.vrcx_updater.update_action') }}</span> <span class="name">{{ t('view.settings.general.vrcx_updater.update_action') }}</span>
<br /> <br />
<el-radio-group <el-radio-group
@@ -61,6 +61,9 @@
}}</el-radio-button> }}</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
<div v-else class="options-container-item">
<span>{{ t('view.settings.general.vrcx_updater.updater_disabled') }}</span>
</div>
</div> </div>
<div class="options-container"> <div class="options-container">
<span class="header">{{ t('view.settings.general.application.header') }}</span> <span class="header">{{ t('view.settings.general.application.header') }}</span>
@@ -349,7 +352,7 @@
const { favoriteFriendGroups } = storeToRefs(favoriteStore); const { favoriteFriendGroups } = storeToRefs(favoriteStore);
const { appVersion, autoUpdateVRCX, latestAppVersion } = storeToRefs(vrcxUpdaterStore); const { appVersion, autoUpdateVRCX, latestAppVersion, noUpdater } = storeToRefs(vrcxUpdaterStore);
const { setAutoUpdateVRCX, checkForVRCXUpdate, showVRCXUpdateDialog, showChangeLogDialog } = vrcxUpdaterStore; const { setAutoUpdateVRCX, checkForVRCXUpdate, showVRCXUpdateDialog, showChangeLogDialog } = vrcxUpdaterStore;
const instanceTypes = ref([ const instanceTypes = ref([