andymatuschak/TestMigration — Issue #11: Install on relaunch
Author: andymatuschak
Created: 2011-10-23 16:28:41+00:00
State: open

***Paul Marks (shadowofged)** [reported (on Launchpad)](https://bugs.launchpad.net/sparkle/+bug/534625) on' 2010-03-08:*

I'm running Sparkle 1.5b6 and I've seen a few crashes in my app, often
under -[NSTask launch], because the target executable is missing.

>From the logs, it's clear that my application has been moved by Sparkle,
even though I return YES from
-updater:shouldPostponeRelaunchForUpdate:untilInvoking: when I may still
be launching NSTasks. So the move must happen before I'm asked if
relaunching/installation should be deferred.

The order looks something like this:

* Start NSOperation that launches a few NSTasks.
* Find update; user agrees to install & relaunch.
* New version is installed while NSOperation is still running.
* Things go wonky because resources are temporarily unavailable during the installation.
* Application is then asked if it should postpone relaunching.

However, the damage is already done. A this point, the singleton
-[NSBundle mainBundle] path is incorrect, so all the resources are
whatever shipped with the updated version.