Re: How to Cancel an install when Search Methods don't find anything
Re: How to Cancel an install when Search Methods don't find anything
- Subject: Re: How to Cancel an install when Search Methods don't find anything
- From: Stéphane Sudre <email@hidden>
- Date: Mon, 26 Sep 2005 09:00:12 +0200
On dimanche, septembre 25, 2005, at 08:17 PM, Mark Krenek wrote:
The short question: Is there any way to prevent an installation from
continuing if one of the search methods
(BundleIdentifierSearch, CommonAppSearch, etc.) fails to find an
applicable target?
[...]
Possible workarounds:
* Ugly: set the default location to be /tmp.
This won't prevent the installation from being run but:
- the update won't be installed somewhere the user can see it
- you can check in a postflight script for the presence of some of your
files in /tmp. Since this is quite an improbable location, you can be
quite sure that when the files are installed in /tmp, this means the
original application was not there.
* Not too bad: Use a metapackage to do something similar but to avoid
installing any real files in /tmp.
- You would need one package which will just contain the folder of your
bundle (let's hope you're using a bundle app) and which installs it by
default in /tmp. You would need a search path to locate the location of
your previous version.
- The second package will have a preinstall and a preupgrade script
which will look for the presence of the folder of the first package in
/tmp. If it's in /tmp, this means there is no previous version and so
you can fail the installation with a return code.
Note: Somehow you need to remove the folder in /tmp at one point with
the 2 former somutions so that you can later launch the installation
with no surprises.
* Complex but a bit smart: Create a small Cocoa or Carbon bundle
application which looks for the location of your previous application
using the LaunchServices API.
- if it finds the previous version, it launches the installation by
"opening" the package
- if it does not find it, it just displays an alert.
You can cheat by using a package standard icon for this tool and adding
the real package in the Resources of this little application.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden