diff --git a/programs/cmm/installer/compile.bat b/programs/cmm/installer/_compile_en.bat similarity index 55% rename from programs/cmm/installer/compile.bat rename to programs/cmm/installer/_compile_en.bat index 741ef9a8eb..952207a56e 100644 --- a/programs/cmm/installer/compile.bat +++ b/programs/cmm/installer/_compile_en.bat @@ -1,5 +1,9 @@ +@del lang.h-- +@echo #define LANG_ENG 1 >lang.h-- + ..\C--\C-- main.c @del installer.kex @rename main.com installer.kex @pause +@del lang.h-- @del warning.txt diff --git a/programs/cmm/installer/_compile_ru.bat b/programs/cmm/installer/_compile_ru.bat new file mode 100644 index 0000000000..e642842699 --- /dev/null +++ b/programs/cmm/installer/_compile_ru.bat @@ -0,0 +1,9 @@ +@del lang.h-- +@echo #define LANG_RUS 1 >lang.h-- + +..\C--\C-- main.c +@del installer.kex +@rename main.com installer.kex +@pause +@del lang.h-- +@del warning.txt diff --git a/programs/cmm/installer/add_appl_dir.c b/programs/cmm/installer/add_appl_dir.c new file mode 100644 index 0000000000..4728545d5b --- /dev/null +++ b/programs/cmm/installer/add_appl_dir.c @@ -0,0 +1,20 @@ + +struct sysdir +{ + char name[64]; + char path[64]; +} sysdir; + + +:int SetAddApplDir(dword tName, tPath) +{ + int i; + strcpy(#sysdir.name, tName); + strcpy(#sysdir.path, tPath); + debug(#sysdir.name); + debug(#sysdir.path); + $mov eax, 30 + $mov ebx, 3 + ECX = #sysdir; + $int 0x40 +} diff --git a/programs/cmm/installer/hallo.c b/programs/cmm/installer/hallo.c deleted file mode 100644 index dbbdf9f9b0..0000000000 --- a/programs/cmm/installer/hallo.c +++ /dev/null @@ -1,48 +0,0 @@ -void HalloLoop() -{ - byte id, key; - goto _HALLO_DRAW; - loop() switch(WaitEvent()) - { - case evButton: - id=GetButtonID(); - if(id == 1) ExitProcess(); - if (id == 11) RunProgram("/sys/htmlv", "http://kolibri-n.org/index.php"); - if (id == 10) GotoInstall(); - break; - case evKey: - key = GetKey(); - if (key == 13) GotoInstall(); - break; - - case evReDraw: _HALLO_DRAW: - if !(DefineWindow("Prepearing installation", "Install")) break; - - HalloWindow(); - break; - } -} - -void HalloWindow() -{ - int free_ram; - unsigned char free_ram_text[256]; - - - WriteTextB(TEXTX, 80, 0x90, 0xCC00CC, "KolibriN 8.2a Upgrade Pack is ready for install."); - DrawLink(TEXTX, 95, 0x90, 11, "http://kolibri-n.org"); - - free_ram = GetFreeRAM()/1024; - strcpy(#free_ram_text, "You have "); - strcat(#free_ram_text, itoa(free_ram)); - strcat(#free_ram_text, " MB of free RAM. You need 100 Mb for installation."); - - WriteText(TEXTX, 140, 0x80, 0, #free_ram_text); - WriteText(TEXTX, 160, 0x80, 0, "Please, close all opened applications before start."); -} - -void GotoInstall() -{ - if (GetFreeRAM()/1024>100) InstallationLoop(); - else notify("You do not have enought free RAM for installation!"); -} \ No newline at end of file diff --git a/programs/cmm/installer/installation.c b/programs/cmm/installer/installation.c deleted file mode 100644 index b3edbbd181..0000000000 --- a/programs/cmm/installer/installation.c +++ /dev/null @@ -1,108 +0,0 @@ - -void InstallationLoop() -{ - byte id, key, started=false; - goto _INSTALL_DRAW; - - loop() switch(WaitEvent()) - { - case evButton: - id=GetButtonID(); - if(id == 1) ExitProcess(); - if (id == 11) RunProgram("/sys/htmlv", "http://kolibri-n.org/donate.php"); - if (id == 10) HalloLoop(); - break; - case evKey: - key = GetKey(); - break; - - case evReDraw: _INSTALL_DRAW: - if !(DefineWindow("Installation Started", "Stop")) break; - if (started) break; - started = true; - Install(); - } -} - - -char iclock[3]={1,2}; -void ShowProgress(dword text1) -{ - iclock[0]>2) return 0; //rolled_up + + DrawBar(0, 0, Form.cwidth, BLACK_H, 0); + _PutImage(BLACK_H-LOGOW/2, BLACK_H-LOGOH/2, LOGOW,LOGOH, #logo); + WriteTextB(BLACK_H-LOGOW + LOGOW, BLACK_H-6/2, 0x90, 0xFFFfff, wtitle); + DrawBar(0, BLACK_H, Form.cwidth, Form.cheight-BLACK_H, 0xFFFfff); + DrawCaptButton(Form.cwidth-107, Form.cheight-40, 90, 24, 10, sc.work_button, sc.work_button_text,wbutton); + return 1; +} + +#include "add_appl_dir.c"; +#include "dialogs.c"; + +void main() +{ + mem_Init(); + InstallationLoop(INSTALL); +} + +char iclock[3]={1,2}; + +void InstallationLoop(int dialog_t) +{ + byte id, key, started=false; + int free_ram; + unsigned char free_ram_text[256]; + + dialog = dialog_t; + goto _DRAW_WIN; + + loop() switch(WaitEvent()) + { + case evButton: + id=GetButtonID(); + if (id == 01) ExitProcess(); + if (id == 11) RunProgram("/sys/htmlv", "http://kolibri-n.org/index.php"); + if (id == 10) + { + if (dialog==INSTALL) InstallationLoop(END); + else if (dialog==END) ExitProcess(); + } + break; + + case evReDraw: + _DRAW_WIN: + if (dialog==INSTALL) + { + if !(DefineWindow("Installation Started", "Stop")) break; + //iclock[0]>2) return 0; //rolled_up - - DrawBar(0, 0, Form.cwidth, BLACK_H, 0); - _PutImage(BLACK_H-LOGOW/2, BLACK_H-LOGOH/2, LOGOW,LOGOH, #logo); - WriteTextB(BLACK_H-LOGOW + LOGOW, BLACK_H-6/2, 0x90, 0xFFFfff, wtitle); - DrawBar(0, BLACK_H, Form.cwidth, Form.cheight-BLACK_H, 0xFFFfff); - DrawCaptButton(Form.cwidth-107, Form.cheight-40, 90, 24, 10, sc.work_button, sc.work_button_text,wbutton); - return 1; -} - - -struct sysdir -{ - char name[64]; - char path[64]; -} sysdir; - - -int SetAddApplDir(dword tName, tPath) -{ - int i; - strcpy(#sysdir.name, tName); - strcpy(#sysdir.path, tPath); - if (sysdir.name[0]=='/') strcpy(#sysdir.name, #sysdir.name+1); - if (sysdir.path[0]=='/') strcpy(#sysdir.path, #sysdir.path+1); - i = strlen(#sysdir.name); - if (sysdir.name[i]=='/') sysdir.name[i]='\0'; - i = strlen(#sysdir.path); - if (sysdir.path[i]=='/') sysdir.path[i]='\0'; - debug(#sysdir.name); - debug(#sysdir.path); - $mov eax, 30 - $mov ebx, 3 - ECX = #sysdir; - $int 0x40 -} - - -#include "tmp_add.c" -#include "hallo.c"; -#include "installation.c"; - -void main() -{ - mem_Init(); - HalloLoop(); -} - - -stop: \ No newline at end of file diff --git a/programs/cmm/installer/tmp_add.c b/programs/cmm/installer/tmp_add.c deleted file mode 100644 index 0db74e6a9a..0000000000 --- a/programs/cmm/installer/tmp_add.c +++ /dev/null @@ -1,38 +0,0 @@ -struct ioctl_struct -{ - dword handle; - dword io_code; - dword input; - dword inp_size; - dword output; - dword out_size; -}; - -struct add_disk_struc -{ - dword DiskSize; // in sectors, 1 sector = 512 bytes. Include FAT service data - unsigned char DiskId; // from 0 to 9 -}; - -ioctl_struct ioctl; -add_disk_struc add_disk; - -int TmpDiskAdd(int disk_id, disk_size) -{ - int driver_handle, driver_rezult; - driver_handle = LoadDriver("tmpdisk"); - if (driver_handle==0) return 7; - - add_disk.DiskId = disk_id; - add_disk.DiskSize = disk_size * 2048; - - ioctl.handle = driver_handle; - ioctl.io_code = 1; - ioctl.input = #add_disk; - ioctl.inp_size = sizeof(add_disk); - ioctl.output = 0; - ioctl.out_size = 0; - - driver_rezult = RuleDriver(#ioctl); - return driver_rezult; -} \ No newline at end of file