@@ -353,6 +353,7 @@ def _patch_root_vol(self):
353353 InstallAutomaticPatchingServices (self .constants ).install_auto_patcher_launch_agent (kdk_caching_needed = needs_daemon )
354354
355355 self ._rebuild_root_volume ()
356+ self .load_launchpad ()
356357
357358
358359 def _execute_patchset (self , required_patches : dict ):
@@ -471,7 +472,6 @@ def _resolve_metallib_support_pkg(self) -> str:
471472 # After install, check if it's present
472473 return self ._resolve_metallib_support_pkg ()
473474
474-
475475 @cache
476476 def _resolve_dynamic_patchset (self , variant : DynamicPatchset ) -> str :
477477 """
@@ -557,14 +557,7 @@ def start_patch(self):
557557 if self .patch_set_dictionary == {}:
558558 logging .info ("- No Root Patches required for your machine!" )
559559 return
560- if self .constants .change_launchpad is True :
561- logging .info ("- LaunchPad patching enabled, run command......" )
562- subprocess .run ("mkdir -p /Library/Preferences/FeatureFlags/Domain" ,capture_output = True ,text = True ,shell = True )
563- subprocess .run ("defaults write /Library/Preferences/FeatureFlags/Domain/SpotlightUI.plist SpotlightPlus -dict Enabled -bool false" ,capture_output = True ,text = True ,shell = True )
564- else :
565- logging .info ("- LaunchPad patching disabled,skip......" )
566- subprocess .run ("mkdir -p /Library/Preferences/FeatureFlags/Domain" ,capture_output = True ,text = True ,shell = True )
567- subprocess .run ("defaults write /Library/Preferences/FeatureFlags/Domain/SpotlightUI.plist SpotlightPlus -dict Enabled -bool true" ,capture_output = True ,text = True ,shell = True )
560+
568561 logging .info ("- Verifying whether Root Patching possible" )
569562 if patchset_obj .can_patch is False :
570563 logging .error ("- Cannot continue with patching!!!" )
@@ -588,7 +581,15 @@ def start_patch(self):
588581
589582 self ._patch_root_vol ()
590583
591-
584+ def load_launchpad (self ):
585+ if self .constants .change_launchpad is True :
586+ logging .info ("- LaunchPad patching enabled, run command......" )
587+ subprocess .run ("mkdir -p /Library/Preferences/FeatureFlags/Domain" ,capture_output = True ,text = True ,shell = True )
588+ subprocess .run ("defaults write /Library/Preferences/FeatureFlags/Domain/SpotlightUI.plist SpotlightPlus -dict Enabled -bool false" ,capture_output = True ,text = True ,shell = True )
589+ else :
590+ logging .info ("- LaunchPad patching disabled,skip......" )
591+ subprocess .run ("mkdir -p /Library/Preferences/FeatureFlags/Domain" ,capture_output = True ,text = True ,shell = True )
592+ subprocess .run ("defaults write /Library/Preferences/FeatureFlags/Domain/SpotlightUI.plist SpotlightPlus -dict Enabled -bool true" ,capture_output = True ,text = True ,shell = True )
592593 def start_unpatch (self ) -> None :
593594 """
594595 Entry function for unpatching the root volume
0 commit comments