A native webfishing installer for macos

Compare changes

Choose any two refs to compare.

Changed files
+53 -15
src
+12 -1
README.md
··· 25 25 - renaming `steam_id_remote` dictionnary key to `remote_steam_id` to fix network spam detection that resulted in timeouts 26 26 - prevent the game from crashing when saving the options by not setting any values to `OS.windowed_borderless` because setting a value to it crashes the game somehow 27 27 28 + 29 + ## How to install a mod? 30 + 31 + When running the software for the first time and building webfishing, you'll notice that a `mods` folder has appeared in the folder where the installer is. 32 + 33 + In order to install a mod, just copy a mod folder in it, a mod folder has a `manifest.json` file in it. 34 + 35 + After that, run the installer again ! It will tell you in the terminal if the mod is installed or if something went wrong. 36 + 37 + Here's a small mod list : [link to the mod list](modlist.md) 38 + 28 39 ## How to make a mod? 29 40 30 41 As you can see in the `example_mods` folder, a mod has typically two folders and a single `manifest.json` file having the following structure: 31 - ```json 42 + ```jsonc 32 43 { 33 44 "name": "Ship Mod", // Mod name 34 45 "author": "Estym", // Author
+7
modlist.md
··· 1 + # List of currently existing mods compatible with the webfishing-macos-installer 2 + 3 + ## AtProto Webfishing 4 + [Repository](https://forgejo.regnault.dev/estym/webfishing-macos-atproto) 5 + 6 + A mod that adds remote saving using a Bluesky account (or a self-hosted PDS) 7 +
+34 -14
src/main.rs
··· 9 9 use std::fs::File; 10 10 use std::io::{Read, Write}; 11 11 use std::path::Path; 12 - use std::process::Command; 12 + use std::process::{exit, Command}; 13 13 use std::time::Duration; 14 14 use steamlocate::SteamDir; 15 15 use sudo::RunningAs; ··· 59 59 async fn download_godot_steam_template() { 60 60 println!("Downloading GodotSteam template..."); 61 61 let res = reqwest::get( 62 - "https://github.com/GodotSteam/GodotSteam/releases/download/v3.24/macos-g353-s159-gs324.zip", 62 + "https://codeberg.org/godotsteam/godotsteam/releases/download/v3.24/macos-g353-s159-gs324.zip", 63 63 ) 64 64 .await 65 65 .expect("Could not download godotsteam template"); ··· 89 89 90 90 fn build_webfishing_macos(webfishing_path: &Path) { 91 91 let template_path = Path::new("build/osx_template.app"); 92 + 92 93 Command::new("rm") 93 94 .current_dir(template_path) 94 95 .arg("Contents/MacOS/godot_osx_debug.universal") ··· 137 138 .expect("Could not copy webfishing.app"); 138 139 } 139 140 141 + fn sign_webfishing() { 142 + Command::new("xattr") 143 + .arg("-cr") 144 + .arg("build/webfishing.app") 145 + .output() 146 + .expect("Could not execute xattr"); 147 + 148 + Command::new("rm") 149 + .arg("build/signing-step") 150 + .output() 151 + .expect("Could not remove signing-step file"); 152 + 153 + println!("Webfishing is in the build folder !"); 154 + 155 + Text::new("Press Enter to quit") 156 + .prompt() 157 + .expect("Could not confirm to quit"); 158 + 159 + 160 + } 161 + 140 162 #[tokio::main] 141 163 async fn main() { 142 - if sudo::check() != RunningAs::Root { 143 - println!("You need to be root to run this program"); 164 + if sudo::check() == RunningAs::Root && Path::new("build/signing-step").exists() { 165 + sign_webfishing(); 166 + exit(0); 144 167 } 145 - sudo::escalate_if_needed().expect("Could not escalate"); 146 168 147 169 set_current_dir( 148 170 current_exe() ··· 223 245 .write(bytes) 224 246 .expect("Could not write to webfishing.pck"); 225 247 226 - Command::new("xattr") 227 - .arg("-cr") 228 - .arg("build/webfishing.app") 229 - .output() 230 - .expect("Could not execute xattr"); 248 + File::create("build/signing-step").expect("Could not create signing step file"); 231 249 232 - println!("Webfishing is in the build folder !"); 250 + if sudo::check() != RunningAs::Root { 251 + println!("In order to sign the app, you need to be root"); 252 + sudo::escalate_if_needed().expect("Could not escalate"); 253 + exit(1); 254 + } 233 255 234 - Text::new("Press Enter to quit") 235 - .prompt() 236 - .expect("Could not confirm to quit"); 256 + sign_webfishing(); 237 257 }