-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install package dependencies when installing BizHawk on Linux #30
Comments
I'm guessing it's on this line?
If you don't mind only supporting the Gnome desktop, this behavior can be achieved using two bash scripts that would be run by a std::process::Command. use std::process::Command;
fn main() {
let output = Command::new("bash")
.arg("./install.sh")
.output()
.expect("failed to execute bash installation script");
print!("stdout: {}", String::from_utf8_lossy(&output.stdout));
print!("stderr: {}", String::from_utf8_lossy(&output.stderr));
} install.sh #!/bin/bash
set -e # Exit the script if a command fails
# Returns the path to the script's directory, no matter from where it was run
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
# Sets the script to execute when asking for sudo
export SUDO_ASKPASS="$SCRIPT_DIR/password_prompt.sh"
# The -A makes sudo use the script in SUDO_ASKPASS to prompt the user for the password
sudo -A apt update -y password_prompt.sh #!/bin/bash
set -e # Exit the script if a command fails
# We can customize the title and message
zenity --password --title="Installing dependencies" If you want I can implement this in the installation script. |
This looks promising, thank you! I'm going to go ahead and implement this. Some quick notes from testing:
|
I think you should also check for the existence of zenity and print instructions if it doesn't. It exists on gnome versions of ubuntu, but could be missing in other distros and flavors. For example with something like this maybe: if command -v zenity &> /dev/null
then
echo "Zenity exists"
else
echo "Zenity does not exist"
fi |
Automatic installation of |
The Linux version of BizHawk requires the
mono-complete
APT package. We should install it as part of the multiworld installer. The question is: what's the best way to do this from a GUI? Does Ubuntu'ssoftware-center
have a CLI for specifying packages to install? Is there a graphical version ofsudo
that can be used?The text was updated successfully, but these errors were encountered: