diff --git a/src/games/genshin/game.rs b/src/games/genshin/game.rs index 2bf254d..a2d57f6 100644 --- a/src/games/genshin/game.rs +++ b/src/games/genshin/game.rs @@ -171,6 +171,13 @@ pub fn run() -> anyhow::Result<()> { bash_command = format!("{gamescope} -- {bash_command}"); } + // Bundle all windows arguments used to run the game into a single file + if features.compact_launch { + std::fs::write(folders.game.join("compact_launch.bat"), format!("start {windows_command}\nexit"))?; + + windows_command = String::from("compact_launch.bat"); + } + // bwrap -- #[cfg(feature = "sandbox")] if config.sandbox.enabled { @@ -197,13 +204,6 @@ pub fn run() -> anyhow::Result<()> { folders = sandboxed_folders; } - // Bundle all windows arguments used to run the game into a single file - if features.compact_launch { - std::fs::write(folders.game.join("compact_launch.bat"), format!("start {windows_command}\nexit"))?; - - windows_command = String::from("compact_launch.bat"); - } - // Finalize launching command bash_command = match &config.game.command { // Use user-given launch command diff --git a/src/games/honkai/game.rs b/src/games/honkai/game.rs index afc1dd5..dcc204a 100644 --- a/src/games/honkai/game.rs +++ b/src/games/honkai/game.rs @@ -107,6 +107,13 @@ pub fn run() -> anyhow::Result<()> { bash_command = format!("{gamescope} -- {bash_command}"); } + // Bundle all windows arguments used to run the game into a single file + if features.compact_launch { + std::fs::write(folders.game.join("compact_launch.bat"), format!("start {windows_command}\nexit"))?; + + windows_command = String::from("compact_launch.bat"); + } + // bwrap -- #[cfg(feature = "sandbox")] if config.sandbox.enabled { @@ -133,13 +140,6 @@ pub fn run() -> anyhow::Result<()> { folders = sandboxed_folders; } - // Bundle all windows arguments used to run the game into a single file - if features.compact_launch { - std::fs::write(folders.game.join("compact_launch.bat"), format!("start {windows_command}\nexit"))?; - - windows_command = String::from("compact_launch.bat"); - } - // Finalize launching command bash_command = match &config.game.command { // Use user-given launch command diff --git a/src/games/star_rail/game.rs b/src/games/star_rail/game.rs index 8abe17e..97f3239 100644 --- a/src/games/star_rail/game.rs +++ b/src/games/star_rail/game.rs @@ -108,6 +108,13 @@ pub fn run() -> anyhow::Result<()> { bash_command = format!("{gamescope} -- {bash_command}"); } + // Bundle all windows arguments used to run the game into a single file + if features.compact_launch { + std::fs::write(folders.game.join("compact_launch.bat"), format!("start {windows_command}\nexit"))?; + + windows_command = String::from("compact_launch.bat"); + } + // bwrap -- #[cfg(feature = "sandbox")] if config.sandbox.enabled { @@ -134,13 +141,6 @@ pub fn run() -> anyhow::Result<()> { folders = sandboxed_folders; } - // Bundle all windows arguments used to run the game into a single file - if features.compact_launch { - std::fs::write(folders.game.join("compact_launch.bat"), format!("start {windows_command}\nexit"))?; - - windows_command = String::from("compact_launch.bat"); - } - // Finalize launching command bash_command = match &config.game.command { // Use user-given launch command