Changes between Version 32 and Version 33 of PackagingInstructions
- Timestamp:
- 06/28/12 00:07:34 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PackagingInstructions
v32 v33 71 71 == Post-Install Actions == 72 72 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_ HOMEand OSGEO4W_HOME_MSYS defined, and with OSGEO4W_HOME/bin already in the path.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_DESKTOP_LINKS, OSGEO4W_MENU_LINKS, OSGEO4W_HOME, and OSGEO4W_HOME_MSYS defined, and with OSGEO4W_HOME/bin already in the path. 74 74 75 75 One 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:: … … 119 119 Another 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: 120 120 {{{ 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 ) 125 127 }}} 126 128 Using icons: 127 129 {{{ 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" 129 131 }}} 130 132 A Desktop icon: 131 133 {{{ 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" 133 135 " " \ "OSGeo4W OpenEV" 1 "%OSGEO4W_ROOT%\apps\openev\icon.ico" 134 136 }}} 135 137 138 The 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 136 140 The postinstall scripts can run any DOS command or installed binary with desired arguments. 141 142 == Pre-Remove Actions == 143 144 Packages 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 146 A common application for this would be the removal of the shortcuts created in the post install actions. 137 147 138 148 = Shell Initialization =