Subversion Repositories Kolibri OS

Rev

Rev 4114 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. #define MEMSIZE 0xA1000
  2. #include "..\lib\kolibri.h"
  3. #include "..\lib\strings.h"
  4. #include "..\lib\figures.h"
  5. #include "..\lib\encoding.h"
  6. #include "..\lib\file_system.h"
  7. #include "..\lib\mem.h"
  8. #include "..\lib\dll.h"
  9. #include "..\lib\copyf.h"
  10.  
  11. #include "add_appl_dir.c";
  12.  
  13. #define LOGOW 16
  14. #define LOGOH 16
  15. #define WIN_W 240
  16. #define WIN_H 140
  17.  
  18. unsigned char logo[LOGOW*LOGOH*3]= FROM "img\logo.raw";
  19. char iclock[3]={1,2};
  20.  
  21. proc_info Form;
  22. system_colors sc;
  23.  
  24. #ifdef LANG_RUS
  25.         ?define T_WTITILE "Установка Kolibri N9"
  26.         ?define T_END "Установка KolibriN успешно завершена."
  27. #else
  28.         ?define T_WTITILE "Kolibri N9 Setup"
  29.         ?define T_END "KolibriN install complete."
  30. #endif
  31.  
  32. void main()
  33. {
  34.         byte id, started=false;
  35.         mem_Init();
  36.    
  37.         loop() switch(WaitEvent())
  38.         {                                                  
  39.                         case evButton:
  40.                                         if (GetButtonID() == 01) ExitProcess();
  41.                                         break;
  42.                                        
  43.                         case evReDraw:
  44.                                         sc.get();
  45.                                         DefineAndDrawWindow(GetScreenWidth()-WIN_W/2,GetScreenHeight()-WIN_H/2-30, WIN_W+9, WIN_H+GetSkinHeight()+4,
  46.                                         0x34,0xFFFfff,T_WTITILE);
  47.                                         GetProcessInfo(#Form, SelfInfo);
  48.                                         if (Form.status_window>2) break;
  49.  
  50.                                         _PutImage(Form.cwidth-LOGOW/2, Form.height-LOGOH/2, LOGOW,LOGOH, LOGOW*LOGOH*3*iclock[0]+ #logo); //iclock[0]><iclock[1];
  51.                                         WriteTextB(-strlen(T_WTITILE)*6+Form.cwidth/2, Form.cheight - 35, 0x90, 0, T_WTITILE);
  52.  
  53.                                         if (!started)
  54.                                         {
  55.                                                 started = true;
  56.                                                 if (GetFreeRAM()/1024<15) notify("Too less free ram. May cause problems");
  57.                                                 Install();
  58.                                         }
  59.         }
  60. }
  61.  
  62.  
  63. void Install()
  64. {
  65.         int i;
  66.         dword temp;
  67.         proc_info Process;
  68.  
  69.  
  70.         for (i=0; i<1000; i++;)
  71.         {
  72.                 GetProcessInfo(#Process, i);
  73.                 if (strcmp(#Process.name, "@ICON")==0) KillProcess(Process.ID);
  74.         }
  75.         SetAddApplDir("kolibrios", abspath("kolibrios")+1);
  76.         RunProgram("/sys/REFRSCRN", NULL);
  77.         copyf(abspath("sys"), "/rd/1");
  78.         RunProgram("/sys/launcher", NULL);
  79.         SetSystemSkin("/kolibrios/skins/latte.skn");
  80.         notify(T_END);
  81.         ExitProcess();
  82. }
  83.  
  84. void copyf_Draw_Progress(dword filename) { return; }
  85.  
  86.  
  87. stop: