REM replace paths
textreplace -sf apache/conf/httpd.conf -df apache/conf/httpd.conf -map @osgeo4w@ %OSGEO4W_ROOT%
textreplace -sf apache/conf/extra/httpd-autoindex.conf -df apache/conf/extra/httpd-autoindex.conf -map @osgeo4w@ %OSGEO4W_ROOT%

REM install and start the apache service
bin/apache-install.bat

REM create start menu links
mkdir "C:\Documents and Settings\All Users\Start Menu\Programs\OSGeo4W"
mkdir "C:\Documents and Settings\All Users\Start Menu\Programs\OSGeo4W\Apache"
xxmklink "C:\Documents and Settings\All Users\Start Menu\Programs\OSGeo4W\Apache\OSGEO4W-Apache-Install.lnk" %OSGEO4W_ROOT%\Apache\bin\httpd.exe " -k install -n \"Apache OSGEO4W Web Server\""
xxmklink "C:\Documents and Settings\All Users\Start Menu\Programs\OSGeo4W\Apache\OSGEO4W-Apache-Uninstall.lnk" %OSGEO4W_ROOT%\Apache\bin\httpd.exe " -k uninstall -n \"Apache OSGEO4W Web Server\""
xxmklink "C:\Documents and Settings\All Users\Start Menu\Programs\OSGeo4W\Apache\OSGEO4W-Apache-Start.lnk" %OSGEO4W_ROOT%\Apache\bin\httpd.exe " -k start -n \"Apache OSGEO4W Web Server\""
xxmklink "C:\Documents and Settings\All Users\Start Menu\Programs\OSGeo4W\Apache\OSGEO4W-Apache-Stop.lnk" %OSGEO4W_ROOT%\Apache\bin\httpd.exe " -k stop -n \"Apache OSGEO4W Web Server\""
xxmklink "C:\Documents and Settings\All Users\Start Menu\Programs\OSGeo4W\Apache\OSGEO4W-Apache-Monitor.lnk" %OSGEO4W_ROOT%\Apache\bin\ApacheMonitor.exe"