From 732e344605a847999fb81c436d20a223ccbe6456 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Fri, 6 Dec 2019 22:04:44 -0700 Subject: [PATCH] Launch app on fresh install exit. Add desktop shortcuts --- config.windows.v10.toml | 54 ++--- src/config.rs | 25 ++- src/frontend/rest/services/exit.rs | 9 +- src/frontend/rest/services/install.rs | 7 +- src/frontend/rest/services/mod.rs | 2 +- src/installer.rs | 2 + src/native/interop.cpp | 12 ++ src/native/mod.rs | 58 +++++- src/tasks/check_authorization.rs | 2 +- src/tasks/download_pkg.rs | 2 +- src/tasks/install.rs | 9 +- src/tasks/install_desktop_shortcut.rs | 113 ++++++++++ src/tasks/install_pkg.rs | 28 +-- src/tasks/install_shortcuts.rs | 8 + src/tasks/launch_installed_on_exit.rs | 76 +++++++ src/tasks/mod.rs | 2 + ui/src/main.js | 3 +- ui/src/router.js | 2 +- ui/src/views/CompleteView.vue | 4 +- ui/src/views/DownloadConfig.vue | 4 +- ui/src/views/ErrorView.vue | 2 +- ui/src/views/InstallPackages.vue | 6 +- ui/src/views/ModifyView.vue | 4 +- ui/src/views/SelectPackages.vue | 289 +++++++++++++------------- 24 files changed, 500 insertions(+), 223 deletions(-) create mode 100644 src/tasks/install_desktop_shortcut.rs create mode 100644 src/tasks/launch_installed_on_exit.rs diff --git a/config.windows.v10.toml b/config.windows.v10.toml index 5cb22e6..cbf23bd 100644 --- a/config.windows.v10.toml +++ b/config.windows.v10.toml @@ -12,6 +12,35 @@ auth_url = "https://api.yuzu-emu.org/jwt/installer/" iss = "citra-core" aud = "installer" +[[packages]] +name = "yuzu Early Access" +description = "Preview release with the newest features for the supporters." +icon = "thicc_logo_installer__ea_shadow.png" +requires_authorization = true +# puts a "new" ribbon the package select +is_new = true + [packages.extended_description] + no_action_description = "Thank you for your support!" + # Displayed when the package has no authentication for the user + need_authentication_description = "Click here to sign in with your yuzu account for Early Access" + # Displayed when the package has an authentication, but the user has not linked their account + need_link_description = "You are signed in, but you need to link your Patreon account! Click here for more details" + # Displayed when the package has an authentication, but the user has not linked their account + need_subscription_description = "You are signed in, but you need to link your Patreon account! Click here for more details" + # Displayed when the package has an authentication, but the user has not linked their account + need_reward_tier_description = "You are signed in, but are not backing an eligible reward tier! Click here for more details" + + [packages.source] + name = "patreon" + match = "^yuzu-windows-msvc-[0-9]*-[0-9a-f]*.tar.xz$" + [packages.source.config] + repo = "earlyaccess" + [[packages.shortcuts]] + name = "yuzu Early Access" + relative_path = "yuzu-windows-msvc-early-access/yuzu.exe" + description = "Launch yuzu Early Access" + + [[packages]] name = "yuzu" description = "Includes frequent updates to yuzu with all the latest reviewed and tested features." @@ -27,28 +56,3 @@ default = true relative_path = "yuzu-windows-msvc/yuzu.exe" description = "Launch yuzu" -[[packages]] -name = "yuzu Early Access" -description = "Bonus preview release for project supporters. Thanks for your support!" -icon = "thicc_logo_installer__ea_shadow.png" -# Displayed when the package has no authentication for the user -need_authentication_description = "Click here to sign in with your yuzu account for Early Access" -# Displayed when the package has an authentication, but the user has not linked their account -need_link_description = "You are signed in, but you need to link your Patreon account! Click here for more details" -# Displayed when the package has an authentication, but the user has not linked their account -need_subscription_description = "You are signed in, but you need to link your Patreon account! Click here for more details" -# Displayed when the package has an authentication, but the user has not linked their account -need_reward_tier_description = "You are signed in, but are not backing an eligible reward tier! Click here for more details" -requires_authorization = true -# puts a "new" ribbon the package select -is_new = true - [packages.source] - name = "patreon" - match = "^yuzu-windows-msvc-[0-9]*-[0-9a-f]*.tar.xz$" - [packages.source.config] - repo = "earlyaccess" - [[packages.shortcuts]] - name = "yuzu Early Access" - relative_path = "yuzu-windows-msvc-early-access/yuzu.exe" - description = "Launch yuzu Early Access" - diff --git a/src/config.rs b/src/config.rs index cde0cd3..5b08d59 100644 --- a/src/config.rs +++ b/src/config.rs @@ -25,6 +25,23 @@ pub struct PackageShortcut { pub name: String, pub relative_path: String, pub description: String, + #[serde(default)] + pub has_desktop_shortcut: bool, +} + +/// Extra description for authentication and authorization state for a package +#[derive(Debug, Deserialize, Serialize, Clone)] +pub struct PackageExtendedDescription { + #[serde(default)] + pub no_action_description: Option, + #[serde(default)] + pub need_authentication_description: Option, + #[serde(default)] + pub need_link_description: Option, + #[serde(default)] + pub need_subscription_description: Option, + #[serde(default)] + pub need_reward_tier_description: Option, } /// Describes a overview of a individual package. @@ -43,13 +60,7 @@ pub struct PackageDescription { #[serde(default)] pub is_new: Option, #[serde(default)] - pub need_authentication_description: Option, - #[serde(default)] - pub need_link_description: Option, - #[serde(default)] - pub need_subscription_description: Option, - #[serde(default)] - pub need_reward_tier_description: Option, + pub extended_description: Option, } /// Configuration for validating the JWT token diff --git a/src/frontend/rest/services/exit.rs b/src/frontend/rest/services/exit.rs index d99b5b1..2ddeeb2 100644 --- a/src/frontend/rest/services/exit.rs +++ b/src/frontend/rest/services/exit.rs @@ -2,18 +2,15 @@ //! //! The /api/exit closes down the application. -use frontend::rest::services::default_future; -use frontend::rest::services::Future; -use frontend::rest::services::Request; -use frontend::rest::services::Response; -use frontend::rest::services::WebService; +use frontend::rest::services::Future as InternalFuture; +use frontend::rest::services::{default_future, Request, Response, WebService}; use hyper::header::ContentType; use hyper::StatusCode; use std::process::exit; -pub fn handle(service: &WebService, _req: Request) -> Future { +pub fn handle(service: &WebService, _req: Request) -> InternalFuture { match service.get_framework_write().shutdown() { Ok(_) => { exit(0); diff --git a/src/frontend/rest/services/install.rs b/src/frontend/rest/services/install.rs index 4b42bbf..f2cbeaa 100644 --- a/src/frontend/rest/services/install.rs +++ b/src/frontend/rest/services/install.rs @@ -28,12 +28,17 @@ pub fn handle(service: &WebService, req: Request) -> Future { let mut to_install = Vec::new(); let mut path: Option = None; + let mut install_desktop_shortcut= false; // Transform results into just an array of stuff to install for (key, value) in &results { if key == "path" { path = Some(value.to_owned()); continue; + } else if key == "installDesktopShortcut" { + info!("Found installDesktopShortcut {:?}", value); + install_desktop_shortcut = value == "true"; + continue; } if value == "true" { @@ -55,7 +60,7 @@ pub fn handle(service: &WebService, req: Request) -> Future { framework.set_install_dir(&path); } - if let Err(v) = framework.install(to_install, &sender, new_install) { + if let Err(v) = framework.install(to_install, &sender, new_install, install_desktop_shortcut) { error!("Install error occurred: {:?}", v); if let Err(v) = sender.send(InstallMessage::Error(v)) { error!("Failed to send install error: {:?}", v); diff --git a/src/frontend/rest/services/mod.rs b/src/frontend/rest/services/mod.rs index 390eb3c..db108d4 100644 --- a/src/frontend/rest/services/mod.rs +++ b/src/frontend/rest/services/mod.rs @@ -136,7 +136,7 @@ impl Service for WebService { (Method::Get, "/api/config") => config::handle(self, req), (Method::Get, "/api/dark-mode") => dark_mode::handle(self, req), (Method::Get, "/api/default-path") => default_path::handle(self, req), - (Method::Get, "/api/exit") => exit::handle(self, req), + (Method::Post, "/api/exit") => exit::handle(self, req), (Method::Get, "/api/packages") => packages::handle(self, req), (Method::Get, "/api/installation-status") => installation_status::handle(self, req), (Method::Post, "/api/check-auth") => authentication::handle(self, req), diff --git a/src/installer.rs b/src/installer.rs index d72ba5c..4738b4e 100644 --- a/src/installer.rs +++ b/src/installer.rs @@ -179,6 +179,7 @@ impl InstallerFramework { items: Vec, messages: &Sender, fresh_install: bool, + create_desktop_shortcuts: bool, ) -> Result<(), String> { info!( "Framework: Installing {:?} to {:?}", @@ -207,6 +208,7 @@ impl InstallerFramework { items, uninstall_items, fresh_install, + create_desktop_shortcuts, }); let mut tree = DependencyTree::build(task); diff --git a/src/native/interop.cpp b/src/native/interop.cpp index 6ff0154..97f5b83 100644 --- a/src/native/interop.cpp +++ b/src/native/interop.cpp @@ -164,3 +164,15 @@ extern "C" HRESULT getSystemFolder(wchar_t *out_path) } return result; } + +extern "C" HRESULT getDesktopFolder(wchar_t *out_path) +{ + PWSTR path = NULL; + HRESULT result = SHGetKnownFolderPath(FOLDERID_Desktop, 0, NULL, &path); + if (result == S_OK) + { + wcscpy_s(out_path, MAX_PATH + 1, path); + CoTaskMemFree(path); + } + return result; +} diff --git a/src/native/mod.rs b/src/native/mod.rs index 0a1e9b5..193f8c5 100644 --- a/src/native/mod.rs +++ b/src/native/mod.rs @@ -30,7 +30,7 @@ mod natives { HANDLE, PROCESS_QUERY_INFORMATION, PROCESS_TERMINATE, PROCESS_VM_READ, }; - use widestring::U16CString; + use widestring::{U16CString, U16CStr}; extern "C" { pub fn saveShortcut( @@ -50,6 +50,28 @@ mod natives { ) -> ::std::os::raw::c_int; pub fn getSystemFolder(out_path: *mut ::std::os::raw::c_ushort) -> HRESULT; + + pub fn getDesktopFolder(out_path: *mut ::std::os::raw::c_ushort) -> HRESULT; + } + + // Needed here for Windows interop + #[allow(unsafe_code)] + pub fn create_desktop_shortcut( + name: &str, + description: &str, + target: &str, + args: &str, + working_dir: &str, + exe_path: &str, + ) -> Result { + let mut cmd_path = [0u16; MAX_PATH + 1]; + let result = unsafe { getDesktopFolder(cmd_path.as_mut_ptr()) }; + let source_path = format!( + "{}\\{}.lnk", + String::from_utf16_lossy(&cmd_path[..count_u16(&cmd_path)]).as_str(), + name + ); + create_shortcut_inner(source_path, name, description, target, args, working_dir, exe_path) } // Needed here for Windows interop @@ -67,6 +89,20 @@ mod natives { env::var("APPDATA").log_expect("APPDATA is bad, apparently"), name ); + create_shortcut_inner(source_file, name, description, target, args, working_dir, exe_path) + } + + // Needed here for Windows interop + #[allow(unsafe_code)] + fn create_shortcut_inner( + source_file: String, + name: &str, + description: &str, + target: &str, + args: &str, + working_dir: &str, + exe_path: &str, + ) -> Result { info!("Generating shortcut @ {:?}", source_file); @@ -103,6 +139,17 @@ mod natives { } } + fn count_u16(u16str: &[u16]) -> usize { + let mut pos = 0; + for x in u16str.iter() { + if *x == 0 { + break; + } + pos += 1; + } + pos + } + /// Cleans up the installer pub fn burn_on_exit(app_name: &str) { let current_exe = env::current_exe().log_expect("Current executable could not be found"); @@ -132,20 +179,13 @@ mod natives { let spawn_result: i32 = unsafe { let mut cmd_path = [0u16; MAX_PATH + 1]; let result = getSystemFolder(cmd_path.as_mut_ptr()); - let mut pos = 0; - for x in cmd_path.iter() { - if *x == 0 { - break; - } - pos += 1; - } if result != winapi::shared::winerror::S_OK { return; } spawnDetached( U16CString::from_str( - format!("{}\\cmd.exe", String::from_utf16_lossy(&cmd_path[..pos])).as_str(), + format!("{}\\cmd.exe", String::from_utf16_lossy(&cmd_path[..count_u16(&cmd_path)])).as_str(), ) .log_expect("Unable to convert string to wchar_t") .as_ptr(), diff --git a/src/tasks/check_authorization.rs b/src/tasks/check_authorization.rs index de72a87..575bc76 100644 --- a/src/tasks/check_authorization.rs +++ b/src/tasks/check_authorization.rs @@ -22,7 +22,7 @@ impl Task for CheckAuthorizationTask { ) -> Result { assert_eq!(input.len(), 1); - let params = input.pop().log_expect("Should have input from resolver!"); + let params = input.pop().log_expect("Check Authorization Task should have input from resolver!"); let (version, file) = match params { TaskParamType::File(v, f) => Ok((v, f)), _ => Err("Unexpected TaskParamType in CheckAuthorization: {:?}"), diff --git a/src/tasks/download_pkg.rs b/src/tasks/download_pkg.rs index 205599a..6741568 100644 --- a/src/tasks/download_pkg.rs +++ b/src/tasks/download_pkg.rs @@ -24,7 +24,7 @@ impl Task for DownloadPackageTask { ) -> Result { assert_eq!(input.len(), 1); - let file = input.pop().log_expect("Should have input from resolver!"); + let file = input.pop().log_expect("Download Package Task should have input from resolver!"); let (version, file, auth) = match file { TaskParamType::Authentication(v, f, auth) => (v, f, auth), _ => return Err("Unexpected param type to download package".to_string()), diff --git a/src/tasks/install.rs b/src/tasks/install.rs index 2fcc3fb..88f7fbe 100644 --- a/src/tasks/install.rs +++ b/src/tasks/install.rs @@ -8,6 +8,7 @@ use tasks::install_global_shortcut::InstallGlobalShortcutsTask; use tasks::install_pkg::InstallPackageTask; use tasks::save_executable::SaveExecutableTask; use tasks::uninstall_pkg::UninstallPackageTask; +use tasks::launch_installed_on_exit::LaunchOnExitTask; use tasks::Task; use tasks::TaskDependency; @@ -19,6 +20,7 @@ pub struct InstallTask { pub items: Vec, pub uninstall_items: Vec, pub fresh_install: bool, + pub create_desktop_shortcuts: bool, } impl Task for InstallTask { @@ -60,7 +62,7 @@ impl Task for InstallTask { for item in &self.items { elements.push(TaskDependency::build( TaskOrdering::Pre, - Box::new(InstallPackageTask { name: item.clone() }), + Box::new(InstallPackageTask { name: item.clone(), create_desktop_shortcuts: self.create_desktop_shortcuts }), )); } @@ -74,6 +76,11 @@ impl Task for InstallTask { TaskOrdering::Pre, Box::new(InstallGlobalShortcutsTask {}), )); + + elements.push(TaskDependency::build( + TaskOrdering::Post, + Box::new(LaunchOnExitTask {}) + )) } elements diff --git a/src/tasks/install_desktop_shortcut.rs b/src/tasks/install_desktop_shortcut.rs new file mode 100644 index 0000000..58cb797 --- /dev/null +++ b/src/tasks/install_desktop_shortcut.rs @@ -0,0 +1,113 @@ +//! Generates shortcuts for a specified file. + +use installer::InstallerFramework; + +use tasks::Task; +use tasks::TaskDependency; +use tasks::TaskMessage; +use tasks::TaskParamType; + +use config::PackageDescription; + +use logging::LoggingErrors; + +use native::create_desktop_shortcut; + +pub struct InstallDesktopShortcutTask { + pub name: String, + pub should_run: bool, +} + +impl Task for InstallDesktopShortcutTask { + fn execute( + &mut self, + _: Vec, + context: &mut InstallerFramework, + messenger: &dyn Fn(&TaskMessage), + ) -> Result { + if !self.should_run { + return Ok(TaskParamType::GeneratedShortcuts(Vec::new())); + } + + messenger(&TaskMessage::DisplayMessage( + &format!("Generating desktop shortcuts for package {:?}...", self.name), + 0.0, + )); + + let path = context + .install_path + .as_ref() + .log_expect("No install path specified"); + + let starting_dir = path + .to_str() + .log_expect("Unable to build shortcut metadata (startingdir)"); + + let mut installed_files = Vec::new(); + + let mut metadata: Option = None; + for description in &context + .config + .as_ref() + .log_expect("Should have packages by now") + .packages + { + if self.name == description.name { + metadata = Some(description.clone()); + break; + } + } + + let package = match metadata { + Some(v) => v, + None => return Err(format!("Package {:?} could not be found.", self.name)), + }; + + // Generate installer path + let platform_extension = if cfg!(windows) { + "maintenancetool.exe" + } else { + "maintenancetool" + }; + + for shortcut in package.shortcuts { + let tool_path = path.join(platform_extension); + let tool_path = tool_path + .to_str() + .log_expect("Unable to build shortcut metadata (tool)"); + + let exe_path = path.join(shortcut.relative_path); + let exe_path = exe_path + .to_str() + .log_expect("Unable to build shortcut metadata (exe)"); + + installed_files.push(create_desktop_shortcut( + &shortcut.name, + &shortcut.description, + tool_path, + // TODO: Send by list + &format!("--launcher \"{}\"", exe_path), + &starting_dir, + exe_path, + )?); + } + + // Update the installed packages shortcuts information in the database + let packages = &mut context.database.packages; + for pack in packages { + if pack.name == self.name { + pack.shortcuts.append(&mut installed_files); + } + } + + Ok(TaskParamType::GeneratedShortcuts(installed_files)) + } + + fn dependencies(&self) -> Vec { + vec![] + } + + fn name(&self) -> String { + format!("InstallDesktopShortcutTask (for {:?}, should_run = {:?})", self.name, self.should_run) + } +} diff --git a/src/tasks/install_pkg.rs b/src/tasks/install_pkg.rs index c2f2750..0299a31 100644 --- a/src/tasks/install_pkg.rs +++ b/src/tasks/install_pkg.rs @@ -24,9 +24,11 @@ use archives; use std::fs::OpenOptions; use std::path::Path; +use tasks::install_desktop_shortcut::InstallDesktopShortcutTask; pub struct InstallPackageTask { pub name: String, + pub create_desktop_shortcuts: bool, } impl Task for InstallPackageTask { @@ -66,20 +68,15 @@ impl Task for InstallPackageTask { None => return Err(format!("Package {:?} could not be found.", self.name)), }; - // Grab data from the shortcut generator - let shortcuts = input.pop().log_expect("Should have input from resolver!"); - let shortcuts = match shortcuts { - TaskParamType::GeneratedShortcuts(files) => files, - // If the resolver returned early, we need to unwind + // Ignore input from the uninstaller - no useful information passed + // If a previous task Breaks, then just early exit + match input.pop().log_expect("Install Package Task should have guaranteed output!") { TaskParamType::Break => return Ok(TaskParamType::None), - _ => return Err("Unexpected shortcuts param type to install package".to_string()), + _ => (), }; - // Ignore input from the uninstaller - no useful information passed - input.pop(); - // Grab data from the resolver - let data = input.pop().log_expect("Should have input from resolver!"); + let data = input.pop().log_expect("Install Package Task should have input from resolver!"); let (version, file, data) = match data { TaskParamType::FileContents(version, file, data) => (version, file, data), _ => return Err("Unexpected file contents param type to install package".to_string()), @@ -170,7 +167,7 @@ impl Task for InstallPackageTask { context.database.packages.push(LocalInstallation { name: package.name.to_owned(), version, - shortcuts, + shortcuts: Vec::new(), files: installed_files, }); @@ -195,11 +192,18 @@ impl Task for InstallPackageTask { }), ), TaskDependency::build( - TaskOrdering::Pre, + TaskOrdering::Post, Box::new(InstallShortcutsTask { name: self.name.clone(), }), ), + TaskDependency::build( + TaskOrdering::Post, + Box::new(InstallDesktopShortcutTask { + name: self.name.clone(), + should_run: self.create_desktop_shortcuts + }), + ), TaskDependency::build(TaskOrdering::Post, Box::new(SaveDatabaseTask {})), ] } diff --git a/src/tasks/install_shortcuts.rs b/src/tasks/install_shortcuts.rs index 0495e33..d445dcc 100644 --- a/src/tasks/install_shortcuts.rs +++ b/src/tasks/install_shortcuts.rs @@ -87,6 +87,14 @@ impl Task for InstallShortcutsTask { )?); } + // Update the installed packages shortcuts information in the database + let packages = &mut context.database.packages; + for pack in packages { + if pack.name == self.name { + pack.shortcuts.append(&mut installed_files); + } + } + Ok(TaskParamType::GeneratedShortcuts(installed_files)) } diff --git a/src/tasks/launch_installed_on_exit.rs b/src/tasks/launch_installed_on_exit.rs new file mode 100644 index 0000000..5b7251f --- /dev/null +++ b/src/tasks/launch_installed_on_exit.rs @@ -0,0 +1,76 @@ +//! Configures lift to launch the new package on fresh install after its closed +//! If theres multiple launchable packages, then choose the first listed in config +//! If there are multiple shortcuts for the first package, then launch the first. + +use installer::InstallerFramework; + +use tasks::Task; +use tasks::TaskDependency; +use tasks::TaskMessage; +use tasks::TaskParamType; + +use config::PackageDescription; + +use logging::LoggingErrors; + +use native::create_desktop_shortcut; + +pub struct LaunchOnExitTask {} + +impl Task for LaunchOnExitTask { + + fn execute( + &mut self, + mut input: Vec, + context: &mut InstallerFramework, + messenger: &dyn Fn(&TaskMessage), + ) -> Result { + let pkg = &context.database.packages.first(); + if pkg.is_none() { + return Ok(TaskParamType::None) + } + let pkg = pkg.unwrap(); + + // look up the first shortcut for the first listed package in the database + let path = context + .install_path + .as_ref() + .log_expect("No install path specified"); + + let mut metadata: Option = None; + for description in &context + .config + .as_ref() + .log_expect("Should have packages by now") + .packages + { + if pkg.name == description.name { + metadata = Some(description.clone()); + break; + } + } + + let package_desc = match metadata { + Some(v) => v, + // Package metadata is missing. Dunno what went wrong but we can skip this then + None => return Ok(TaskParamType::None), + }; + + let shortcut = package_desc.shortcuts.first(); + + // copy the path to the actual exe into launcher_path so it'll load it on exit + context.launcher_path = shortcut.map(|s| { + path.join(s.relative_path.clone()).to_str().map(|t| { t.to_string() }).unwrap() + }); + + Ok(TaskParamType::None) + } + + fn dependencies(&self) -> Vec { + vec![] + } + + fn name(&self) -> String { + "LaunchOnExitTask".to_string() + } +} \ No newline at end of file diff --git a/src/tasks/mod.rs b/src/tasks/mod.rs index a898f50..85f2c22 100644 --- a/src/tasks/mod.rs +++ b/src/tasks/mod.rs @@ -13,10 +13,12 @@ pub mod check_authorization; pub mod download_pkg; pub mod ensure_only_instance; pub mod install; +pub mod install_desktop_shortcut; pub mod install_dir; pub mod install_global_shortcut; pub mod install_pkg; pub mod install_shortcuts; +pub mod launch_installed_on_exit; pub mod resolver; pub mod save_database; pub mod save_executable; diff --git a/ui/src/main.js b/ui/src/main.js index d54e051..8e81fbb 100644 --- a/ui/src/main.js +++ b/ui/src/main.js @@ -115,7 +115,8 @@ var app = new Vue({ '\n\nPlease upload the log file (in ' + search_location + ') to ' + 'the ' + app.attrs.name + ' team' }}); - } + }, + {} // pass in nothing to cause `ajax` to post instead of get ) }, check_authentication: function (success, error) { diff --git a/ui/src/router.js b/ui/src/router.js index 8b021d7..5a0a2e9 100644 --- a/ui/src/router.js +++ b/ui/src/router.js @@ -30,7 +30,7 @@ export default new Router({ component: SelectPackages }, { - path: '/install/:kind', + path: '/install/:kind/:desktop_shortcut', name: 'install', component: InstallPackages }, diff --git a/ui/src/views/CompleteView.vue b/ui/src/views/CompleteView.vue index 6ef1ff9..60c3895 100644 --- a/ui/src/views/CompleteView.vue +++ b/ui/src/views/CompleteView.vue @@ -46,12 +46,12 @@ export default { was_install: !this.$route.params.uninstall, 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, } }, methods: { exit: function () { - this.$root.exit() + this.$root.exit(); } } } diff --git a/ui/src/views/DownloadConfig.vue b/ui/src/views/DownloadConfig.vue index fd95dad..57a6732 100644 --- a/ui/src/views/DownloadConfig.vue +++ b/ui/src/views/DownloadConfig.vue @@ -31,7 +31,7 @@ export default { // Update the updater if needed if (that.$root.config.new_tool) { - this.$router.push('/install/updater') + this.$router.push('/install/updater/false') return } @@ -70,7 +70,7 @@ export default { } this.$router.replace({ name: 'migrate', - params: { next: app.metadata.is_launcher ? '/install/regular' : '/modify' } }) + params: { next: app.metadata.is_launcher ? '/install/regular/false' : '/modify' } }) } else { for (var x = 0; x < app.config.packages.length; x++) { app.config.packages[x].installed = false diff --git a/ui/src/views/ErrorView.vue b/ui/src/views/ErrorView.vue index d8313ce..6c1be87 100644 --- a/ui/src/views/ErrorView.vue +++ b/ui/src/views/ErrorView.vue @@ -3,7 +3,7 @@
-
+

Back Exit diff --git a/ui/src/views/InstallPackages.vue b/ui/src/views/InstallPackages.vue index 514b6fd..1607ff1 100644 --- a/ui/src/views/InstallPackages.vue +++ b/ui/src/views/InstallPackages.vue @@ -24,6 +24,7 @@ export default { is_uninstall: false, is_updater_update: false, is_update: false, + install_desktop_shortcut: false, failed_with_error: false, authorization_required: false, packages_installed: 0 @@ -33,7 +34,9 @@ export default { this.is_uninstall = this.$route.params.kind === 'uninstall' this.is_updater_update = this.$route.params.kind === 'updater' this.is_update = this.$route.params.kind === 'update' + this.install_desktop_shortcut = this.$route.params.desktop_shortcut === 'true' console.log('Installer kind: ' + this.$route.params.kind) + console.log('Installing desktop shortcut: ' + this.$route.params.desktop_shortcut) this.install() }, methods: { @@ -53,6 +56,7 @@ export default { } results['path'] = app.install_location + results['installDesktopShortcut'] = that.install_desktop_shortcut var targetUrl = '/api/start-install' if (this.is_uninstall) { @@ -88,7 +92,7 @@ export default { if (that.is_updater_update) { // Continue with what we were doing if (app.metadata.is_launcher) { - that.$router.replace('/install/regular') + that.$router.replace('/install/regular/' + that.install_desktop_shortcut.toString()) } else { if (app.metadata.preexisting_install) { that.$router.replace('/modify') diff --git a/ui/src/views/ModifyView.vue b/ui/src/views/ModifyView.vue index bd6ede9..a93fa95 100644 --- a/ui/src/views/ModifyView.vue +++ b/ui/src/views/ModifyView.vue @@ -43,7 +43,7 @@ export default { }, methods: { update: function () { - this.$router.push('/install/update') + this.$router.push('/install/update/false') }, modify_packages: function () { this.$router.push('/packages') @@ -55,7 +55,7 @@ export default { this.show_uninstall = false }, uninstall: function () { - this.$router.push('/install/uninstall') + this.$router.push('/install/uninstall/false') } } } diff --git a/ui/src/views/SelectPackages.vue b/ui/src/views/SelectPackages.vue index 51c2a12..24ff657 100644 --- a/ui/src/views/SelectPackages.vue +++ b/ui/src/views/SelectPackages.vue @@ -1,160 +1,151 @@