1@echo off
2
3IF "%1"=="" GOTO show_usage
4IF "%2"=="" GOTO show_usage
5IF "%3"=="" GOTO show_usage
6
7SET CABMAN_CMD=%1
8SET UTF16LE_CMD=%2
9SET RAPPSDB_PATH=%3
10
11mkdir "%RAPPSDB_PATH%\utf16"
12
13echo Converting txt files to utf16
14for %%f in (%RAPPSDB_PATH%\*.txt) do (
15     %UTF16LE_CMD% "%RAPPSDB_PATH%\%%~nf.txt" "%RAPPSDB_PATH%\utf16\%%~nf.txt"
16)
17
18echo Building rappmgr.cab
19%CABMAN_CMD% -M mszip -S "%RAPPSDB_PATH%\rappmgr.cab" "%RAPPSDB_PATH%\utf16\*.txt"
20
21echo Building rappmgr2.cab
22%CABMAN_CMD% -M mszip -S "%RAPPSDB_PATH%\rappmgr2.cab" "%RAPPSDB_PATH%\utf16\*.txt" -F icons "%RAPPSDB_PATH%\icons\*.ico"
23
24echo Cleaning up
25rmdir /s /q "%RAPPSDB_PATH%\utf16"
26
27echo Done
28
29goto :eof
30
31:show_usage
32echo Usage: CreateCabFile.bat path\to\cabman.exe path\to\utf16le.exe path\to\rapps-db
33