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

View File

@@ -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);
});

View File

@@ -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'),

View File

@@ -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",

View File

@@ -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,

View File

@@ -36,6 +36,7 @@ declare global {
};
electron: {
getArch: () => Promise<string>;
getNoUpdater: () => Promise<boolean>;
setTrayIconNotification: (notify: boolean) => Promise<void>;
openFileDialog: () => Promise<string>;
openDirectoryDialog: () => Promise<string>;

View File

@@ -38,11 +38,11 @@
<el-button size="small" :icon="Document" @click="showChangeLogDialog">{{
t('view.settings.general.vrcx_updater.change_log')
}}</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')
}}</el-button>
</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>
<br />
<el-radio-group
@@ -61,6 +61,9 @@
}}</el-radio-button>
</el-radio-group>
</div>
<div v-else class="options-container-item">
<span>{{ t('view.settings.general.vrcx_updater.updater_disabled') }}</span>
</div>
</div>
<div class="options-container">
<span class="header">{{ t('view.settings.general.application.header') }}</span>
@@ -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([