From 1dff355a6bbdeaad7afc5b9939a33e4ac4fcf107 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Wed, 20 Sep 2017 12:51:50 +0000 Subject: [PATCH] app_installer update git-svn-id: svn://kolibrios.org@7000 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/app_installer/file_listing.h | 21 -------- programs/cmm/app_installer/installer.c | 62 +++++++++++++++-------- 2 files changed, 40 insertions(+), 43 deletions(-) delete mode 100644 programs/cmm/app_installer/file_listing.h diff --git a/programs/cmm/app_installer/file_listing.h b/programs/cmm/app_installer/file_listing.h deleted file mode 100644 index 50c8c1121c..0000000000 --- a/programs/cmm/app_installer/file_listing.h +++ /dev/null @@ -1,21 +0,0 @@ -//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/installer.c b/programs/cmm/app_installer/installer.c index a41f614d30..30f49c98f0 100644 --- a/programs/cmm/app_installer/installer.c +++ b/programs/cmm/app_installer/installer.c @@ -2,6 +2,8 @@ #include "..\lib\strings.h" #include "..\lib\file_system.h" +char app_name[] = "KingsBounty"; + //file_listing.h must be generated using generate_file_listing.bat #include "file_listing.h" @@ -15,33 +17,49 @@ void main() { - if (dir_exists("/kolibrios")==false) { - die( - "'/kolibrios/ folder is not mounted!\nPlease run APP+ on desktop.\nYou must use ISO distro.'E"); - } +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"); +CreateDir("/tmp0/1/DOS"); +CreateDir(sprintf(#param, "/tmp0/1/DOS/%s", #app_name)); - if (EAX!=0) { - die("'/tmp0/1/ is not mounted!\nPlease run TMPDISK to add it.'E"); - } +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)); +WriteFile(sizeof(file0), #file0, makepath("/tmp0/1/DOS/", FILE_NAME_0)); +WriteFile(sizeof(file1), #file1, makepath("/tmp0/1/DOS/", FILE_NAME_1)); +#ifdef FILE_NAME_2 +WriteFile(sizeof(file2), #file2, makepath("/tmp0/1/DOS/", FILE_NAME_2)); +#endif +#ifdef FILE_NAME_3 +WriteFile(sizeof(file3), #file3, makepath("/tmp0/1/DOS/", FILE_NAME_3)); +#endif +#ifdef FILE_NAME_4 +WriteFile(sizeof(file4), #file4, makepath("/tmp0/1/DOS/", FILE_NAME_4)); +#endif +#ifdef FILE_NAME_5 +WriteFile(sizeof(file5), #file5, makepath("/tmp0/1/DOS/", FILE_NAME_5)); +#endif +#ifdef FILE_NAME_6 +WriteFile(sizeof(file6), #file6, makepath("/tmp0/1/DOS/", FILE_NAME_6)); +#endif +#ifdef FILE_NAME_7 +WriteFile(sizeof(file7), #file7, makepath("/tmp0/1/DOS/", FILE_NAME_7)); +#endif +#ifdef FILE_NAME_8 +WriteFile(sizeof(file8), #file8, makepath("/tmp0/1/DOS/", FILE_NAME_8)); +#endif +#ifdef FILE_NAME_9 +WriteFile(sizeof(file9), #file9, makepath("/tmp0/1/DOS/", FILE_NAME_9)); +#endif - notify("'KingsBounty\nInstalled succesfull.\nEnjoy the game!'tO"); - RunProgram("/sys/@open", "/tmp0/1/DOS/KingsBounty/PLAY.sh"); +notify(sprintf(#param, "'%s\nInstalled to /tmp0/1/DOS/\nEnjoy the game!'tO", #app_name)); +RunProgram("/sys/@open", sprintf(#param, "/tmp0/1/DOS/%s/PLAY.sh", #app_name)); - ExitProcess(); +ExitProcess(); } stop: \ No newline at end of file