From baa1c52126eae7980f49f39631e2c5931d5b478f Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 17 Jul 2023 14:12:46 +0200 Subject: [PATCH 1/8] Add support for launch parameters --- src-tauri/src/main.rs | 3 ++- src-tauri/src/northstar/install.rs | 1 + src-tauri/src/northstar/mod.rs | 8 +++++++- src-vue/src/i18n/lang/en.json | 1 + src-vue/src/plugins/store.ts | 10 +++++++++- src-vue/src/utils/GameInstall.ts | 1 + src-vue/src/views/SettingsView.vue | 19 +++++++++++++++++++ 7 files changed, 40 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 5d71713a3..6553ed4e4 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -474,6 +474,7 @@ pub enum InstallType { #[derive(Serialize, Deserialize, Debug, Clone)] pub struct GameInstall { pub game_path: String, + pub launch_parameters: String, pub install_type: InstallType, } @@ -575,7 +576,7 @@ fn launch_northstar_steam( return Err("Couldn't access Titanfall2 directory".to_string()); } - match open::that(format!("steam://run/{}//--northstar/", TITANFALL2_STEAM_ID)) { + match open::that(format!("steam://run/{}//--northstar {}/", TITANFALL2_STEAM_ID, game_install.launch_parameters)) { Ok(()) => Ok("Started game".to_string()), Err(_err) => Err("Failed to launch Titanfall 2 via Steam".to_string()), } diff --git a/src-tauri/src/northstar/install.rs b/src-tauri/src/northstar/install.rs index 875458ddb..71da515d5 100644 --- a/src-tauri/src/northstar/install.rs +++ b/src-tauri/src/northstar/install.rs @@ -174,6 +174,7 @@ pub fn find_game_install_location() -> Result { // println!("{:#?}", app); let game_install = GameInstall { game_path: app.path.to_str().unwrap().to_string(), + launch_parameters: "".to_string(), install_type: InstallType::STEAM, }; return Ok(game_install); diff --git a/src-tauri/src/northstar/mod.rs b/src-tauri/src/northstar/mod.rs index 47510dbd5..2630ff1f0 100644 --- a/src-tauri/src/northstar/mod.rs +++ b/src-tauri/src/northstar/mod.rs @@ -109,8 +109,14 @@ pub fn launch_northstar( || matches!(game_install.install_type, InstallType::UNKNOWN)) { let ns_exe_path = format!("{}/NorthstarLauncher.exe", game_install.game_path); + let ns_params: Vec<&str> = game_install.launch_parameters.split_whitespace().collect(); + + let mut args = vec!["/C", "start", "", &ns_exe_path]; + // We cannot add the params directly because of limitations with cmd.exe + // https://stackoverflow.com/questions/9964865/c-system-not-working-when-there-are-spaces-in-two-different-parameters/9965141#9965141 + args.extend(ns_params); let _output = std::process::Command::new("C:\\Windows\\System32\\cmd.exe") - .args(["/C", "start", "", &ns_exe_path]) + .args(args) .spawn() .expect("failed to execute process"); return Ok("Launched game".to_string()); diff --git a/src-vue/src/i18n/lang/en.json b/src-vue/src/i18n/lang/en.json index 470e98be7..b1c693886 100644 --- a/src-vue/src/i18n/lang/en.json +++ b/src-vue/src/i18n/lang/en.json @@ -92,6 +92,7 @@ "settings": { "manage_install": "Manage installation", + "launch_parameters": "Launch parameters", "choose_folder": "Choose installation folder", "open_game_folder": "Open Folder", "nb_ts_mods_per_page": "Number of Thunderstore mods per page", diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts index e7dc0763f..57021c97f 100644 --- a/src-vue/src/plugins/store.ts +++ b/src-vue/src/plugins/store.ts @@ -26,6 +26,7 @@ const persistentStore = new Store('flight-core-settings.json'); export interface FlightCoreStore { developer_mode: boolean, game_path: string, + launch_parameters: string, install_type: InstallType, flightcore_version: string, @@ -62,6 +63,7 @@ export const store = createStore({ return { developer_mode: false, game_path: undefined as unknown as string, + launch_parameters: undefined as unknown as string, install_type: undefined as unknown as InstallType, flightcore_version: "", @@ -243,7 +245,8 @@ export const store = createStore({ async launchGameSteam(state: any, no_checks = false) { let game_install = { game_path: state.game_path, - install_type: state.install_type + install_type: state.install_type, + launch_parameters: state.launch_parameters } as GameInstall; await invoke("launch_northstar_steam", { gameInstall: game_install, bypassChecks: no_checks }) @@ -374,6 +377,11 @@ async function _initializeApp(state: any) { state.enableReleasesSwitch = valueFromStore.value; } + const paramsFromStore: { value: boolean } | null = await persistentStore.get('northstar-launch-parameters'); + if (paramsFromStore) { + state.launch_parameters = paramsFromStore.value; + } + // Grab "Thunderstore mods per page" setting from store if possible const perPageFromStore: { value: number } | null = await persistentStore.get('thunderstore-mods-per-page'); if (perPageFromStore && perPageFromStore.value) { diff --git a/src-vue/src/utils/GameInstall.ts b/src-vue/src/utils/GameInstall.ts index 07358f6cf..22081afcd 100644 --- a/src-vue/src/utils/GameInstall.ts +++ b/src-vue/src/utils/GameInstall.ts @@ -1,4 +1,5 @@ export interface GameInstall { game_path: string; + launch_parameters: string; install_type: string; } diff --git a/src-vue/src/views/SettingsView.vue b/src-vue/src/views/SettingsView.vue index c4e94c80a..5cc87213d 100644 --- a/src-vue/src/views/SettingsView.vue +++ b/src-vue/src/views/SettingsView.vue @@ -21,6 +21,15 @@ + +
+

{{ $t('settings.launch_parameters') }}

+ + +
+

{{ $t('settings.nb_ts_mods_per_page') }}

@@ -135,6 +144,16 @@ export default defineComponent({ } } }, + launchParameters: { + get(): string { + return this.$store.state.launch_parameters + }, + async set(value: string) { + this.$store.state.launch_parameters = value; + persistentStore.set('northstar-launch-parameters', { value }); + await persistentStore.save(); // explicit save to disk + } + }, modsPerPage: { get(): number { return this.$store.state.mods_per_page; From 59ff6871f74d164a8d2d308094d5c8fd253d03e5 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Mon, 24 Jul 2023 00:41:38 +0200 Subject: [PATCH 2/8] refactor: Remove all of arg store again --- src-tauri/src/main.rs | 1 - src-tauri/src/northstar/install.rs | 1 - src-tauri/src/northstar/mod.rs | 14 ++++++++++---- src-vue/src/i18n/lang/en.json | 1 - src-vue/src/plugins/store.ts | 10 +--------- src-vue/src/utils/GameInstall.ts | 1 - src-vue/src/views/SettingsView.vue | 19 ------------------- 7 files changed, 11 insertions(+), 36 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 21408ff8e..1067f5d3e 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -467,7 +467,6 @@ pub enum InstallType { #[derive(Serialize, Deserialize, Debug, Clone)] pub struct GameInstall { pub game_path: String, - pub launch_parameters: String, pub install_type: InstallType, } diff --git a/src-tauri/src/northstar/install.rs b/src-tauri/src/northstar/install.rs index 28366738c..c77fd5389 100644 --- a/src-tauri/src/northstar/install.rs +++ b/src-tauri/src/northstar/install.rs @@ -190,7 +190,6 @@ pub fn find_game_install_location() -> Result { // println!("{:#?}", app); let game_install = GameInstall { game_path: app.path.to_str().unwrap().to_string(), - launch_parameters: "".to_string(), install_type: InstallType::STEAM, }; return Ok(game_install); diff --git a/src-tauri/src/northstar/mod.rs b/src-tauri/src/northstar/mod.rs index 6d0e26d20..a77755cb4 100644 --- a/src-tauri/src/northstar/mod.rs +++ b/src-tauri/src/northstar/mod.rs @@ -62,6 +62,7 @@ pub fn get_northstar_version_number(game_path: &str) -> Result { pub fn launch_northstar( game_install: GameInstall, bypass_checks: Option, + launch_parameters: Option, ) -> Result { dbg!(game_install.clone()); @@ -77,7 +78,7 @@ pub fn launch_northstar( )); } - return launch_northstar_steam(game_install, bypass_checks); + return launch_northstar_steam(game_install, bypass_checks, launch_parameters); } let bypass_checks = bypass_checks.unwrap_or(false); @@ -112,11 +113,14 @@ pub fn launch_northstar( || matches!(game_install.install_type, InstallType::UNKNOWN)) { let ns_exe_path = format!("{}/NorthstarLauncher.exe", game_install.game_path); - let ns_params: Vec<&str> = game_install.launch_parameters.split_whitespace().collect(); - + let mut args = vec!["/C", "start", "", &ns_exe_path]; // We cannot add the params directly because of limitations with cmd.exe // https://stackoverflow.com/questions/9964865/c-system-not-working-when-there-are-spaces-in-two-different-parameters/9965141#9965141 + + let launch_parameters = launch_parameters.unwrap_or_else(|| "".to_string()); + let ns_params: Vec<&str> = launch_parameters.split_whitespace().collect(); + dbg!(ns_params.clone()); args.extend(ns_params); let _output = std::process::Command::new("C:\\Windows\\System32\\cmd.exe") .args(args) @@ -137,6 +141,7 @@ pub fn launch_northstar( pub fn launch_northstar_steam( game_install: GameInstall, _bypass_checks: Option, + launch_parameters: Option, ) -> Result { if !matches!(game_install.install_type, InstallType::STEAM) { return Err("Titanfall2 was not installed via Steam".to_string()); @@ -179,7 +184,8 @@ pub fn launch_northstar_steam( return Err("Couldn't access Titanfall2 directory".to_string()); } - match open::that(format!("steam://run/{}//--northstar {}/", TITANFALL2_STEAM_ID, game_install.launch_parameters)) { + let launch_parameters = launch_parameters.unwrap_or_else(|| "".to_string()); + match open::that(format!("steam://run/{}//--northstar {}/", TITANFALL2_STEAM_ID, launch_parameters)) { Ok(()) => Ok("Started game".to_string()), Err(_err) => Err("Failed to launch Titanfall 2 via Steam".to_string()), } diff --git a/src-vue/src/i18n/lang/en.json b/src-vue/src/i18n/lang/en.json index b1c693886..470e98be7 100644 --- a/src-vue/src/i18n/lang/en.json +++ b/src-vue/src/i18n/lang/en.json @@ -92,7 +92,6 @@ "settings": { "manage_install": "Manage installation", - "launch_parameters": "Launch parameters", "choose_folder": "Choose installation folder", "open_game_folder": "Open Folder", "nb_ts_mods_per_page": "Number of Thunderstore mods per page", diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts index 57021c97f..e7dc0763f 100644 --- a/src-vue/src/plugins/store.ts +++ b/src-vue/src/plugins/store.ts @@ -26,7 +26,6 @@ const persistentStore = new Store('flight-core-settings.json'); export interface FlightCoreStore { developer_mode: boolean, game_path: string, - launch_parameters: string, install_type: InstallType, flightcore_version: string, @@ -63,7 +62,6 @@ export const store = createStore({ return { developer_mode: false, game_path: undefined as unknown as string, - launch_parameters: undefined as unknown as string, install_type: undefined as unknown as InstallType, flightcore_version: "", @@ -245,8 +243,7 @@ export const store = createStore({ async launchGameSteam(state: any, no_checks = false) { let game_install = { game_path: state.game_path, - install_type: state.install_type, - launch_parameters: state.launch_parameters + install_type: state.install_type } as GameInstall; await invoke("launch_northstar_steam", { gameInstall: game_install, bypassChecks: no_checks }) @@ -377,11 +374,6 @@ async function _initializeApp(state: any) { state.enableReleasesSwitch = valueFromStore.value; } - const paramsFromStore: { value: boolean } | null = await persistentStore.get('northstar-launch-parameters'); - if (paramsFromStore) { - state.launch_parameters = paramsFromStore.value; - } - // Grab "Thunderstore mods per page" setting from store if possible const perPageFromStore: { value: number } | null = await persistentStore.get('thunderstore-mods-per-page'); if (perPageFromStore && perPageFromStore.value) { diff --git a/src-vue/src/utils/GameInstall.ts b/src-vue/src/utils/GameInstall.ts index 22081afcd..07358f6cf 100644 --- a/src-vue/src/utils/GameInstall.ts +++ b/src-vue/src/utils/GameInstall.ts @@ -1,5 +1,4 @@ export interface GameInstall { game_path: string; - launch_parameters: string; install_type: string; } diff --git a/src-vue/src/views/SettingsView.vue b/src-vue/src/views/SettingsView.vue index 5cc87213d..c4e94c80a 100644 --- a/src-vue/src/views/SettingsView.vue +++ b/src-vue/src/views/SettingsView.vue @@ -21,15 +21,6 @@
- -
-

{{ $t('settings.launch_parameters') }}

- - -
-

{{ $t('settings.nb_ts_mods_per_page') }}

@@ -144,16 +135,6 @@ export default defineComponent({ } } }, - launchParameters: { - get(): string { - return this.$store.state.launch_parameters - }, - async set(value: string) { - this.$store.state.launch_parameters = value; - persistentStore.set('northstar-launch-parameters', { value }); - await persistentStore.save(); // explicit save to disk - } - }, modsPerPage: { get(): number { return this.$store.state.mods_per_page; From a49856409270f6ab45bbad9bff28891319a58a10 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Mon, 24 Jul 2023 02:07:23 +0200 Subject: [PATCH 3/8] feat: Add button to launch with args in DevView --- src-vue/src/components/PlayButton.vue | 2 +- src-vue/src/plugins/store.ts | 13 ++++++++----- src-vue/src/utils/LaunchObject.d.ts | 4 ++++ src-vue/src/views/DeveloperView.vue | 27 +++++++++++++++++++++++++-- 4 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 src-vue/src/utils/LaunchObject.d.ts diff --git a/src-vue/src/components/PlayButton.vue b/src-vue/src/components/PlayButton.vue index 83a23ae56..ba40d68e3 100644 --- a/src-vue/src/components/PlayButton.vue +++ b/src-vue/src/components/PlayButton.vue @@ -87,7 +87,7 @@ export default defineComponent({ }, methods: { async launchGame() { - this.$store.commit('launchGame'); + this.$store.commit('launchGame', {}); } } }); diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts index e7dc0763f..fd4f86421 100644 --- a/src-vue/src/plugins/store.ts +++ b/src-vue/src/plugins/store.ts @@ -4,6 +4,7 @@ import { Tabs } from "../utils/Tabs"; import { InstallType } from "../utils/InstallType"; import { invoke } from "@tauri-apps/api"; import { GameInstall } from "../utils/GameInstall"; +import { LaunchObject } from "../utils/LaunchObject.d"; import { ReleaseCanal } from "../utils/ReleaseCanal"; import { FlightCoreVersion } from "../../../src-tauri/bindings/FlightCoreVersion"; import { NotificationHandle } from 'element-plus'; @@ -167,14 +168,15 @@ export const store = createStore({ } } }, - async launchGame(state: any, no_checks = false) { + async launchGame(state: any, payload: LaunchObject) { + const { no_checks = false, launch_args = undefined } = payload; let game_install = { game_path: state.game_path, install_type: state.install_type } as GameInstall; if (no_checks) { - await invoke("launch_northstar", { gameInstall: game_install, bypassChecks: no_checks }) + await invoke("launch_northstar", {gameInstall: game_install, bypassChecks: no_checks, launchParameters: launch_args}) .then((message) => { console.log("Launched with bypassed checks"); console.log(message); @@ -224,7 +226,7 @@ export const store = createStore({ // Game is ready to play. case NorthstarState.READY_TO_PLAY: - await invoke("launch_northstar", { gameInstall: game_install }) + await invoke("launch_northstar", { gameInstall: game_install, launchParameters: launch_args }) .then((message) => { console.log(message); // NorthstarState.RUNNING @@ -240,13 +242,14 @@ export const store = createStore({ break; } }, - async launchGameSteam(state: any, no_checks = false) { + async launchGameSteam(state: any, payload: LaunchObject) { + const { no_checks = false, launch_args = undefined } = payload; let game_install = { game_path: state.game_path, install_type: state.install_type } as GameInstall; - await invoke("launch_northstar_steam", { gameInstall: game_install, bypassChecks: no_checks }) + await invoke("launch_northstar_steam", { gameInstall: game_install, bypassChecks: no_checks, launchParametres: launch_args }) .then((message) => { showNotification('Success'); }) diff --git a/src-vue/src/utils/LaunchObject.d.ts b/src-vue/src/utils/LaunchObject.d.ts new file mode 100644 index 000000000..2fbd47320 --- /dev/null +++ b/src-vue/src/utils/LaunchObject.d.ts @@ -0,0 +1,4 @@ +export interface LaunchObject { + no_checks: boolean, + launch_args: string, +} diff --git a/src-vue/src/views/DeveloperView.vue b/src-vue/src/views/DeveloperView.vue index 28ab38922..c52c5bf9f 100644 --- a/src-vue/src/views/DeveloperView.vue +++ b/src-vue/src/views/DeveloperView.vue @@ -43,6 +43,21 @@ Launch Northstar via Steam +
+
+ + + + Launch Northstar with args + + + + Launch Northstar with args via Steam + + +
+
+ Install launcher from main branch @@ -147,6 +162,7 @@ export default defineComponent({ data() { return { mod_to_install_field_string: "", + launch_args: undefined, release_notes_text: "", first_tag: { label: '', value: { name: '' } }, second_tag: { label: '', value: { name: '' } }, @@ -203,10 +219,17 @@ export default defineComponent({ }); }, async launchGameWithoutChecks() { - this.$store.commit('launchGame', true); + this.$store.commit('launchGame', {no_checks: true}); + }, + async launchGameWithArgs() { + console.log(this.launch_args); + this.$store.commit('launchGame', {no_checks: false, launch_args: this.launch_args}); }, async launchGameViaSteam() { - this.$store.commit('launchGameSteam', true); + this.$store.commit('launchGameSteam', {no_checks: true}); + }, + async launchGameViaSteamWithArgs() { + this.$store.commit('launchGameSteam', {no_checks: false, launch_args: this.launch_args}); }, async getInstalledMods() { let game_install = { From 67867f79e415f8f232cb26c36f7387008e576350 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Mon, 24 Jul 2023 02:11:05 +0200 Subject: [PATCH 4/8] style: Formatting --- src-tauri/src/northstar/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/northstar/mod.rs b/src-tauri/src/northstar/mod.rs index a77755cb4..9ed755c6f 100644 --- a/src-tauri/src/northstar/mod.rs +++ b/src-tauri/src/northstar/mod.rs @@ -113,7 +113,7 @@ pub fn launch_northstar( || matches!(game_install.install_type, InstallType::UNKNOWN)) { let ns_exe_path = format!("{}/NorthstarLauncher.exe", game_install.game_path); - + let mut args = vec!["/C", "start", "", &ns_exe_path]; // We cannot add the params directly because of limitations with cmd.exe // https://stackoverflow.com/questions/9964865/c-system-not-working-when-there-are-spaces-in-two-different-parameters/9965141#9965141 @@ -185,7 +185,10 @@ pub fn launch_northstar_steam( } let launch_parameters = launch_parameters.unwrap_or_else(|| "".to_string()); - match open::that(format!("steam://run/{}//--northstar {}/", TITANFALL2_STEAM_ID, launch_parameters)) { + match open::that(format!( + "steam://run/{}//--northstar {}/", + TITANFALL2_STEAM_ID, launch_parameters + )) { Ok(()) => Ok("Started game".to_string()), Err(_err) => Err("Failed to launch Titanfall 2 via Steam".to_string()), } From c227cd0111298f6d341e7b00a27d36bd0a483a36 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Mon, 24 Jul 2023 02:18:08 +0200 Subject: [PATCH 5/8] fix: Address clippy errors --- src-tauri/src/northstar/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/northstar/mod.rs b/src-tauri/src/northstar/mod.rs index 9ed755c6f..86e50d5f6 100644 --- a/src-tauri/src/northstar/mod.rs +++ b/src-tauri/src/northstar/mod.rs @@ -118,7 +118,7 @@ pub fn launch_northstar( // We cannot add the params directly because of limitations with cmd.exe // https://stackoverflow.com/questions/9964865/c-system-not-working-when-there-are-spaces-in-two-different-parameters/9965141#9965141 - let launch_parameters = launch_parameters.unwrap_or_else(|| "".to_string()); + let launch_parameters = launch_parameters.unwrap_or_default(); let ns_params: Vec<&str> = launch_parameters.split_whitespace().collect(); dbg!(ns_params.clone()); args.extend(ns_params); @@ -184,7 +184,7 @@ pub fn launch_northstar_steam( return Err("Couldn't access Titanfall2 directory".to_string()); } - let launch_parameters = launch_parameters.unwrap_or_else(|| "".to_string()); + let launch_parameters = launch_parameters.unwrap_or_default(); match open::that(format!( "steam://run/{}//--northstar {}/", TITANFALL2_STEAM_ID, launch_parameters From e621728fbbc6a3a65b8a989a098bfbc2c186cbd6 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Mon, 24 Jul 2023 14:17:40 +0200 Subject: [PATCH 6/8] style: Formatting --- src-vue/src/plugins/store.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts index 89b3fcace..c2664b6bd 100644 --- a/src-vue/src/plugins/store.ts +++ b/src-vue/src/plugins/store.ts @@ -164,7 +164,7 @@ export const store = createStore({ async launchGame(state: any, payload: LaunchObject) { const { no_checks = false, launch_args = undefined } = payload; if (no_checks) { - await invoke("launch_northstar", {gameInstall: state.game_install, bypassChecks: no_checks, launchParameters: launch_args}) + await invoke("launch_northstar", { gameInstall: state.game_install, bypassChecks: no_checks, launchParameters: launch_args }) .then((message) => { console.log("Launched with bypassed checks"); console.log(message); @@ -232,6 +232,7 @@ export const store = createStore({ }, async launchGameSteam(state: any, payload: LaunchObject) { const { no_checks = false, launch_args = undefined } = payload; + await invoke("launch_northstar_steam", { gameInstall: state.game_install, bypassChecks: no_checks, launchParametres: launch_args }) .then((message) => { showNotification('Success'); From df5978f8bdd1ba6575e6062bc6721b30e7010e79 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Thu, 3 Aug 2023 14:00:51 +0200 Subject: [PATCH 7/8] fix: Resolve compilation issue due to wrong types --- src-tauri/src/northstar/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src-tauri/src/northstar/mod.rs b/src-tauri/src/northstar/mod.rs index 18a707b05..f76d105d0 100644 --- a/src-tauri/src/northstar/mod.rs +++ b/src-tauri/src/northstar/mod.rs @@ -119,10 +119,9 @@ pub fn launch_northstar( // We cannot add the params directly because of limitations with cmd.exe // https://stackoverflow.com/questions/9964865/c-system-not-working-when-there-are-spaces-in-two-different-parameters/9965141#9965141 - let launch_parameters = launch_parameters.unwrap_or_default(); + let launch_parameters = format!("{} {}", ns_profile_arg, launch_parameters.unwrap_or_default()); let ns_params: Vec<&str> = launch_parameters.split_whitespace().collect(); dbg!(ns_params.clone()); - args.extend(vec![ns_profile_arg]); args.extend(ns_params); let _output = std::process::Command::new("C:\\Windows\\System32\\cmd.exe") .args(args) From 869300c848429d18734fd0d02f4c277f21357568 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Thu, 3 Aug 2023 14:24:47 +0200 Subject: [PATCH 8/8] style: Autoformat --- src-tauri/src/northstar/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/northstar/mod.rs b/src-tauri/src/northstar/mod.rs index f76d105d0..e79123fd7 100644 --- a/src-tauri/src/northstar/mod.rs +++ b/src-tauri/src/northstar/mod.rs @@ -119,7 +119,11 @@ pub fn launch_northstar( // We cannot add the params directly because of limitations with cmd.exe // https://stackoverflow.com/questions/9964865/c-system-not-working-when-there-are-spaces-in-two-different-parameters/9965141#9965141 - let launch_parameters = format!("{} {}", ns_profile_arg, launch_parameters.unwrap_or_default()); + let launch_parameters = format!( + "{} {}", + ns_profile_arg, + launch_parameters.unwrap_or_default() + ); let ns_params: Vec<&str> = launch_parameters.split_whitespace().collect(); dbg!(ns_params.clone()); args.extend(ns_params);