Changes between Version 32 and Version 33 of PackagingInstructions


Ignore:
Timestamp:
Jun 28, 2012, 12:07:34 AM (12 years ago)
Author:
jef
Comment:

mention preremove and shortcut options.

Legend:

Unmodified
Added
Removed
Modified
  • PackagingInstructions

    v32 v33  
    7171== Post-Install Actions ==
    7272
    73 Packages may take post-install actions by including a .bat file in the /etc/postinstall directory as part of the package.  The filename should be named etc/postinstall/<package>.bat.  The bat file will be run with the environment variables OSGEO4W_STARTMENU, OSGEO4W_HOME and OSGEO4W_HOME_MSYS defined, and with OSGEO4W_HOME/bin already in the path.
     73Packages may take post-install actions by including a .bat file in the /etc/postinstall directory as part of the package.  The filename should be named etc/postinstall/<package>.bat.  The bat file will be run with the environment variables OSGEO4W_STARTMENU, OSGEO4W_DESKTOP_LINKS, OSGEO4W_MENU_LINKS, OSGEO4W_HOME, and OSGEO4W_HOME_MSYS defined, and with OSGEO4W_HOME/bin already in the path.
    7474
    7575One very common thing to do in postinstall actions is to insert/update configuration files to include the installed path to the OSGeo4W tree.  This is normally done with a postinstall file, and here are 2 examples::
     
    119119Another postinstall task that packages might do is to create shortcuts that will be available to launch a certain command. As its is the case for the textreplace executable, there is an utility binary xxmklink.exe that is available in the installer (part of the msvcrt package). By typing xxmklink, you can see all the options supported by this utility. Here are some examples on how it can be used in a post install file:
    120120{{{
    121   mkdir "%OSGEO4W_STARTMENU%"
    122   mkdir "%OSGEO4W_STARTMENU%\Apache"
    123   xxmklink "%OSGEO4W_STARTMENU%\Apache\OSGEO4W-Apache-Install.lnk"
    124     %OSGEO4W_ROOT%\Apache\bin\httpd.exe " -k install -n \"Apache OSGEO4W Web Server\""
     121  if not %OSGEO4W_MENU_LINKS%==0 (
     122    mkdir "%OSGEO4W_STARTMENU%"
     123    mkdir "%OSGEO4W_STARTMENU%\Apache"
     124    xxmklink "%OSGEO4W_STARTMENU%\Apache\OSGEO4W-Apache-Install.lnk"
     125      %OSGEO4W_ROOT%\Apache\bin\httpd.exe " -k install -n \"Apache OSGEO4W Web Server\""
     126  )
    125127}}}
    126128Using icons:
    127129{{{
    128   xxmklink "%OSGEO4W_STARTMENU%\ttt.lnk" cmd.exe "" . "my_desc" 1 "%OSGEO4W_ROOT%\OSGeo4W.ico"
     130  if not %OSGEO4W_MENU_LINKS%==0 xxmklink "%OSGEO4W_STARTMENU%\ttt.lnk" cmd.exe "" . "my_desc" 1 "%OSGEO4W_ROOT%\OSGeo4W.ico"
    129131}}}
    130132A Desktop icon:
    131133{{{
    132   xxmklink "%ALLUSERSPROFILE%\Desktop\OpenEV.lnk" "%OSGEO4W_ROOT%\bin\openev.bat"
     134  if not %OSGEO4W_DESKTOP_LINKS%==0 xxmklink "%ALLUSERSPROFILE%\Desktop\OpenEV.lnk" "%OSGEO4W_ROOT%\bin\openev.bat"
    133135     " " \ "OSGeo4W OpenEV" 1 "%OSGEO4W_ROOT%\apps\openev\icon.ico"
    134136}}}
    135137
     138The environment variables {{{OSGEO4W_MENU_LINKS}}} and {{{OSGEO4W_DESKTOP_LINKS}}} are set by the installer (since 1.0.6-5) and reflect whether or not the corresponding option was checked.
     139
    136140The postinstall scripts can run any DOS command or installed binary with desired arguments.
     141
     142== Pre-Remove Actions ==
     143
     144Packages may also take pre-remove actions by including a .bat file in the /etc/preremove directory as part of the package.  The filename should be named etc/preremove/<package>.bat.  The bat file will be run with the environment variables OSGEO4W_STARTMENU, OSGEO4W_HOME and OSGEO4W_HOME_MSYS defined, and with OSGEO4W_HOME/bin already in the path.
     145
     146A common application for this would be the removal of the shortcuts created in the post install actions.
    137147
    138148= Shell Initialization =