andymatuschak/Sparkle — Issue #157: Delayed relaunch not working
Author: BloodDragon
Created: 2012-02-24 16:31:11+00:00
State: open

There is a bug in the `installWithToolAndRelaunch:` method of SUBasicUpdateDriver.m which prevents the application from restarting after the delegate has indicated that the relaunch should wait by returning `YES` to the `updater:shouldPostponeRelaunchForUpdate:untilInvoking:` method.

The install method creates an `NSInvocation` instance and sets the parameter for relaunch as follows:

[invocation setArgument:&relaunch atIndex:0];

The first two indices, 0 and 1 are reserved however (as can be read in Apple's documentation), so the index should be 2.

[invocation setArgument:&relaunch atIndex:2];

Simple change, but otherwise the app simply will not relaunch, as the Boolean value will become `NO`.