Re: Locating previous versions
site_archiver@lists.apple.com Delivered-To: installer-dev@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=AldGFCU2k+BfnOSOyBi/MdTw3NGgZ8oEatIKegxz1H8Sp1DY/D/QYfBfNyW0NW09rVt/Bks7WODoTckT7nlHIqX+FRJmBWmkHMH1/HUMaMRZ8lcHiOXJ3BMj89x8JUj0zcbnL1fCsCDoutn3mxNvaL7PLbzlLAfQvAStnmV8H6A= ; --- Mark Krenek <mark@aspyr.com> wrote:
I've gone round and round on this same issue and there is no easy solution. Search installer-dev for my name and you'll see all my posts.
I have not tried the newer "Distribution Packages" because they require 10.4 or later. But I doubt they solve this problem.
Here are the main problems with using search methods (such as CommonAppSearch) in a package :
- If the search does not find anything, then the install CONTINUES, installing everything in the default location that you have to specify in the package. Probably not what you want.
- Even if the search method finds your existing software, it does not pass that info to scripts. Apple has confirmed this behavior. The installer does not provide the path of the found application to the script.
After talking with Apple engineers, here is what we do. This is not pretty, but it gets the job done.
- We wrote a wrapper app that goes around the package. The wrapper app locates the existing application, usually using LaunchServices. It writes the path of the found app out to a file in /tmp/ somehardcodedfoldername. This makes up for the fact that the Installer doesn't pass the found location to scripts.
- If the wrapper app does not locate our app, it exits. If it finds our app, it launches the actual installer package which is bundled inside the wrapper app. This takes care of the case where the Installer insists on installing stuff even when your software was not located.
- The installer package is designed to dump all it's files into /tmp/ somehardcodedfoldername.
- We then have a postupgarde/postinstall script that reads the path of the found app from the file that the wrapper app left around in tmp. The script then moves/copies the stuff in /tmp/ somehardcodedfoldername to the proper location.
Like I said, not pretty. And there's lots of gnarly details to tend to. You could possibly do all this in InstallationChecks or Preflights, but those have lots of gotchas. Hope this helps.
Mark Krenek Aspry Media
Thank you, Mark. That does help. A great deal! Apple is so good about so many things. It is a shock when something likes this happens. I will not waste my time trying to figure out how the Locator works in the Installer because it doesn't. Our installer forces the customer to find where they moved our application (if they did - we start them in the Applications folder where we install it by default) and no one has really complained. I just thought this would be an nice enhancement. It's not worth the trouble. Regards, Jim Dodd Onset Computer Corp. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Installer-dev mailing list (Installer-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/installer-dev/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Jim Dodd