diff --git a/public/img/properties.png b/public/img/properties.png new file mode 100644 index 0000000..86cb811 Binary files /dev/null and b/public/img/properties.png differ diff --git a/src-tauri/src/commands/install/install_mod.rs b/src-tauri/src/commands/install/install_mod.rs index beef74f..cf4c6ef 100644 --- a/src-tauri/src/commands/install/install_mod.rs +++ b/src-tauri/src/commands/install/install_mod.rs @@ -28,15 +28,6 @@ pub async fn install_wbm_mod(game_path: &str) -> Result<(), InstallErr> { Ok(zip_path) => { let wbm_path = std::path::Path::new(game_path).join("BepInEx/plugins/WBM"); - println!("Removing existing files"); - match std::fs::remove_dir_all(wbm_path.clone()) { - Ok(_) => {} - Err(_) => { - println!("Failed to remove existing WBM mod files"); - return Err(InstallErr::WBMRemoveFailed); - } - }; - println!("Creating WBM directory"); match std::fs::create_dir_all(wbm_path.clone()) { Ok(_) => {} diff --git a/src-tauri/src/commands/install/launch_options.rs b/src-tauri/src/commands/install/launch_options.rs index c30e320..ce9530e 100644 --- a/src-tauri/src/commands/install/launch_options.rs +++ b/src-tauri/src/commands/install/launch_options.rs @@ -19,6 +19,10 @@ pub async fn unix_launch_option_setup() -> Result<(), InstallErr> { } }; + // todo: make run_bepinex.sh executable + + // todo: send launch option string to frontend + if is_already_set() { println!("Steam launch option is already set. Skipping."); return Ok(()); @@ -52,7 +56,7 @@ fn is_already_set() -> bool { // todo: improve logic // 1. find line only containing "750470" // 2. find next closest line only containing "}" - // 3. check if section contains "./run_bepinex.sh %command%" + // 3. check if section contains "run_bepinex.sh" // run_bepinex.sh // %command% diff --git a/src-tauri/src/commands/install/mod.rs b/src-tauri/src/commands/install/mod.rs index ab109d3..9df04e3 100644 --- a/src-tauri/src/commands/install/mod.rs +++ b/src-tauri/src/commands/install/mod.rs @@ -53,10 +53,6 @@ pub async fn install(game_path: String) -> Result<(), InstallErr> { default_game_path } else { - if !util::is_game_path_valid(&game_path) { - return Err(InstallErr::GamePathNotValid); - } - game_path }; let game_path = game_path.as_str(); diff --git a/src-tauri/src/commands/install/types.rs b/src-tauri/src/commands/install/types.rs index 3b3a035..c44f853 100644 --- a/src-tauri/src/commands/install/types.rs +++ b/src-tauri/src/commands/install/types.rs @@ -4,12 +4,10 @@ pub enum InstallErr { UnsupportedOS, FailedToGetGamePath, - GamePathNotValid, RemoveOldFilesFailed, BepInExDownloadFailed, BepInExUnzipFailed, WBMDownloadFailed, - WBMRemoveFailed, WBMDirectoryCreationFailed, WBMUnzipFailed, LaunchOptionNotSet, diff --git a/src/pages/Home/ActionButtons.svelte b/src/pages/Home/ActionButtons.svelte index 2289818..fca0028 100644 --- a/src/pages/Home/ActionButtons.svelte +++ b/src/pages/Home/ActionButtons.svelte @@ -10,7 +10,7 @@
-
Install
+
Install / Update
@@ -26,7 +26,7 @@ @apply w-full flex justify-evenly; a { - @apply p-4 w-24 h-24 text-center rounded-xl bg-red-500 text-white font-normal; + @apply p-3 w-24 h-24 text-center rounded-xl bg-red-500 text-white font-normal; .icon { @apply w-full h-6 mb-2; diff --git a/src/pages/Operation/Install.svelte b/src/pages/Operation/Install.svelte index 923dd6d..f47c76a 100644 --- a/src/pages/Operation/Install.svelte +++ b/src/pages/Operation/Install.svelte @@ -1,5 +1,72 @@ +
+ {#if lastInstallErr == InstallErr.UnsupportedOS} + Operating System not supported. +
+ WBM Installer is only available in Windows, Mac, and Linux. + {:else if lastInstallErr == InstallErr.FailedToGetGamePath} + Failed to find game folder. + +
+
+ + + {:else if lastInstallErr == InstallErr.RemoveOldFilesFailed} + Failed to remove old files :( + {:else if lastInstallErr == InstallErr.BepInExDownloadFailed} + Failed to download BepInEx :( + {:else if lastInstallErr == InstallErr.BepInExUnzipFailed} + Failed to unzip BepInEx :( + {:else if lastInstallErr == InstallErr.WBMDownloadFailed} + Failed to download WBM :( + {:else if lastInstallErr == InstallErr.WBMDirectoryCreationFailed} + Failed to create WMB folder :( + {:else if lastInstallErr == InstallErr.WBMUnzipFailed} + Failed to unzip WBM :( + {:else if lastInstallErr == InstallErr.LaunchOptionNotSet} + + Copy and paste the following text to ... + + where to find property settings + + + {/if} +
+ + diff --git a/src/pages/Operation/index.svelte b/src/pages/Operation/index.svelte index fca91ec..ccfcfc9 100644 --- a/src/pages/Operation/index.svelte +++ b/src/pages/Operation/index.svelte @@ -52,9 +52,13 @@ {#if !wasButtonClicked} {#if operationType == OperationType.Install} - + +
+ Install the latest WBM. {:else} +
+ Remove WBM from your computer. {/if} {:else} diff --git a/src/pages/Operation/types.ts b/src/pages/Operation/types.ts index 3f4eae0..7f96f8b 100644 --- a/src/pages/Operation/types.ts +++ b/src/pages/Operation/types.ts @@ -4,12 +4,10 @@ export enum InstallErr { UnsupportedOS, FailedToGetGamePath, - GamePathNotValid, RemoveOldFilesFailed, BepInExDownloadFailed, BepInExUnzipFailed, WBMDownloadFailed, - WBMRemoveFailed, WBMDirectoryCreationFailed, WBMUnzipFailed, LaunchOptionNotSet,