mirror of
https://github.com/outbackdingo/OpCore-Simplify.git
synced 2026-01-27 10:19:49 +00:00
Add GUI Support for OpCore Simplify (#512)
* Refactor OpCore-Simplify to GUI version * New ConfigEditor * Add requirement checks and installation in launchers * Add GitHub Actions workflow to generate manifest.json * Set compression level for asset * Skip .git and __pycache__ folders * Refactor update process to include integrity checker * Add SMBIOS model selection * Update README.md * Update to main branch
This commit is contained in:
@@ -283,6 +283,42 @@ prompt_and_download() {
|
||||
done
|
||||
}
|
||||
|
||||
check_and_install_requirements() {
|
||||
local python="$1"
|
||||
local requirements_file="$dir/requirements.txt"
|
||||
|
||||
# Check if requirements.txt exists
|
||||
if [ ! -f "$requirements_file" ]; then
|
||||
echo "Warning: requirements.txt not found. Skipping dependency check."
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Check if pip is available
|
||||
if ! "$python" -m pip --version > /dev/null 2>&1; then
|
||||
echo "Warning: pip is not available. Attempting to install pip..."
|
||||
if ! "$python" -m ensurepip --upgrade > /dev/null 2>&1; then
|
||||
echo "Error: Could not install pip. Please install pip manually."
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if requirements are installed by trying to import key packages
|
||||
echo "Checking Python dependencies..."
|
||||
if ! "$python" -c "import PyQt6; import qfluentwidgets" > /dev/null 2>&1; then
|
||||
echo "Installing required packages from requirements.txt..."
|
||||
if ! "$python" -m pip install --upgrade -r "$requirements_file"; then
|
||||
echo "Error: Failed to install requirements. Please install them manually:"
|
||||
echo " $python -m pip install -r $requirements_file"
|
||||
return 1
|
||||
fi
|
||||
echo "Requirements installed successfully."
|
||||
else
|
||||
echo "All requirements are already installed."
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
main() {
|
||||
local python= version=
|
||||
# Verify our target exists
|
||||
@@ -310,6 +346,11 @@ main() {
|
||||
prompt_and_download
|
||||
return 1
|
||||
fi
|
||||
# Check and install requirements before running the script
|
||||
if ! check_and_install_requirements "$python"; then
|
||||
echo "Failed to install requirements. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
# Found it - start our script and pass all args
|
||||
"$python" "$dir/$target" "${args[@]}"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user