| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 | 
							- #!/bin/sh
 
- # Copyright (c) 2009,2010,2011 Frank Zago
 
- #
 
- # This program is free software; you can redistribute it and/or modify
 
- # it under the terms of the GNU General Public License as published by
 
- # the Free Software Foundation; either version 2 of the License, or
 
- # (at your option) any later version.
 
- # Extract game data from various archives and create a tree with the right files
 
- # Tools needed:
 
- #   unshield: sudo apt-get install unshield
 
- #   rename (from perl)
 
- #   unrar: sudo apt-get install unrar
 
- # Data files needed:
 
- #   data1.cab and data1.hdr from the original 1st CDROM
 
- #   Heroes3.snd from the original 2nd CDROM
 
- #   the WoG release v3.58f: allinone_358f.zip
 
- #   the VCMI distribution: vcmi_089.zip
 
- #   the menu graphic pack: vcmi32menu.zip
 
- # Usage: put this script and the 4 data files into the same directory
 
- # and run the script.
 
- DESTDIR=`pwd`/vcmi
 
- rm -rf $DESTDIR
 
- mkdir $DESTDIR
 
- # Extract Data from original CD-ROM
 
- # 376917499 2002-06-14 14:32 _setup/data1.cab
 
- # 27308     2002-06-14 14:32 _setup/data1.hdr
 
- rm -rf temp
 
- mkdir temp
 
- cd temp
 
- echo Extracting data1.cab
 
- unshield x ../data1.cab || exit 1
 
- echo Done extracting data1.cab
 
- rm -rf CommonFiles
 
- rm -rf GameUpdate
 
- rm -rf Support
 
- rm -rf Program_Files/mplayer
 
- rm -rf Program_Files/ONLINE
 
- find . -name "*.DLL" | xargs rm -f
 
- find . -name "*.dll" | xargs rm -f
 
- find . -name "*.pdf" -print0  | xargs -0 rm -f
 
- find . -name "*.HLP" | xargs rm -f
 
- find . -name "*.TXT" | xargs rm -f
 
- find . -name "*.cnt" | xargs rm -f
 
- find . -name "*.exe" | xargs rm -f
 
- find . -name "*.EXE" | xargs rm -f
 
- find . -name "*.ASI" | xargs rm -f
 
- # Tree is clean. Move extracted files to their final destination
 
- mv Program_Files/* $DESTDIR
 
- cd ..
 
- # Copy Heroes3.snd from 2nd CDROM and rename it to avoid a name conflict.
 
- cp Heroes3.snd $DESTDIR/Data/Heroes3-cd2.snd
 
- # Extract Data from WoG
 
- # 39753248 allinone_358f.zip
 
- rm -rf temp
 
- mkdir temp
 
- cd temp
 
- unzip ../allinone_358f.zip
 
- cd WoG_Install
 
- mkdir temp
 
- cd temp
 
- unrar x -o+ ../main1.wog
 
- unrar x -o+ ../main2.wog
 
- unrar x -o+ ../main3.wog
 
- unrar x -o+ ../main4.wog
 
- #unrar x -o+ ../main5.wog
 
- #unrar x -o+ ../main6_optional.wog
 
- #unrar x -o+ ../main7_optional.wog
 
- #unrar x -o+ ../main8_optional.wog
 
- #unrar x -o+ ../main9_optional.wog
 
- mkdir -p $DESTDIR/Data/zvs/
 
- mv data/zvs/Lib1.res $DESTDIR/Data/zvs/
 
- rm -rf picsall Documentation Data data update
 
- rm -f action.txt h3bitmap.txt H3sprite.txt InstMult.txt
 
- rm -f ACTION.TXT H3BITMAP.TXT H3SPRITE.TXT INSTMULT.TXT
 
- rm -f *.DLL *.dll *.fnt readme.txt *.exe *.EXE *.lod *.vid h3ab_ahd.snd
 
- rename 'y/a-z/A-Z/' *
 
- # Tree is clean. Move extracted files to their final destination
 
- mv MAPS/* $DESTDIR/Maps
 
- rmdir MAPS
 
- mkdir $DESTDIR/Sprites
 
- mv *.MSK *.DEF $DESTDIR/Sprites
 
- mv * $DESTDIR/Data/
 
- cd ../../..
 
- # Extract Data from VCMI release
 
- rm -rf temp
 
- mkdir temp
 
- cd temp
 
- #7zr x ../vcmi_088b.7z
 
- unzip ../vcmi_089.zip
 
- find . -name "*.dll" | xargs rm -f
 
- find . -name "*.DLL" | xargs rm -f
 
- find . -name "*.exe" | xargs rm -f
 
- rm -rf AI
 
- rm -f AUTHORS ChangeLog license.txt Microsoft.VC90.CRT.manifest
 
- rm -rf MP3
 
- rm -rf Games
 
- # Tree is clean. Move extracted files to their final destination
 
- cp -a . $DESTDIR
 
- cd ..
 
- # Extract graphics package
 
- rm -rf temp
 
- mkdir temp
 
- cd temp
 
- unzip ../vcmi32menu.zip
 
- # Tree is already clean. Move extracted files to their final destination
 
- cp -a . $DESTDIR
 
- cd ..
 
- # Done
 
- echo
 
- echo The complete game data is at $DESTDIR
 
- echo You could move it to /usr/local/share/games/
 
- echo and configure vcmi with:
 
- echo   ./configure --datadir=/usr/local/share/games/ --bindir=\`pwd\` --libdir=\`pwd\`
 
- echo
 
- echo If you want to run from your VCMI tree, create those links
 
- echo at the root of your VCMI tree:
 
- echo   ln -s client/vcmiclient .
 
- echo   ln -s server/vcmiserver .
 
- echo   ln -s AI/GeniusAI/.libs/GeniusAI.so .
 
 
  |