.pkg installations should support asynchronous installation

Bug #402074 reported by Andy Matuschak
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sparkle
Fix Committed
Low
Unassigned

Bug Description

Right now, they're synchronous only. Original user question:

"It takes about 1-2 minutes to finish installing the .pkg update to my application, and I'd like to allow the user to continue using it during the update. Right now, when the user clicks 'Install and Restart', the application "freezes" while the installer does its thing. After Installer.app exits, the user gets a quit confirmation dialog (from my app, not Sparkle). This seems to be by design since the app is waiting for the exit:

                          6209 -[NSApplication sendEvent:]
                            6209 -[NSWindow sendEvent:]
                              6209 -[NSControl mouseDown:]
                                6209 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:]
                                  6209 -[NSCell trackMouse:inRect:ofView:untilMouseUp:]
                                    6209 -[NSControl sendAction:to:]
                                      6209 -[NSApplication sendAction:to:from:]
                                        6209 load_dsa_key
                                          6209 load_dsa_key
                                            6209 -[NSConcreteTask waitUntilExit]
                                              6209 CFRunLoopRunSpecific
                                                6209 mach_msg
                                                  6209 mach_msg_trap
                                                    6209 mach_msg_trap

Is there a switch to make this async, or should I file a bug report about that?

Thanks."

Changed in sparkle:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Hofman (cmhofman) wrote :

This is relatively easy to fix, following the procedure of SUPlainInstaller. Attached a patch to fix this problem.

Better solution would be to make the SUInstaller an instance and run the NSTask async, so you don't need to pass along the info all the time. However that requires more changes.

Revision history for this message
Jeremy Sequoia (jeremyhu) wrote :

That patch doesn't seem to work (atleast not when applied with some fuzz to 1.5b6). Clicking the 'Install and Relaunch' button caused an *immediate* shutdown of the application rather than waiting for the installer to finish.

Program received signal SIGTERM, Terminated.
0x93ecdc08 in __semwait_signal ()
(gdb) bt
#0 0x93ecdc08 in __semwait_signal ()
#1 0x93ecda20 in nanosleep$UNIX2003 ()
#2 0x93f36b50 in sleep$UNIX2003 ()
#3 0x0000d768 in -[X11Controller applicationWillTerminate:] (self=<value temporarily unavailable, due to optimizations>, _cmd=<value temporarily unavailable, due to optimizations>, aNotification=<value temporarily unavailable, due to optimizations>) at X11Controller.m:781
#4 0x91448688 in _nsnote_callback ()
#5 0x93da343c in _CFXNotificationPostNotification ()
#6 0x91445dc4 in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
#7 0x919210f4 in -[NSApplication terminate:] ()
#8 0x914496e8 in __NSThreadPerformPerform ()
#9 0x93dc10d4 in CFRunLoopRunSpecific ()
#10 0x900cdb18 in RunCurrentEventLoopInMode ()
#11 0x900cd93c in ReceiveNextEventCommon ()
#12 0x900cd77c in BlockUntilNextEventMatchingListInMode ()
#13 0x9179f248 in _DPSNextEvent ()
#14 0x9179ec00 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#15 0x917988a0 in -[NSApplication run] ()
#16 0x0000a22c in X11ApplicationMain (argc=6, argv=0xbfffd8a0, envp=<value temporarily unavailable, due to optimizations>) at X11Application.m:978
#17 0x00015a60 in server_main (argc=6, argv=0xbfffd8a0, envp=0xbfffd850) at quartzStartup.c:129
#18 0x00003628 in do_start_x11_server (port=<value temporarily unavailable, due to optimizations>, argv=0x4d45e0, argvCnt=6, envp=0x4e11d0, envpCnt=15) at bundle-main.c:348
#19 0x00004368 in _Xstart_x11_server (InHeadP=0x4d1000, OutHeadP=0x4d0000) at mach_startupServer.c:423
#20 0x0000425c in mach_startup_server (InHeadP=<value temporarily unavailable, due to optimizations>, OutHeadP=<value temporarily unavailable, due to optimizations>) at mach_startupServer.c:632
#21 0x93f4fe90 in mach_msg_server ()
#22 0x00003f94 in main (argc=1, argv=0xbfffdf38, envp=0xbfffdf40) at bundle-main.c:560
(gdb)

Revision history for this message
Hofman (cmhofman) wrote :

Sorry, I seem to have switched the args for 10.4 and 10.5, here's the corrected patch. Note that this is based on the current source, not on 1.5b6.

Revision history for this message
Jeremy Sequoia (jeremyhu) wrote :

The updated patch works very well for me, thanks.

Revision history for this message
Jeremy Sequoia (jeremyhu) wrote :

Can this please get pushed into git? It "just works"

Revision history for this message
Andy Matuschak (andymatuschak) wrote :

Oh, okay. Fixed in 0e99d4f.

Changed in sparkle:
status: Confirmed → Fix Committed
milestone: none → 1.5
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.