From fa97d76abb2b6536aebfa4536ce876438babd958 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Wed, 20 Sep 2017 12:22:47 +0000 Subject: [PATCH] upload app_installer git-svn-id: svn://kolibrios.org@6999 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/app_installer/build_en.bat | 12 +++++ programs/cmm/app_installer/file_listing.h | 21 +++++++++ .../app_installer/generate_file_listing.bat | 31 ++++++++++++ programs/cmm/app_installer/installer.c | 47 +++++++++++++++++++ 4 files changed, 111 insertions(+) create mode 100644 programs/cmm/app_installer/build_en.bat create mode 100644 programs/cmm/app_installer/file_listing.h create mode 100644 programs/cmm/app_installer/generate_file_listing.bat create mode 100644 programs/cmm/app_installer/installer.c diff --git a/programs/cmm/app_installer/build_en.bat b/programs/cmm/app_installer/build_en.bat new file mode 100644 index 0000000000..f6885f694c --- /dev/null +++ b/programs/cmm/app_installer/build_en.bat @@ -0,0 +1,12 @@ +@del lang.h-- +@echo #define LANG_ENG 1 >lang.h-- + +call generate_file_listing.bat + +@C-- installer.c +@del installer.kex +@rename installer.com installer.kex +@kpack installer.kex +@del lang.h-- +@del warning.txt +@pause \ No newline at end of file diff --git a/programs/cmm/app_installer/file_listing.h b/programs/cmm/app_installer/file_listing.h new file mode 100644 index 0000000000..50c8c1121c --- /dev/null +++ b/programs/cmm/app_installer/file_listing.h @@ -0,0 +1,21 @@ +//FIle listing generated by BAT script +#define FILE_NAME_0 "KingsBounty/256.CC\0" +dword file0 = FROM FILE_NAME_0; +#define FILE_NAME_1 "KingsBounty/416.CC\0" +dword file1 = FROM FILE_NAME_1; +#define FILE_NAME_2 "KingsBounty/A.DAT\0" +dword file2 = FROM FILE_NAME_2; +#define FILE_NAME_3 "KingsBounty/ANDELOCK.DAT\0" +dword file3 = FROM FILE_NAME_3; +#define FILE_NAME_4 "KingsBounty/ANDREAS.DAT\0" +dword file4 = FROM FILE_NAME_4; +#define FILE_NAME_5 "KingsBounty/ANDY_OG_.DAT\0" +dword file5 = FROM FILE_NAME_5; +#define FILE_NAME_6 "KingsBounty/BENT.DAT\0" +dword file6 = FROM FILE_NAME_6; +#define FILE_NAME_7 "KingsBounty/E.DAT\0" +dword file7 = FROM FILE_NAME_7; +#define FILE_NAME_8 "KingsBounty/KB.EXE\0" +dword file8 = FROM FILE_NAME_8; +#define FILE_NAME_9 "KingsBounty/PLAY.sh\0" +dword file9 = FROM FILE_NAME_9; diff --git a/programs/cmm/app_installer/generate_file_listing.bat b/programs/cmm/app_installer/generate_file_listing.bat new file mode 100644 index 0000000000..8f175d1e8a --- /dev/null +++ b/programs/cmm/app_installer/generate_file_listing.bat @@ -0,0 +1,31 @@ +@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 diff --git a/programs/cmm/app_installer/installer.c b/programs/cmm/app_installer/installer.c new file mode 100644 index 0000000000..a41f614d30 --- /dev/null +++ b/programs/cmm/app_installer/installer.c @@ -0,0 +1,47 @@ +#define MEMSIZE 731935 + 200200 +#include "..\lib\strings.h" +#include "..\lib\file_system.h" + +//file_listing.h must be generated using generate_file_listing.bat +#include "file_listing.h" + +:dword makepath(dword basic_path, relative_path) +{ + char absolute_path[4096]; + strcpy(#absolute_path, basic_path); + strcat(#absolute_path, relative_path); + return #absolute_path; +} + +void main() +{ + if (dir_exists("/kolibrios")==false) { + die( + "'/kolibrios/ folder is not mounted!\nPlease run APP+ on desktop.\nYou must use ISO distro.'E"); + } + + CreateDir("/tmp0/1/DOS"); + CreateDir("/tmp0/1/DOS/KingsBounty"); + + if (EAX!=0) { + die("'/tmp0/1/ is not mounted!\nPlease run TMPDISK to add it.'E"); + } + + WriteFile(sizeof(file0), #file0, makepath("/tmp0/1/DOS/", FILE_NAME_0)); + WriteFile(sizeof(file1), #file1, makepath("/tmp0/1/DOS/", FILE_NAME_1)); + WriteFile(sizeof(file2), #file2, makepath("/tmp0/1/DOS/", FILE_NAME_2)); + WriteFile(sizeof(file3), #file3, makepath("/tmp0/1/DOS/", FILE_NAME_3)); + WriteFile(sizeof(file4), #file4, makepath("/tmp0/1/DOS/", FILE_NAME_4)); + WriteFile(sizeof(file5), #file5, makepath("/tmp0/1/DOS/", FILE_NAME_5)); + WriteFile(sizeof(file6), #file6, makepath("/tmp0/1/DOS/", FILE_NAME_6)); + WriteFile(sizeof(file7), #file7, makepath("/tmp0/1/DOS/", FILE_NAME_7)); + WriteFile(sizeof(file8), #file8, makepath("/tmp0/1/DOS/", FILE_NAME_8)); + WriteFile(sizeof(file9), #file9, makepath("/tmp0/1/DOS/", FILE_NAME_9)); + + notify("'KingsBounty\nInstalled succesfull.\nEnjoy the game!'tO"); + RunProgram("/sys/@open", "/tmp0/1/DOS/KingsBounty/PLAY.sh"); + + ExitProcess(); +} + +stop: \ No newline at end of file