#!/bin/sh

#
# Modification History
#
# 2007-November-12   Jason Rohrer
# Copied from Cultivation build.
#


if [ $# -lt 1 ] ; then
   echo "Usage: $0 release_name"
   exit 1
fi


mkdir windows

rm -rf windows/OneLife_$1


./makeBaseDistributionFolder $1

mv base/* windows


cd ../gameSource
sh makeRegenerateCachesWindows

cd ../build/windows/OneLife_$1

../../../gameSource/regenerateCaches

# don't ever include bin_cache in bundles, because they are large
# and change every update
rm */bin_*cache.fcz


cd ../..


cp ../gameSource/OneLife.exe windows/OneLife_$1/
cp ../gameSource/EditOneLife.exe windows/OneLife_$1/

cp ../server/OneLifeServer.exe windows/OneLife_$1/
cp ../server/runServer.bat windows/OneLife_$1/

cp ../scripts/contentLeaderSetup.bat windows/OneLife_$1/
cp ../scripts/copyChangesToRepo.bat windows/OneLife_$1/

cp win32/*.dll windows/OneLife_$1/


g++ -o unix2dos unix2dos.c 
cp unix2dos windows
cp unix2dosScript windows


cd windows

d=`date`

echo "$1 built on $d" > OneLife_$1/binary.txt

for file in $( find ./OneLife_$1 -name "*.txt" )
do
	../unix2dosScript "$file"
done







# build a batch file for making a windows SFX bundle

echo "set version=$1" > makeWindowsExtractor_$1.bat; cat ../makeWindowsExtractor_template >> makeWindowsExtractor_$1.bat



