https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7119b13a2881721b63c8f…
commit 7119b13a2881721b63c8f7db45294fdc56631fe5
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Sat Sep 12 21:00:38 2020 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Sep 20 17:30:26 2020 +0200
[CREATECABFILE] Update rapps example scripts for new usage
---
base/applications/rapps/CreateCabFile.bat | 32 +++++++++++++++++++++++------
base/applications/rapps/CreateCabFile.sh | 34 ++++++++++++++++++++++++-------
2 files changed, 53 insertions(+), 13 deletions(-)
diff --git a/base/applications/rapps/CreateCabFile.bat
b/base/applications/rapps/CreateCabFile.bat
index 4e216478c33..bccd8b356a4 100644
--- a/base/applications/rapps/CreateCabFile.bat
+++ b/base/applications/rapps/CreateCabFile.bat
@@ -1,12 +1,32 @@
@echo off
-cd ..\..\..\media
+IF "%1"=="" GOTO show_usage
+IF "%2"=="" GOTO show_usage
+IF "%3"=="" GOTO show_usage
-mkdir rapps\utf16
+SET CABMAN_CMD=%1
+SET UTF16LE_CMD=%2
+SET RAPPSDB_PATH=%3
-for %%f in (rapps\*.txt) do (
- ..\output-MinGW-i386\host-tools\utf16le.exe "rapps\%%~nf.txt"
"rapps\utf16\%%~nf.txt"
+mkdir "%RAPPSDB_PATH%\utf16"
+
+echo Converting txt files to utf16
+for %%f in (%RAPPSDB_PATH%\*.txt) do (
+ %UTF16LE_CMD% "%RAPPSDB_PATH%\%%~nf.txt"
"%RAPPSDB_PATH%\utf16\%%~nf.txt"
)
-..\output-MinGW-i386\host-tools\cabman.exe -M mszip -S rapps\rappmgr.cab
rapps\utf16\*.txt
-rmdir /s /q rapps\utf16
+echo Building rappmgr.cab
+%CABMAN_CMD% -M mszip -S "%RAPPSDB_PATH%\rappmgr.cab"
"%RAPPSDB_PATH%\utf16\*.txt"
+
+echo Building rappmgr2.cab
+%CABMAN_CMD% -M mszip -S "%RAPPSDB_PATH%\rappmgr2.cab"
"%RAPPSDB_PATH%\utf16\*.txt" -F icons "%RAPPSDB_PATH%\icons\*.ico"
+
+echo Cleaning up
+rmdir /s /q "%RAPPSDB_PATH%\utf16"
+
+echo Done
+
+goto :eof
+
+:show_usage
+echo Usage: CreateCabFile.bat path\to\cabman.exe path\to\utf16le.exe path\to\rapps-db
diff --git a/base/applications/rapps/CreateCabFile.sh
b/base/applications/rapps/CreateCabFile.sh
index 3a31ca7235c..c7783e6d772 100644
--- a/base/applications/rapps/CreateCabFile.sh
+++ b/base/applications/rapps/CreateCabFile.sh
@@ -1,9 +1,29 @@
#/bin/sh
-cd ../../../media
-mkdir rapps/utf16
-for i in $(find -type f); do
- ../../host-tools/utf16le $i utf16/$i
+
+if [ "$#" != "3" ]; then
+ echo "Usage: CreateCabFile.sh path/to/cabman path/to/utf16le
path/to/rapps-db"
+ exit -1
+fi
+
+CABMAN_CMD="$1"
+UTF16LE_CMD="$2"
+RAPPSDB_PATH="$3"
+
+mkdir "$RAPPSDB_PATH/utf16"
+
+echo Converting txt files to utf16
+for filename in $RAPPSDB_PATH/*.txt; do
+ just_filename=$(basename -- "$filename")
+ $UTF16LE_CMD "$filename" "$RAPPSDB_PATH/utf16/$just_filename"
done
-cd ..
-../../host-tools/cabman -M mszip -S rapps/rappmgr.cab rapps/utf16/*.txt
-rm -r rapps/uft16
\ No newline at end of file
+
+echo Building rappmgr.cab
+$CABMAN_CMD -M mszip -S "$RAPPSDB_PATH/rappmgr.cab"
"$RAPPSDB_PATH/utf16/*.txt"
+
+echo Building rappmgr2.cab
+$CABMAN_CMD -M mszip -S "$RAPPSDB_PATH/rappmgr2.cab"
"$RAPPSDB_PATH/utf16/*.txt" -F icons "$RAPPSDB_PATH/icons/*.ico"
+
+echo Cleaning up
+rm -r "$RAPPSDB_PATH/utf16"
+
+echo Done