1#/bin/sh 2 3if [ "$#" != "3" ]; then 4 echo "Usage: CreateCabFile.sh path/to/cabman path/to/utf16le path/to/rapps-db" 5 exit -1 6fi 7 8CABMAN_CMD="$1" 9UTF16LE_CMD="$2" 10RAPPSDB_PATH="$3" 11 12mkdir "$RAPPSDB_PATH/utf16" 13 14echo Converting txt files to utf16 15for filename in $RAPPSDB_PATH/*.txt; do 16 just_filename=$(basename -- "$filename") 17 $UTF16LE_CMD "$filename" "$RAPPSDB_PATH/utf16/$just_filename" 18done 19 20echo Building rappmgr.cab 21$CABMAN_CMD -M mszip -S "$RAPPSDB_PATH/rappmgr.cab" "$RAPPSDB_PATH/utf16/*.txt" 22 23echo Building rappmgr2.cab 24$CABMAN_CMD -M mszip -S "$RAPPSDB_PATH/rappmgr2.cab" "$RAPPSDB_PATH/utf16/*.txt" -F icons "$RAPPSDB_PATH/icons/*.ico" 25 26echo Cleaning up 27rm -r "$RAPPSDB_PATH/utf16" 28 29echo Done 30