mirror of
https://github.com/munki/munki.git
synced 2026-04-20 11:40:38 -05:00
Speed launch of MSU.app status mode to cover the login window following logout install actions.
This commit is contained in:
@@ -64,6 +64,9 @@ class MSUAppDelegate(NSObject):
|
||||
self.runmode = runmode
|
||||
NSLog("Runmode: %s" % runmode)
|
||||
|
||||
# Clear our fast-launch trigger file if present.
|
||||
munki.clearLaunchTrigger()
|
||||
|
||||
# Prevent automatic relaunching at login on Lion
|
||||
if NSApp.respondsToSelector_('disableRelaunchOnLogin'):
|
||||
NSApp.disableRelaunchOnLogin()
|
||||
|
||||
@@ -35,6 +35,7 @@ from Foundation import CFPreferencesAppSynchronize
|
||||
|
||||
|
||||
INSTALLATLOGOUTFILE = "/private/tmp/com.googlecode.munki.installatlogout"
|
||||
STATUSATLOGOUTFILE = "/private/tmp/com.googlecode.munki.statusatlogout"
|
||||
UPDATECHECKLAUNCHFILE = \
|
||||
"/private/tmp/.com.googlecode.munki.updatecheck.launchd"
|
||||
MSULOGDIR = \
|
||||
@@ -350,11 +351,25 @@ def logoutAndUpdate():
|
||||
if not os.path.exists(INSTALLATLOGOUTFILE):
|
||||
f = open(INSTALLATLOGOUTFILE, 'w')
|
||||
f.close()
|
||||
if not os.path.exists(STATUSATLOGOUTFILE):
|
||||
f = open(STATUSATLOGOUTFILE, 'w')
|
||||
f.close()
|
||||
logoutNow()
|
||||
except (OSError, IOError):
|
||||
return 1
|
||||
|
||||
|
||||
def clearLaunchTrigger():
|
||||
'''Clear the trigger file that fast-launches us at loginwindow.
|
||||
typically because we have been launched in statusmode at the
|
||||
loginwindow to perform a logout-install.'''
|
||||
try:
|
||||
if os.path.exists(STATUSATLOGOUTFILE):
|
||||
os.unlink(STATUSATLOGOUTFILE)
|
||||
except (OSError, IOError):
|
||||
return 1
|
||||
|
||||
|
||||
def justUpdate():
|
||||
'''Trigger managedinstaller via launchd KeepAlive path trigger
|
||||
We touch a file that launchd is is watching
|
||||
|
||||
@@ -102,6 +102,9 @@ def alertUserOfForcedLogout(info=None):
|
||||
# make sure flag is in place to cause munki to install at logout
|
||||
f = open('/private/tmp/com.googlecode.munki.installatlogout', 'w')
|
||||
f.close()
|
||||
# drop flag for speedier launch of status window covering loginwindow
|
||||
f = open('/private/tmp/com.googlecode.munki.statusatlogout', 'w')
|
||||
f.close()
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user