Skip to content

Commit

Permalink
Remove alias creation
Browse files Browse the repository at this point in the history
Now handled by PKG
  • Loading branch information
khronokernel committed May 27, 2024
1 parent e3eb90b commit acbeef0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
7 changes: 0 additions & 7 deletions opencore_legacy_patcher/sys_patch/sys_patch_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,6 @@ def install_auto_patcher_launch_agent(self, kdk_caching_needed: bool = False):

subprocess.run(["/usr/bin/xattr", "-cr", "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)

# Making app alias
# Simply an easy way for users to notice the app
# If there's already an alias or exiting app, skip
if not Path("/Applications/OpenCore-Patcher.app").exists():
logging.info("- Making app alias")
subprocess_wrapper.run_as_root_and_verify(["/bin/ln", "-s", "/Library/Application Support/Dortania/OpenCore-Patcher.app", "/Applications/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)


def _create_rsr_monitor_daemon(self) -> bool:
# Get kext list in /Library/Extensions that have the 'GPUCompanionBundles' property
Expand Down
30 changes: 0 additions & 30 deletions opencore_legacy_patcher/wx_gui/gui_main_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,6 @@ def _preflight_checks(self):
self.on_build_and_install()
return

self._fix_local_install()

if "--update_installed" in sys.argv and self.constants.has_checked_updates is False and gui_support.CheckProperties(self.constants).host_can_build():
# Notify user that the update has been installed
self.constants.has_checked_updates = True
Expand Down Expand Up @@ -251,34 +249,6 @@ def _preflight_checks(self):
threading.Thread(target=self._check_for_updates).start()


def _fix_local_install(self) -> None:
"""
Work-around users manually copying the app to /Applications
We'll delete the app, and create a proper symlink
Note: This *shouldn't* be needed with installs after 0.6.7, but it's a good catch-all
"""

if "--update_installed" not in sys.argv:
return
if self.constants.has_checked_updates is True:
return

# Check if app exists in /Applications, and is not a symlink
if Path("/Applications/OpenCore-Patcher.app").exists() and Path("/Applications/OpenCore-Patcher.app").is_symlink() is False:
logging.info("Found user-installed app in /Applications, replacing with symlink")
# Delete app
result = subprocess.run(["/bin/rm", "-rf", "/Applications/OpenCore-Patcher.app"], capture_output=True)
if result.returncode != 0:
logging.info("Failed to delete app from /Applications")
return

# Create symlink
result = subprocess.run(["/bin/ln", "-s", "/Library/Application Support/Dortania/OpenCore-Patcher.app", "/Applications/OpenCore-Patcher.app"], capture_output=True)
if result.returncode != 0:
logging.info("Failed to create symlink to /Applications")
return


def _check_for_updates(self):
if self.constants.has_checked_updates is True:
return
Expand Down

0 comments on commit acbeef0

Please sign in to comment.