Index: setup.html =================================================================== RCS file: /cvs/cygwin/htdocs/setup.html,v retrieving revision 1.85 diff -u -p -r1.85 setup.html --- setup.html 23 Mar 2003 16:27:44 -0000 1.85 +++ setup.html 10 Jul 2003 02:14:32 -0000 @@ -26,7 +26,7 @@ that. Setup.exe has it's own homepage

setup.hint

  • setup.ini

  • making packages

  • -
  • Creating a package postinstall script

  • +
  • Creating package postinstall and preremove scripts

  • Submitting a package

  • @@ -621,12 +621,13 @@ directory, you must structure your packa -

    Creating a package postinstall script

    +

    Creating package postinstall and preremove scripts

    If your package requires certain commands to be executed after the -files in the package are installed, include them in a file in the -package called /etc/postinstall/package.sh or -/etc/postinstall/package.bat.

    +files in the package are installed (e.g., create symbolic links), +include them in a file in the package that resides in the +/etc/postinstall/ directory. The file may have either a .sh or a +.bat suffix.

    If the file's name ends in ".sh", it is executed with the Cygwin shell; if it ends in ".bat", it is executed with the DOS command @@ -637,13 +638,35 @@ ignored.

    ".done" to its previous name, to prevent it from being run again the next time the user runs the setup program.

    +

    There is no limit on the number of postinstall scripts in any +given package. However, it is the responsibility of the package +maintainer to make sure their postinstall scripts don't clash with +postinstall scripts in other packages. The easiest way to do this +is to include the package name as part of the postinstall script +name, or even name the postinstall script +/etc/postinstall/package.sh or +/etc/postinstall/package.bat.

    +

    Note that the setup program runs all the postinstall scripts after all desired packages have been installed, that is, it does not run each package's postinstall script immediately after installing that -package. Note, furthermore, that the order in which the scripts are -run is not guaranteed. Therefore, if your package depends on others -which have their own postinstall scripts, you cannot assume in your -script that the other packages' scripts have already been run.

    +package. Note, furthermore, that the setup program runs scripts in +order of package dependencies, so that if your package depends on +others which have their own postinstall scripts, their postinstall +scripts will have run by the time your script is executed. However, +the order of execution of postinstall scripts within a package is +undefined.

    + +

    Some actions in postinstall scripts may need to be undone just +before the package is uninstalled. Setup supports this with +preremove scripts, which go in /etc/preremove/. Note that, unlike +postinstall scripts, the preremove scripts are limited to 2 per +package, and have to have the same name as the package, i.e., +/etc/preremove/package.sh or +/etc/preremove/package.bat. Also note that preremove +scripts are executed right in the middle of the package uninstall +sequence, so some commands may not be available (because the +corresponding packages have already been uninstalled).

    Submitting a package

    So you've got a package you want to submit. Follow the following checklist before emailing cygwin-apps@cygwin.com and you'll almost certainly save time.