AutoPatcher: Add preinstall script

This commit is contained in:
Mykola Grymalyuk
2022-05-05 17:08:37 -06:00
parent 79ba047d14
commit 61521e2fb1
3 changed files with 16 additions and 0 deletions

View File

@@ -520,6 +520,8 @@
</dict>
<key>PREINSTALL_PATH</key>
<dict>
<key>PATH</key>
<string>/Users/mykolagrymalyuk/Developer/OpenCore-Legacy-Patcher/payloads/InstallPackage/preinstall.sh</string>
<key>PATH_TYPE</key>
<integer>0</integer>
</dict>

View File

@@ -0,0 +1,12 @@
#!/bin/sh
app_path="/Library/Application Support/Dortania/OpenCore-Patcher.app"
launch_agent_path="/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"
if [ -d "$app_path" ]; then
echo "Found OpenCore-Patcher.app, removing..."
rm -rf "$app_path"
fi
if [ -f "$launch_agent_path" ]; then
echo "Found launch agent, removing..."
rm -f "$launch_agent_path"
fi