Subversion Repositories nw_plus

Rev

Rev 16 | Rev 19 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

@echo off
@color 0C

:restart
title Duke: Nuclear Winter Plus Launcher
if "%editor%"=="1" title Duke: Nuclear Winter Plus Editor Launcher

set dir=%cd%
set exedir=%~dp0
set addondir=%~dp0
set addonhrpdir=%~dp0

set exename=eduke32
set exeproper=EDuke32
set action=playing

if "%editor%"=="1" (
set exename=mapster32
set exeproper=Mapster32
set action=editing
)

set addonver=r001

:title
echo                          ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo                          º Duke: Nuclear Winter Plus º
echo                          ÈÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍͼ
echo                               ³ By Hendricks266 ³
echo                               ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
echo.
echo You are %action% Simply Silly Software's Duke: Nuclear Winter with the various
echo enhancements of Duke: Nuclear Winter Plus, maintained by Hendricks266.
echo.


if "%xxx%"=="1" echo Using XXX mode.
if "%dp%"=="1" echo Using Duke Plus by DeeperThought.
if "%debug%"=="1" echo Using debug mode.

:recheck
if not exist %exename%.exe goto execheck
:execheck_done
set exedir=%cd%
if "%debug%"=="1" echo DEBUG: %exeproper% Directory: "%exedir%"

if not exist nw_plus\ goto nodir
if not exist duke3d.grp echo Warning: You don't have Duke3D.grp in your directory.

if exist nwinter\ set addonhrpdir=%cd%
:addondircheck

cd nw_plus
set addondir=%cd%
if exist nwinter\ set addonhrpdir=%cd%
if exist nw_plus\ goto addondircheck
if "%debug%"=="1" echo DEBUG: NW+ Directory: "%addondir%".
if "%debug%"=="1" echo DEBUG: NWHRP Directory: "%addonhrpdir%".

if not exist "%addondir%\NWINTER.GRP" (
if exist "%exedir%\NWINTER.GRP" (
move /y "%exedir%\NWINTER.GRP" "%addondir%\"
ren "%addondir%\NWINTER.GRP" nwinter.grp
) else (
goto nonwgrp
) )

:nonwgrp_done
if not exist nwflag_%addonver%.h266 goto extract
if not exist nwl1.map goto extract
if not exist nwl2.map goto extract
if not exist nwl3.map goto extract
if not exist nwl4.map goto extract
if not exist nwl5.map goto extract
if not exist nwl6.map goto extract
if not exist nwl7.map goto extract
if not exist nwl8.map goto extract




cd "%exedir%"
echo.
echo To switch your character, open the console (~) and type one of the following:
echo Duke: "setvar skin 0".
echo Santa: "setvar skin 1".
echo.
echo.

:init
pause
echo.
goto check

:check

echo.
echo Launching Duke Nukem 3D . . .
echo Thanks for %action%^!

:arguments
set args=
if exist polymer_hrp\ set args=%args% -jpolymer_hrp
if exist duke3d_voxel.zip set args=%args% -gduke3d_voxel.zip
if exist duke3d_hrp.zip set args=%args% -gduke3d_hrp.zip
if exist hrp_update.zip set args=%args% -ghrp_update.zip
if exist maphacks.zip set args=%args% -gmaphacks.zip
if exist eduke32_mus.zip set args=%args% -geduke32_mus.zip
if exist "%addondir%" set args=%args% -j"%addondir:\=/%"
if exist "%addonhrpdir%" set args=%args% -j"%addonhrpdir:\=/%"
set args=%args% -gnwinter.grp -hnwinter.def
if "%editor%"=="1" set args=%args% -namesfile NWNames.h
if not "%editor%"=="1" set args=%args% -xNWEDuke.con
if "%dp%"=="1" (
set args=%args% -hnw_dp.def
if not "%editor%"=="1" set args=%args% -xNWDP.con
)
if "%xxx%"=="1" (
if exist xxx_lite.zip set args=%args% -gxxx_lite.zip
if exist xxx_pack.zip set args=%args% -gxxx_pack.zip
set args=%args% -hnw_xxx.def
if "%dp%"=="1" (
set args=%args% -hnw_dp_xxx.def
if not "%editor%"=="1" set args=%args% -xNWDPXXX.con
) )
set args=%args% %*
if "%dp%"=="1" set args=%args% -jDukePlus

set exe=%exename%
if "%debug%"=="1" set exe=%exename%.debug

if exist %exe%.bat (
call %exe%.bat %args%
) else (
start %exe%.exe %args%
)

goto end

:nonwgrp
echo.
echo Error: You don't have NWINTER.GRP in your directory.
:retry
echo.
set cddrive=
set /p cddrive=What is the drive letter that your Nuclear Winter CD is in? 
echo.
if not '%cddrive%'=='' set cddrive=%cddrive:~0,1%
if '%cddrive%'=='' goto cdno
if not exist %cddrive%:\ goto cdno
if not exist %cddrive%:\* goto cdno
if not exist %cddrive%:\GAMEDATA\NWINTER.GRP goto cdw
copy %cddrive%:GAMEDATA\NWINTER.GRP .\
pause
echo.
type NWINTRO.TXT
echo.
pause
goto nonwgrp_done

:cdno
echo '%cddrive%' is not valid.  Please try again.
goto retry

:cdw
echo '%cddrive%' is not the correct disc.  Please try again.
goto retry

:extract
echo.
echo                                ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo                                º Installation º
echo                                ÈÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo.
if not exist nwl1.ips goto noips
if not exist nwl2.ips goto noips
if not exist nwl3.ips goto noips
if not exist nwl4.ips goto noips
if not exist nwl5.ips goto noips
if not exist nwl6.ips goto noips
if not exist nwl7.ips goto noips
if not exist nwl8.ips goto noips
md nw_preserve
if exist nwl*.map move /y nwl*.map nw_preserve\
if exist "%exedir%\nwl*.map" move /y "%exedir%\nwl*.map" nw_preserve\
utils\windows\win32\kextract.exe NWINTER.GRP E2L*.MAP
ren E2L1.MAP nwl1.map
ren E2L2.MAP nwl2.map
ren E2L3.MAP nwl3.map
ren E2L4.MAP nwl4.map
ren E2L5.MAP nwl5.map
ren E2L6.MAP nwl6.map
ren E2L7.MAP nwl7.map
ren E2L8.MAP nwl8.map
if exist nwpatch*.h266 del /f /q nwpatch*.h266 
if exist nwflag*.h266 del /f /q nwflag*.h266 
echo.
echo Map patching will now begin.
echo.
pause
echo
utils\windows\win32\uips.exe a nwl1.ips nwl1.map
utils\windows\win32\uips.exe a nwl2.ips nwl2.map
utils\windows\win32\uips.exe a nwl3.ips nwl3.map
utils\windows\win32\uips.exe a nwl4.ips nwl4.map
utils\windows\win32\uips.exe a nwl5.ips nwl5.map
utils\windows\win32\uips.exe a nwl6.ips nwl6.map
utils\windows\win32\uips.exe a nwl7.ips nwl7.map
utils\windows\win32\uips.exe a nwl8.ips nwl8.map
if exist nwpatch*.h266 del /f /q nwpatch*.h266 
if exist nwflag*.h266 del /f /q nwflag*.h266 
echo Do not delete this file^! You will be forced to reinstall NW+ and repatch the maps. >nwflag_%addonver%.h266
attrib +r nwflag_%addonver%.h266
echo.
echo Patching complete^!
:scanning
cd "%exedir%"
echo.
echo Scanning directory for potential problems.
if exist nwl1.mhk goto mhkfound
if exist nwl1demo.mhk goto mhkfound
if exist nwl2.mhk goto mhkfound
if exist nwl3.mhk goto mhkfound
if exist nwl4.mhk goto mhkfound
if exist nwl5.mhk goto mhkfound
if exist nwl6.mhk goto mhkfound
if exist nwl7.mhk goto mhkfound
if exist nwl8.mhk goto mhkfound
if exist _nwzoo.mhk goto mhkfound
:mhkfound_done
if exist TILES005.ART goto artfound
if exist TILES006.ART goto artfound
if exist TILES007.ART goto artfound
if exist TILES008.ART goto artfound
if exist TILES009.ART goto artfound
if exist TILES012.ART goto artfound
if exist TILES013.ART goto artfound
if exist TILES014.ART goto artfound
if exist TILES015.ART goto artfound
:artfound_done
if exist NWinter.con goto confound
if exist NWActor.con goto confound
if exist NWDefs.con goto confound
if exist NWDP.con goto confound
if exist NWDPCode.con goto confound
if exist NWDPXXX.con goto confound
if exist NWEDuke.con goto confound
if exist NWSnow.con goto confound
if exist NWUser.con goto confound
:confound_done
echo.
pause
goto restart

:noips
echo.
echo Error: You don't have all the *.ips files in your directory.
echo Aborting installation.
echo Map patching is required for NW+ to function correctly.
echo.
pause
goto end

:mhkfound
echo.
echo Problematic .mhk files have been found in your directory.
echo Unless you have knowingly made a modification to NW's map hacks,
echo the presence of these files in your %exeproper% directory will
echo cause NW+ to function incorrectly.
echo.
echo nwl1.mhk
echo nwl1demo.mhk
echo nwl2.mhk
echo nwl3.mhk
echo nwl4.mhk
echo nwl5.mhk
echo nwl6.mhk
echo nwl7.mhk
echo nwl8.mhk
echo _nwzoo.mhk
goto mhkfound_done

:artfound
echo.
echo Problematic .art files have been found in your directory.
echo Unless you have knowingly made a modification to NW's art,
echo the presence of these files in your %exeproper% directory will
echo cause NW+ to function incorrectly.
echo.
echo TILES005.ART
echo TILES006.ART
echo TILES007.ART
echo TILES008.ART
echo TILES009.ART
echo TILES012.ART
echo TILES013.ART
echo TILES014.ART
echo TILES015.ART
goto artfound_done

:confound
echo.
echo Problematic .con files have been found in your directory.
echo Unless you have knowingly made a modification to NW's programming,
echo the presence of these files in your %exeproper% directory will
echo cause NW+ to function incorrectly.
echo.
echo NWinter.con
echo NWEDuke.con
echo NWDefs.con
echo NWUser.con
echo NWDP.con
echo NWDPCode.con
echo NWDPXXX.con
echo NWActor.con
echo NWSnow.con
echo.
echo IF THESE ARE THE ORIGINAL NUCLEAR WINTER CON FILES, OR THEY COME FROM
echo AN OUTDATED VERSION OF NW+, REMOVE THEM FROM YOUR %exeproper% DIRECTORY
echo IMMEDIATELY^!
echo NW+ uses modified .con files to fix programming errors created by
echo the original programmers. Due to improvements made to the levels,
echo NW+ will have major errors if the included .con files are not used.
goto confound_done

:execheck
if exist %exename%.bat goto execheck_done
if exist ..\%exename%.exe (
cd ..
goto recheck
)
if exist ..\..\%exename%.exe (
cd ..\..
goto recheck
)
if exist ..\..\..\%exename%.exe (
cd ..\..\..
goto recheck
)
if exist ..\%exename%.bat (
cd ..
goto execheck_done
)
if exist ..\..\%exename%.bat (
cd ..\..
goto execheck_done
)
if exist ..\..\..\%exename%.bat (
cd ..\..\..
goto execheck_done
)
echo Warning: You don't have %exeproper% in your directory.
goto execheck_done

:nodir
echo.
echo Error: "nw_plus" data directory not found.
echo Aborting launch.
echo.
pause
goto end

:end
echo.
set editor=0
set xxx=0
set dp=0
set debug=0
cd %dir%
@title %ComSpec%
@color 07