diff --git a/src/egs/manifest_item.rs b/src/egs/manifest_item.rs index c8ecd72..7583f72 100644 --- a/src/egs/manifest_item.rs +++ b/src/egs/manifest_item.rs @@ -1,3 +1,5 @@ +use std::path::Path; + use serde::{Deserialize, Serialize}; use steam_shortcuts_util::{Shortcut, shortcut::ShortcutOwned}; @@ -17,14 +19,18 @@ pub(crate) struct ManifestItem { #[serde(alias = "AppName")] pub app_name: String, + + #[serde(alias = "LaunchCommand")] + pub launch_command: String, } + + impl From for ShortcutOwned { fn from(manifest: ManifestItem) -> Self { - let exe = format!( - "\"{}\\{}\"", - manifest.install_location, manifest.launch_executable - ); + + let exe_path = Path::new(&manifest.install_location).join(manifest.launch_executable).to_string_lossy().to_string(); + let exe = format!("\"{}\"",exe_path); let mut start_dir = manifest.install_location.clone(); if !manifest.install_location.starts_with('"') { start_dir = format!("\"{}\"", manifest.install_location); @@ -36,7 +42,7 @@ impl From for ShortcutOwned { start_dir.as_str(), "", "", - "", + manifest.launch_command.as_str(), ); let mut owned_shortcut = shortcut.to_owned(); owned_shortcut.tags.push("EGS".to_owned());