kolibrios-gitea/programs/cmm/app_installer/generate_file_listing.bat
Kirill Lipatov (Leency) fa97d76abb upload app_installer
git-svn-id: svn://kolibrios.org@6999 a494cfbc-eb01-0410-851d-a64ba20cac60
2017-09-20 12:22:47 +00:00

32 lines
836 B
Batchfile

@echo off
set TXTFILE=file_listing.h
set DIRPATH="KingsBounty/*"
set DIRNAME=KingsBounty
set INDEX=0
::Create TXTFILE
echo //FIle listing generated by BAT script > "%TXTFILE%"
::List files in DIRPATH and call function to write
::files into TXTFILE
FOR %%i IN (%DIRPATH%) DO Call :Function_Write %%i
echo %TXTFILE% created from files in directory %DIRPATH%
GoTo :EOF
:Function_Write
echo #define FILE_NAME_%INDEX% "%DIRNAME%/%1\0" >> "%TXTFILE%"
echo dword file%INDEX% = FROM FILE_NAME_%INDEX%; >> "%TXTFILE%"
if %INDEX%==10 set INDEX=11
if %INDEX%==9 set INDEX=10
if %INDEX%==8 set INDEX=9
if %INDEX%==7 set INDEX=8
if %INDEX%==6 set INDEX=7
if %INDEX%==5 set INDEX=6
if %INDEX%==4 set INDEX=5
if %INDEX%==3 set INDEX=4
if %INDEX%==2 set INDEX=3
if %INDEX%==1 set INDEX=2
if %INDEX%==0 set INDEX=1