mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Auto updater changes
This commit is contained in:
@@ -94,6 +94,7 @@ namespace VRCX
|
|||||||
|
|
||||||
public void DownloadFile(string url, int size, string AppVersion)
|
public void DownloadFile(string url, int size, string AppVersion)
|
||||||
{
|
{
|
||||||
|
DownloadProgress = 0;
|
||||||
DownloadSize = size;
|
DownloadSize = size;
|
||||||
DownloadCanceled = false;
|
DownloadCanceled = false;
|
||||||
DownloadTempLocation = Path.Combine(Program.AppDataDirectory, "tempDownload.exe");
|
DownloadTempLocation = Path.Combine(Program.AppDataDirectory, "tempDownload.exe");
|
||||||
|
|||||||
@@ -11784,9 +11784,6 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
if (!configRepository.getString('VRCX_branch')) {
|
if (!configRepository.getString('VRCX_branch')) {
|
||||||
$app.data.branch = 'Stable';
|
$app.data.branch = 'Stable';
|
||||||
if (appVersion.substring(0, 24) === 'VRCX.PyPyDance.Companion') {
|
|
||||||
$app.data.branch = 'Beta';
|
|
||||||
}
|
|
||||||
configRepository.setString('VRCX_branch', $app.data.branch);
|
configRepository.setString('VRCX_branch', $app.data.branch);
|
||||||
}
|
}
|
||||||
if (configRepository.getString('VRCX_lastVRCXVersion')) {
|
if (configRepository.getString('VRCX_lastVRCXVersion')) {
|
||||||
@@ -18093,11 +18090,14 @@ speechSynthesis.getVoices();
|
|||||||
this.downloadFileComplete('Failed');
|
this.downloadFileComplete('Failed');
|
||||||
return;
|
return;
|
||||||
case -16:
|
case -16:
|
||||||
if (this.downloadCurrent.autoInstall) {
|
if (this.downloadCurrent.ref.id === 'VRCXUpdate') {
|
||||||
this.restartVRCX();
|
if (this.downloadCurrent.autoInstall) {
|
||||||
} else {
|
this.restartVRCX();
|
||||||
this.downloadDialog.visible = false;
|
} else {
|
||||||
this.showVRCXUpdateDialog();
|
this.downloadDialog.visible = false;
|
||||||
|
this.pendingVRCXUpdate = this.downloadCurrent.ref.name;
|
||||||
|
this.showVRCXUpdateDialog();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.downloadFileComplete('Success');
|
this.downloadFileComplete('Success');
|
||||||
return;
|
return;
|
||||||
@@ -18556,11 +18556,13 @@ speechSynthesis.getVoices();
|
|||||||
$app.data.VRCXUpdateDialog = {
|
$app.data.VRCXUpdateDialog = {
|
||||||
visible: false,
|
visible: false,
|
||||||
updatePending: false,
|
updatePending: false,
|
||||||
|
updatePendingIsLatest: false,
|
||||||
release: '',
|
release: '',
|
||||||
releases: []
|
releases: []
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.data.checkingForVRCXUpdate = false;
|
$app.data.checkingForVRCXUpdate = false;
|
||||||
|
$app.data.pendingVRCXUpdate = '';
|
||||||
|
|
||||||
$app.data.branches = {
|
$app.data.branches = {
|
||||||
Stable: {
|
Stable: {
|
||||||
@@ -18568,8 +18570,8 @@ speechSynthesis.getVoices();
|
|||||||
urlReleases: 'https://vrcx.pypy.moe/releases/pypy-vrc.json',
|
urlReleases: 'https://vrcx.pypy.moe/releases/pypy-vrc.json',
|
||||||
urlLatest: 'https://vrcx.pypy.moe/releases/latest/pypy-vrc.json'
|
urlLatest: 'https://vrcx.pypy.moe/releases/latest/pypy-vrc.json'
|
||||||
},
|
},
|
||||||
Beta: {
|
Nightly: {
|
||||||
name: 'Beta',
|
name: 'Nightly',
|
||||||
urlReleases: 'https://vrcx.pypy.moe/releases/natsumi-sama.json',
|
urlReleases: 'https://vrcx.pypy.moe/releases/natsumi-sama.json',
|
||||||
urlLatest: 'https://vrcx.pypy.moe/releases/latest/natsumi-sama.json'
|
urlLatest: 'https://vrcx.pypy.moe/releases/latest/natsumi-sama.json'
|
||||||
}
|
}
|
||||||
@@ -18579,6 +18581,7 @@ speechSynthesis.getVoices();
|
|||||||
this.$nextTick(() => adjustDialogZ(this.$refs.VRCXUpdateDialog.$el));
|
this.$nextTick(() => adjustDialogZ(this.$refs.VRCXUpdateDialog.$el));
|
||||||
var D = this.VRCXUpdateDialog;
|
var D = this.VRCXUpdateDialog;
|
||||||
D.visible = true;
|
D.visible = true;
|
||||||
|
D.updatePendingIsLatest = false;
|
||||||
D.updatePending = await AppApi.CheckForUpdateExe();
|
D.updatePending = await AppApi.CheckForUpdateExe();
|
||||||
this.loadBranchVersions();
|
this.loadBranchVersions();
|
||||||
};
|
};
|
||||||
@@ -18668,6 +18671,13 @@ speechSynthesis.getVoices();
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (var release of json) {
|
for (var release of json) {
|
||||||
|
if (
|
||||||
|
release.target_commitish === 'PyPyDanceCompanion' ||
|
||||||
|
release.prerelease
|
||||||
|
) {
|
||||||
|
// skip old branch name and prerelease builds
|
||||||
|
continue;
|
||||||
|
}
|
||||||
for (var asset of release.assets) {
|
for (var asset of release.assets) {
|
||||||
if (
|
if (
|
||||||
asset.content_type === 'application/x-msdownload' &&
|
asset.content_type === 'application/x-msdownload' &&
|
||||||
@@ -18679,6 +18689,11 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
D.releases = releases;
|
D.releases = releases;
|
||||||
D.release = json[0].name;
|
D.release = json[0].name;
|
||||||
|
this.VRCXUpdateDialog.updatePendingIsLatest = false;
|
||||||
|
if (D.release === this.pendingVRCXUpdate) {
|
||||||
|
// update already downloaded and latest version
|
||||||
|
this.VRCXUpdateDialog.updatePendingIsLatest = true;
|
||||||
|
}
|
||||||
if (configRepository.getString('VRCX_branch') !== this.branch) {
|
if (configRepository.getString('VRCX_branch') !== this.branch) {
|
||||||
configRepository.setString('VRCX_branch', this.branch);
|
configRepository.setString('VRCX_branch', this.branch);
|
||||||
}
|
}
|
||||||
@@ -18689,8 +18704,10 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.checkForVRCXUpdate = async function () {
|
$app.methods.checkForVRCXUpdate = async function () {
|
||||||
if (await AppApi.CheckForUpdateExe()) {
|
if (this.branch === 'Beta') {
|
||||||
return;
|
// move Beta users to stable
|
||||||
|
this.branch = 'Stable';
|
||||||
|
configRepository.setString('VRCX_branch', this.branch);
|
||||||
}
|
}
|
||||||
var url = this.branches[this.branch].urlLatest;
|
var url = this.branches[this.branch].urlLatest;
|
||||||
this.checkingForVRCXUpdate = true;
|
this.checkingForVRCXUpdate = true;
|
||||||
@@ -18711,7 +18728,12 @@ speechSynthesis.getVoices();
|
|||||||
json.published_at,
|
json.published_at,
|
||||||
'YYYY-MM-DD HH24:MI:SS'
|
'YYYY-MM-DD HH24:MI:SS'
|
||||||
)})`;
|
)})`;
|
||||||
if (json.name > this.appVersion) {
|
var name = json.name;
|
||||||
|
this.VRCXUpdateDialog.updatePendingIsLatest = false;
|
||||||
|
if (name === this.pendingVRCXUpdate) {
|
||||||
|
// update already downloaded
|
||||||
|
this.VRCXUpdateDialog.updatePendingIsLatest = true;
|
||||||
|
} else if (name > this.appVersion) {
|
||||||
for (var asset of json.assets) {
|
for (var asset of json.assets) {
|
||||||
if (
|
if (
|
||||||
asset.content_type === 'application/x-msdownload' &&
|
asset.content_type === 'application/x-msdownload' &&
|
||||||
@@ -18726,7 +18748,6 @@ speechSynthesis.getVoices();
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.notifyMenu('settings');
|
this.notifyMenu('settings');
|
||||||
var name = json.name;
|
|
||||||
var type = 'Auto';
|
var type = 'Auto';
|
||||||
if (this.autoUpdateVRCX === 'Notify') {
|
if (this.autoUpdateVRCX === 'Notify') {
|
||||||
this.showVRCXUpdateDialog();
|
this.showVRCXUpdateDialog();
|
||||||
|
|||||||
@@ -2194,18 +2194,18 @@ html
|
|||||||
//- dialog: update VRCX
|
//- dialog: update VRCX
|
||||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="VRCXUpdateDialog" :visible.sync="VRCXUpdateDialog.visible" title="VRCX Updater" width="400px")
|
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="VRCXUpdateDialog" :visible.sync="VRCXUpdateDialog.visible" title="VRCX Updater" width="400px")
|
||||||
div(v-loading="checkingForVRCXUpdate" style="margin-top:15px")
|
div(v-loading="checkingForVRCXUpdate" style="margin-top:15px")
|
||||||
template(v-if="VRCXUpdateDialog.updatePending")
|
div(v-if="VRCXUpdateDialog.updatePending" style="margin-bottom:15px")
|
||||||
span Update ready for install, restart VRCX to apply.
|
span(v-text="pendingVRCXUpdate")
|
||||||
template(v-else)
|
|
||||||
el-select(v-model="branch" @change="loadBranchVersions" style="display:inline-block;width:150px;margin-right:15px")
|
|
||||||
el-option(v-once v-for="branch in branches" :key="branch.name" :label="branch.name" :value="branch.name")
|
|
||||||
el-select(v-model="VRCXUpdateDialog.release" style="display:inline-block;width:150px")
|
|
||||||
el-option(v-for="item in VRCXUpdateDialog.releases" :key="item.name" :label="item.tag_name" :value="item.name")
|
|
||||||
template(v-if="!VRCXUpdateDialog.updatePending && VRCXUpdateDialog.release === appVersion")
|
|
||||||
br
|
br
|
||||||
|
span Ready for install, restart VRCX to apply.
|
||||||
|
el-select(v-model="branch" @change="loadBranchVersions" style="display:inline-block;width:150px;margin-right:15px")
|
||||||
|
el-option(v-once v-for="branch in branches" :key="branch.name" :label="branch.name" :value="branch.name")
|
||||||
|
el-select(v-model="VRCXUpdateDialog.release" style="display:inline-block;width:150px")
|
||||||
|
el-option(v-for="item in VRCXUpdateDialog.releases" :key="item.name" :label="item.tag_name" :value="item.name")
|
||||||
|
div(v-if="!VRCXUpdateDialog.updatePending && VRCXUpdateDialog.release === appVersion" style="margin-top:15px")
|
||||||
span VRCX is up to date.
|
span VRCX is up to date.
|
||||||
template(#footer)
|
template(#footer)
|
||||||
el-button(v-if="!VRCXUpdateDialog.updatePending && VRCXUpdateDialog.release !== appVersion" type="primary" size="small" @click="installVRCXUpdate") Download
|
el-button(v-if="(VRCXUpdateDialog.updatePending && VRCXUpdateDialog.release !== pendingVRCXUpdate) || VRCXUpdateDialog.release !== appVersion" type="primary" size="small" @click="installVRCXUpdate") Download
|
||||||
el-button(v-if="VRCXUpdateDialog.updatePending" type="primary" size="small" @click="restartVRCX") Install
|
el-button(v-if="VRCXUpdateDialog.updatePending" type="primary" size="small" @click="restartVRCX") Install
|
||||||
|
|
||||||
//- dialog: launch
|
//- dialog: launch
|
||||||
|
|||||||
Reference in New Issue
Block a user