Re: Installer failing in 10.7
Re: Installer failing in 10.7
- Subject: Re: Installer failing in 10.7
- From: Jens Alfke <email@hidden>
- Date: Wed, 18 Jan 2012 12:51:00 -0800
On Jan 17, 2012, at 11:32 PM, Rakesh Singhal wrote: I have an app and a daemon which are installed on system using my installer. In postinstall script, it runs command "open /Applications/MyApp.app" and it works. If this app is already installed and I install new version, it upgrades smoothly. The daemon (client) is keep polling on server for an updated version. If it finds then it downloads the dmg file, mounts it and spawns a new process to run the installer.
Chrome does something similar; you could look at their source if you really want to figure it out (but be warned: it’s rather complex. I’ve worked with that code a little bit and never want to again!) In preupgrade script, it kills both processes and remove plist of daemon.
Wait; the updater running in the background kills the app? Isn’t that going to cause trouble for the user? :-o
Of course, if the updater doesn’t kill the app, you’ll run into different problems. Like the next time the app needs to load a resource file, and in the new version the file is either gone or incompatibly changed. (If this happens with a .nib, it could easily crash the app.) Chrome avoids this by putting its upgradeable code in a framework bundled inside the app, and versions the name of the framework so that a new version doesn’t replace the old one. At launch time it loads the latest version of the framework and deletes older ones.
It works properly with 10.5 and 10.6 but gives error on 10.7. The error is "./postinstall: LSOpenURLsWithRole() failed with error -10810 for the file /Applications/MyApp.app”. You haven’t talked about the post-install script, or why you need to launch the app. Are you just launching it because you killed it in the pre-install, hoping that the user won’t notice the app vanished and then reappeared (with all unsaved changes lost)? If this happened to me I think I’d notice.
—Jens |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden