color 0C
setlocal ENABLEEXTENSIONS DISABLEDELAYEDEXPANSION
:restart
title Duke: Nuclear Winter Plus Launcher
if "
%editor%"=="1"
title Duke: Nuclear Winter Plus Editor Launcher
set addonhrpdir=
%startdir%
)
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º Duke: Nuclear Winter Plus º
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.
if "
%xxx%"=="1"
echo Using XXX mode.
if "
%dp%"=="1"
echo Using Duke Plus by DeeperThought.
if "
%debug%"=="1"
echo Using debug mode.
if "
%debug%"=="1"
echo DEBUG: Command Line Input:
%*
:recheck
:execheck_done
if "
%debug%"=="1"
echo DEBUG:
%exeproper% Directory: "
%exedir%"
if not exist duke3d.grp
echo Warning: You don't have Duke3D.grp
in your directory.
:addondircheck
if "
%debug%"=="1"
echo DEBUG: NW+ Directory: "
%addondir%".
if "
%debug%"=="1"
echo DEBUG: NWHRP Directory: "
%addonhrpdir%".
set kextract=
%addondir%\utils\windows\win32\kextract.exe
if "
%debug%"=="1"
set kextract=
%addondir%\utils\windows\win32\kextract.debug.exe
set bspatch=
%addondir%\utils\windows\win32\bspatch.exe
set sha1sum=
%addondir%\utils\windows\win32\sha1sum.exe
if "
%nwgrpname%"==""
set nwgrpname=nwinter.grp
:nonwgrp_return
if not "
%version%"=="demo"
(
)
echo To switch your character, open the console
(~
) and type one of the following:
echo Duke: "setvar skin 0".
echo Santa: "setvar skin 1".
:init
:check
echo Launching Duke Nukem 3D . . .
type "%exedir%\names.h" > "%exedir%\NWNames.h"
echo.
>> "
%exedir%\NWNames.h"
type "%addondir%\NWNames.def" >> "%exedir%\NWNames.h"
)
:arguments
if exist "
%exedir%\polymer_hrp\"
set args=
%args% -j polymer_hrp
if exist "
%exedir%\duke3d_voxel.zip"
set args=
%args% -g duke3d_voxel.zip
if exist "
%exedir%\duke3d_hrp.zip"
set args=
%args% -g duke3d_hrp.zip
if exist "
%exedir%\hrp_update.zip"
set args=
%args% -g hrp_update.zip
if exist "
%exedir%\maphacks.zip"
set args=
%args% -g maphacks.zip
if exist "
%exedir%\eduke32_mus.zip"
set args=
%args% -g eduke32_mus.zip
if exist "
%addondir%"
if not "
%addondir%"=="
%exedir%"
set args=
%args% -j "
%addondir:\=/%"
if exist "
%addonhrpdir%"
if not "
%addonhrpdir%"=="
%exedir%"
if not "
%addonhrpdir%"=="
%addondir%"
set args=
%args% -j "
%addonhrpdir:\=/%"
set args=
%args% -g
%nwgrpname% -h nwinter.def -x NWEDuke.
con
if "
%editor%"=="1"
set args=
%args% -namesfile NWNames.h
if "
%dp%"=="1"
set args=
%args% -h nw_dp.def -x NWDP.
con
if "
%xxx%"=="1"
if exist "
%exedir%\xxx_lite.zip"
set args=
%args% -g xxx_lite.zip
if "
%xxx%"=="1"
if exist "
%exedir%\xxx_lite\"
set args=
%args% -j xxx_lite
if "
%xxx%"=="1"
if exist "
%exedir%\xxx_pack.zip"
set args=
%args% -g xxx_pack.zip
if "
%xxx%"=="1"
if exist "
%exedir%\xxx_pack\"
set args=
%args% -j xxx_pack
if "
%xxx%"=="1"
set args=
%args% -h nw_xxx.def
if "
%xxx%"=="1"
if "
%dp%"=="1"
set args=
%args% -h nw_dp_xxx.def -x NWDPXXX.
con
if "
%dp%"=="1"
set args=
%args% -j DukePlus
if "
%debug%"=="1"
set exe=
%exename%.debug
if "
%debug%"=="1"
echo DEBUG: Final Command Line:
call %exe%.bat
%args%
if "
%debug%"=="1"
echo DEBUG: Final Command Line: start
%exe%.exe
%args%
start %exe%.exe %args%
)
if "
%svnpath%"=="0"
if exist "
%startdir%\svn\bin\svn.exe"
set svnpath=
%startdir%\svn\bin
if "
%svnpath%"=="0"
if exist "
%exedir%\svn\bin\svn.exe"
set svnpath=
%exedir%\svn\bin
if "
%svnpath%"=="0"
if exist "
%ProgramFiles%\SlikSvn\bin\svn.exe"
set svnpath=
%ProgramFiles%\SlikSvn\bin
if "
%svnpath%"=="0"
if exist "
%ProgramFiles(x86)%\SlikSvn\bin\svn.exe"
set svnpath=
%ProgramFiles(x86)%\SlikSvn\bin
if "
%svnpath%"=="0"
if exist "
%ProgramFiles%\Subversion\bin\svn.exe"
set svnpath=
%ProgramFiles%\Subversion\bin
if "
%svnpath%"=="0"
if exist "
%ProgramFiles(x86)%\Subversion\bin\svn.exe"
set svnpath=
%ProgramFiles(x86)%\Subversion\bin
if "
%svnpath%"=="0"
if exist "
%ProgramFiles%\TortoiseSVN\bin\svn.exe"
set svnpath=
%ProgramFiles%\TortoiseSVN\bin
if "
%svnpath%"=="0"
if exist "
%ProgramFiles(x86)%\TortoiseSVN\bin\svn.exe"
set svnpath=
%ProgramFiles(x86)%\TortoiseSVN\bin
:svn_action
set PATH=
%PATH%;
%svnpath%
for /f "delims="
%%a in ('svnversion.exe .'
) do @set oldrev=
%%a
if "
%oldrev%"=="exported"
goto :
eof
if "
%oldrev%"=="Unversioned directory"
goto :
eof
"svn.exe" update
for /f "delims="
%%a in ('svnversion.exe .'
) do @set rev=
%%a
set /a oldrev=
%oldrev% + 1
"svn.exe" log -r %oldrev%:%rev%
:nonwgrp
set megaton=Steam\SteamApps\common\Duke Nukem 3D\gameroot\addons\nwinter.grp
if exist "
%ProgramFiles%\
%megaton%"
copy "
%ProgramFiles%\
%megaton%" .\
&& call :
conprotect && goto nonwgrp_done
if exist "
%ProgramFiles(x86)%\
%megaton%"
copy "
%ProgramFiles(x86)%\
%megaton%" .\
&& call :
conprotect && goto nonwgrp_done
echo Error: You don't have NWINTER.GRP
in your directory.
:retry
set /p cddrive=What is the drive letter that your Nuclear Winter
CD is
in?
if not '
%cddrive%'==''
set cddrive=
%cddrive:~0,1%
if exist %cddrive%:\GAMEDATA\NWINTER.GRP
copy %cddrive%:\GAMEDATA\NWINTER.GRP .\nwinter.grp
&& goto nonwgrp_done
if exist %cddrive%:\NWINTER\GAMEDATA\NWINTER.GRP
copy %cddrive%:\NWINTER\GAMEDATA\NWINTER.GRP .\nwinter.grp
&& goto nonwgrp_done
if exist %cddrive%:\NW\GAMEDATA\NWINTER.GRP
copy %cddrive%:\NW\GAMEDATA\NWINTER.GRP .\nwinter.grp
&& goto nonwgrp_done
:nonwgrp_done
type NWINTRO.TXT
call :
grpchecksum_results
)
echo Contact Hendricks266
for help.
)
:grpchecksum
)
echo a6728f621f121f9db02ee67c39efdbb5eea95711 *
%nwgrpname% | "
%sha1sum%" --status --check -
if "
%ERRORLEVEL%"=="1"
echo 1b33b2cbb7101b5b18b15855392f55575413ecc3 *
%nwgrpname% | "
%sha1sum%" --status --check -
if "
%ERRORLEVEL%"=="1"
set version=unknown
:grpchecksum_results
if "
%version%"=="full"
echo NWINTER.GRP checksum verified.
if "
%version%"=="demo"
echo NWINTER.GRP
(demo version
) checksum verified.
if "
%version%"=="unknown"
echo NWINTER.GRP checksum does
not match. You may have a bad
copy.
:cdno
echo '
%cddrive%' is
not valid. Please try again.
:cdwrong
echo '
%cddrive%' is
not the correct disc. Please try again.
:mapextract
echo Extracted maps
not found or patched. Proceeding to installation.
:updateextract
echo Map patch update required. Proceeding to installation.
:extract
call :
grpchecksum_results
if exist "
%exedir%\nwl*.map"
move /y "
%exedir%\nwl*.map" nw_preserve\
:: TODO: eliminate the need for the if exist checks; tighten up path handling
if exist "
%addondir%\
%nwgrpname%"
set grp=
%addondir%\
%nwgrpname%
if exist "
%exedir%\
%nwgrpname%"
set grp=
%exedir%\
%nwgrpname%
"%kextract%" "%grp%" E2L*.MAP
echo Map patching will now begin.
"%bspatch%" nwl1.map nwl1.map nwl1.patch
"%bspatch%" nwl2.map nwl2.map nwl2.patch
"%bspatch%" nwl3.map nwl3.map nwl3.patch
"%bspatch%" nwl4.map nwl4.map nwl4.patch
"%bspatch%" nwl5.map nwl5.map nwl5.patch
"%bspatch%" nwl6.map nwl6.map nwl6.patch
"%bspatch%" nwl7.map nwl7.map nwl7.patch
"%bspatch%" nwl8.map nwl8.map nwl8.patch
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
:scanning
echo Scanning directory
for potential problems.
:mhkfound_done
:artfound_done
call :
checksum c6b8ca33ea6a2ec46b8dfeca4f9a3d5e078d0789 NWACTOR.
CON "NWINTER file detected and neutralized:"
call :
checksum fdb91aa2912f16232ed9020a7d8ec35834ef58c8 NWDEFS.
CON "NWINTER file detected and neutralized:"
call :
checksum 2bb2ddc7319e0935569b724f3c67cb953fdb79d6 NWINTER.
CON "NWINTER file detected and neutralized:"
call :
checksum 5ae347733be1f87f35d1930186de1ed764f4682f NWSNOW.
CON "NWINTER file detected and neutralized:"
call :
checksum 5df8b3b4216dcfdb8bc0adf6241f8a893eacfd98 NWUSER.
CON "NWINTER file detected and neutralized:"
:confound_done
:conprotect
:checksum
)
echo %~1 *
%~2 | "
%sha1sum%" --status --check -
ren "
%~2" "NWOld_
%addonver%_
%~nx2"
)
:nopatch
echo Error: You don't have all the *.patch files
in your directory.
echo Aborting installation.
echo Map patching is required
for NW+ to function correctly.
:mhkfound
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.
:artfound
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.
:confound
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 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 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.
:execheck
echo Warning: You don't have
%exeproper% in your directory.
:nodir
echo Error: "nw_plus" data directory
not found.
:end
color 07