From 28b7ad91336b1eb95983d46f8112db1fd38b42f8 Mon Sep 17 00:00:00 2001 From: F1248 Date: Fri, 23 Aug 2024 21:12:55 +0200 Subject: [PATCH 1/5] Install Genius to ~/Applications in recoveryOS --- install.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index 0e41528..591b59c 100644 --- a/install.sh +++ b/install.sh @@ -2,15 +2,11 @@ /bin/echo " Preparing..." -if [ -e /usr/bin/recoverydiagnose ]; then - cd ~ +if [ -w /Applications ]; then + cd /Applications else - if [ -w /Applications ]; then - cd /Applications - else - /bin/mkdir -p ~/Applications - cd ~/Applications - fi + /bin/mkdir -p ~/Applications + cd ~/Applications fi /bin/echo "Downloading..." From e5b90d8c5b767e22f7b13f0eec77ba2c8e0c78aa Mon Sep 17 00:00:00 2001 From: F1248 Date: Fri, 23 Aug 2024 21:17:01 +0200 Subject: [PATCH 2/5] Fix commit 28b7ad9 "Install Genius to ~/Applications in recoveryOS" --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 591b59c..522f6c7 100644 --- a/install.sh +++ b/install.sh @@ -24,7 +24,7 @@ if [ -e /usr/bin/open ]; then /usr/bin/open Genius.app else /bin/echo " -export PATH=\"$HOME/Genius.app/Contents/MacOS:\$PATH\"" >> ~/.bash_profile +export PATH=\"$(/bin/pwd)/Genius.app/Contents/MacOS:\$PATH\"" >> ~/.bash_profile Genius.app/Contents/MacOS/Genius fi From e920e6f06d3c2f2221d71ddab7dcb0346e171fdd Mon Sep 17 00:00:00 2001 From: F1248 Date: Fri, 23 Aug 2024 21:25:13 +0200 Subject: [PATCH 3/5] Fix indentation --- install.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 522f6c7..bb6c659 100644 --- a/install.sh +++ b/install.sh @@ -3,10 +3,10 @@ /bin/echo " Preparing..." if [ -w /Applications ]; then - cd /Applications + cd /Applications else - /bin/mkdir -p ~/Applications - cd ~/Applications + /bin/mkdir -p ~/Applications + cd ~/Applications fi /bin/echo "Downloading..." @@ -21,11 +21,11 @@ fi /bin/echo "Opening..." if [ -e /usr/bin/open ]; then - /usr/bin/open Genius.app + /usr/bin/open Genius.app else - /bin/echo " + /bin/echo " export PATH=\"$(/bin/pwd)/Genius.app/Contents/MacOS:\$PATH\"" >> ~/.bash_profile - Genius.app/Contents/MacOS/Genius + Genius.app/Contents/MacOS/Genius fi /bin/echo "Done." From c5ae86a1cc91b4b5cab20b8c52a387cb7d12ed4b Mon Sep 17 00:00:00 2001 From: F1248 Date: Fri, 23 Aug 2024 21:27:22 +0200 Subject: [PATCH 4/5] Improve recoveryOS detection in install.sh --- install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index bb6c659..bb5dab0 100644 --- a/install.sh +++ b/install.sh @@ -15,6 +15,10 @@ fi /bin/echo "Installing..." /usr/bin/unzip -q -o Genius.zip /usr/bin/unzip -q -o Genius.zip +if [ ! -e /System/Library/CoreServices/Finder.app ]; then + /bin/echo " +export PATH=\"$(/bin/pwd)/Genius.app/Contents/MacOS:\$PATH\"" >> ~/.bash_profile +fi /bin/echo "Cleaning up..." /bin/rm Genius.zip @@ -23,8 +27,6 @@ fi if [ -e /usr/bin/open ]; then /usr/bin/open Genius.app else - /bin/echo " -export PATH=\"$(/bin/pwd)/Genius.app/Contents/MacOS:\$PATH\"" >> ~/.bash_profile Genius.app/Contents/MacOS/Genius fi From c396316b7da4e0a8d70c534401602e828f3b72b0 Mon Sep 17 00:00:00 2001 From: F1248 Date: Fri, 23 Aug 2024 21:34:58 +0200 Subject: [PATCH 5/5] Improve recoveryOS detection --- Genius/Types/OSBootMode.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Genius/Types/OSBootMode.swift b/Genius/Types/OSBootMode.swift index ba82179..c5bd323 100644 --- a/Genius/Types/OSBootMode.swift +++ b/Genius/Types/OSBootMode.swift @@ -14,7 +14,7 @@ enum OSBootMode { case recovery init?(_ osBootMode: Any?) { - if FileManager.default.fileExists(atPath: "/usr/bin/recoverydiagnose") { + if !FileManager.default.fileExists(atPath: "/System/Library/CoreServices/Finder.app") { self = .recovery } else { let osBootMode: Self? =