Implement migration system to move from canary/nightly

This commit is contained in:
James 2019-10-07 01:07:35 +01:00
parent 68109894f1
commit bdbab4dc4d
12 changed files with 166 additions and 17 deletions

View File

@ -56,3 +56,15 @@ slug = "0.1.4"
[target.'cfg(windows)'.build-dependencies] [target.'cfg(windows)'.build-dependencies]
winres = "0.1" winres = "0.1"
cc = "1.0" cc = "1.0"
[profile.release]
#panic = "abort"
lto = true
opt-level = "z"
codegen-units = 1
incremental = false
#[profile.release.overrides."*"] # +
#opt-level = "z"
#codegen-units = 1
#incremental = false

View File

@ -1,2 +1,2 @@
name = "yuzu" name = "yuzu"
target_url = "https://raw.githubusercontent.com/yuzu-emu/liftinstall/master/config.windows.v7.toml" target_url = "https://raw.githubusercontent.com/yuzu-emu/liftinstall/master/config.windows.v8.toml"

16
config.windows.v8.toml Normal file
View File

@ -0,0 +1,16 @@
installing_message = "Reminder: yuzu is an <b>experimental</b> emulator. Stuff will break!"
hide_advanced = true
[[packages]]
name = "yuzu"
description = "Includes frequent updates to yuzu with all the latest reviewed and tested features."
default = true
[packages.source]
name = "github"
match = "^yuzu-windows-msvc-[0-9]*-[0-9a-f]*.zip$"
[packages.source.config]
repo = "yuzu-emu/yuzu-mainline"
[[packages.shortcuts]]
name = "yuzu"
relative_path = "yuzu-windows-msvc/yuzu.exe"
description = "Launch yuzu"

View File

@ -42,7 +42,9 @@ pub fn file_from_string(file_path: &str) -> Option<(String, &'static [u8])> {
"/fonts/roboto-v18-latin-regular.woff", "/fonts/roboto-v18-latin-regular.woff",
"/fonts/roboto-v18-latin-regular.woff2", "/fonts/roboto-v18-latin-regular.woff2",
"/js/chunk-vendors.js", "/js/chunk-vendors.js",
"/js/app.js" "/js/chunk-vendors.js.map",
"/js/app.js",
"/js/app.js.map"
)?; )?;
Some((string_mime, contents)) Some((string_mime, contents))

View File

@ -47,13 +47,6 @@ impl Task for InstallTask {
}), }),
)); ));
for item in &self.items {
elements.push(TaskDependency::build(
TaskOrdering::Pre,
Box::new(InstallPackageTask { name: item.clone() }),
));
}
for item in &self.uninstall_items { for item in &self.uninstall_items {
elements.push(TaskDependency::build( elements.push(TaskDependency::build(
TaskOrdering::Pre, TaskOrdering::Pre,
@ -64,6 +57,13 @@ impl Task for InstallTask {
)); ));
} }
for item in &self.items {
elements.push(TaskDependency::build(
TaskOrdering::Pre,
Box::new(InstallPackageTask { name: item.clone() }),
));
}
if self.fresh_install { if self.fresh_install {
elements.push(TaskDependency::build( elements.push(TaskDependency::build(
TaskOrdering::Pre, TaskOrdering::Pre,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -1,6 +1,7 @@
import Vue from 'vue' import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
import DownloadConfig from './views/DownloadConfig.vue' import DownloadConfig from './views/DownloadConfig.vue'
import MigrateView from './views/MigrateView.vue'
import SelectPackages from './views/SelectPackages.vue' import SelectPackages from './views/SelectPackages.vue'
import ErrorView from './views/ErrorView.vue' import ErrorView from './views/ErrorView.vue'
import InstallPackages from './views/InstallPackages.vue' import InstallPackages from './views/InstallPackages.vue'
@ -16,6 +17,11 @@ export default new Router({
name: 'config', name: 'config',
component: DownloadConfig component: DownloadConfig
}, },
{
path: '/migrate',
name: 'migrate',
component: MigrateView
},
{ {
path: '/packages', path: '/packages',
name: 'packages', name: 'packages',
@ -32,7 +38,7 @@ export default new Router({
component: ErrorView component: ErrorView
}, },
{ {
path: '/complete/:uninstall/:update/:packages_installed', path: '/complete/:uninstall/:update/:migrate/:packages_installed',
name: 'complete', name: 'complete',
component: CompleteView component: CompleteView
}, },

View File

@ -1,6 +1,13 @@
<template> <template>
<div class="column has-padding"> <div class="column has-padding">
<div v-if="was_update"> <div v-if="was_migrate">
<h4 class="subtitle">You have been moved to the new, single version of {{ $root.$data.attrs.name }}.</h4>
<p>You can find your installed applications in your start menu - if you were in the middle of something, just reattempt.</p>
<img src="../assets/how-to-open.png" alt="Where yuzu is installed"/>
</div>
<div v-else-if="was_update">
<div v-if="has_installed"> <div v-if="has_installed">
<h4 class="subtitle">{{ $root.$data.attrs.name }} has been updated.</h4> <h4 class="subtitle">{{ $root.$data.attrs.name }} has been updated.</h4>
@ -38,6 +45,7 @@ export default {
return { return {
was_install: !this.$route.params.uninstall, was_install: !this.$route.params.uninstall,
was_update: this.$route.params.update, was_update: this.$route.params.update,
was_migrate: this.$route.params.migrate,
has_installed: this.$route.params.packages_installed > 0 has_installed: this.$route.params.packages_installed > 0
} }
}, },

View File

@ -71,11 +71,8 @@ export default {
} }
} }
if (app.metadata.is_launcher) { this.$router.replace({ name: 'migrate',
this.$router.replace('/install/regular') params: { next: app.metadata.is_launcher ? '/install/regular' : '/modify' } })
} else {
this.$router.replace('/modify')
}
} else { } else {
for (var x = 0; x < app.config.packages.length; x++) { for (var x = 0; x < app.config.packages.length; x++) {
app.config.packages[x].installed = false app.config.packages[x].installed = false
@ -89,7 +86,8 @@ export default {
} }
}) })
this.$router.replace('/packages') this.$router.replace({ name: 'migrate',
params: { next: '/packages' } })
} }
} }
} }

View File

@ -98,6 +98,7 @@ export default {
params: { params: {
uninstall: true, uninstall: true,
update: that.is_update, update: that.is_update,
migrate: false,
installed: that.packages_installed installed: that.packages_installed
} }) } })
} else { } else {
@ -105,6 +106,7 @@ export default {
params: { params: {
uninstall: false, uninstall: false,
update: that.is_update, update: that.is_update,
migrate: false,
installed: that.packages_installed installed: that.packages_installed
} }) } })
} }

View File

@ -0,0 +1,105 @@
<template>
<div class="column has-padding">
<h4 class="subtitle">Performing migrations...</h4>
<div v-html="$root.$data.config.installing_message"></div>
<br />
<div v-html="progress_message"></div>
<progress class="progress is-info is-medium" v-bind:value="progress" max="100">
{{ progress }}%
</progress>
</div>
</template>
<script>
export default {
name: 'MigrateView',
data: function () {
return {
progress: 0.0,
progress_message: 'Please wait...',
failed_with_error: false,
packages_installed: 0,
next_stop: this.$route.params.next
}
},
created: function () {
// See if we need to migrate yuzu to mainline
var need_migrate = false;
for (var package_id in this.$root.metadata.database.packages) {
var name = this.$root.metadata.database.packages[package_id].name
if ((name.indexOf("Nightly") !== -1 || name.indexOf("Canary") !== -1)) {
console.log("Migration needed (found \"" + name + "\", move to mainline)")
// Migration step: deactivate this package
if ( this.$root.config.packages[package_id] !== undefined) {
this.$root.config.packages[package_id].default = false;
}
// Migration step: enable mainline
for (var sub_package_id in this.$root.config.packages) {
var name = this.$root.config.packages[sub_package_id].name
if (name === "yuzu") {
this.$root.config.packages[sub_package_id].default = true;
break;
}
}
need_migrate = true;
}
}
console.log("Next stop: " + JSON.stringify(this.next_stop));
if (need_migrate) {
this.next_stop = "/complete/false/true/true/[]"
this.install()
} else {
this.$router.replace(this.next_stop)
}
},
methods: {
install: function () {
var that = this
var app = this.$root
var results = {}
for (var package_index = 0; package_index < app.config.packages.length; package_index++) {
var current_package = app.config.packages[package_index]
if (current_package.default != null) {
results[current_package.name] = current_package.default
}
}
console.log("Install results: " + JSON.stringify(results));
results['path'] = app.install_location
var targetUrl = '/api/start-install'
this.$root.stream_ajax(targetUrl, function (line) {
// On progress line received from server
if (line.hasOwnProperty('Status')) {
that.progress_message = line.Status[0]
that.progress = line.Status[1] * 100
}
if (line.hasOwnProperty('PackageInstalled')) {
that.packages_installed += 1
}
if (line.hasOwnProperty('Error')) {
that.failed_with_error = true
that.$router.replace({ name: 'showerr', params: { msg: line.Error } })
}
}, function (e) {
// On request completed
if (!that.failed_with_error) {
that.$router.replace(that.next_stop)
}
}, undefined, results)
}
}
}
</script>