Rev 4114 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4113 | leency | 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 | |||
4114 | leency | 11 | #include "add_appl_dir.c"; |
4113 | leency | 12 | |
13 | #define LOGOW 16 |
||
14 | #define LOGOH 16 |
||
4137 | leency | 15 | #define WIN_W 240 |
16 | #define WIN_H 140 |
||
4113 | leency | 17 | |
18 | unsigned char logo[LOGOW*LOGOH*3]= FROM "img\logo.raw"; |
||
4137 | leency | 19 | char iclock[3]={1,2}; |
4113 | leency | 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 | { |
||
4137 | leency | 34 | byte id, started=false; |
4113 | leency | 35 | mem_Init(); |
36 | |||
37 | loop() switch(WaitEvent()) |
||
38 | { |
||
39 | case evButton: |
||
4137 | leency | 40 | if (GetButtonID() == 01) ExitProcess(); |
4113 | leency | 41 | break; |
42 | |||
43 | case evReDraw: |
||
4137 | leency | 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; |
||
4113 | leency | 49 | |
4137 | leency | 50 | _PutImage(Form.cwidth-LOGOW/2, Form.height-LOGOH/2, LOGOW,LOGOH, LOGOW*LOGOH*3*iclock[0]+ #logo); //iclock[0]> |
51 | WriteTextB(-strlen(T_WTITILE)*6+Form.cwidth/2, Form.cheight - 35, 0x90, 0, T_WTITILE); |
||
52 | |||
53 | if (!started) |
||
4113 | leency | 54 | { |
4137 | leency | 55 | started = true; |
56 | if (GetFreeRAM()/1024<15) notify("Too less free ram. May cause problems"); |
||
57 | Install(); |
||
4113 | leency | 58 | } |
59 | } |
||
60 | } |
||
61 | |||
62 | |||
63 | void Install() |
||
64 | { |
||
65 | int i; |
||
4137 | leency | 66 | dword temp; |
4113 | leency | 67 | proc_info Process; |
68 | |||
4137 | leency | 69 | |
70 | for (i=0; i<1000; i++;) |
||
4113 | leency | 71 | { |
72 | GetProcessInfo(#Process, i); |
||
4137 | leency | 73 | if (strcmp(#Process.name, "@ICON")==0) KillProcess(Process.ID); |
4113 | leency | 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"); |
||
4137 | leency | 80 | notify(T_END); |
81 | ExitProcess(); |
||
4113 | leency | 82 | } |
83 | |||
84 | void copyf_Draw_Progress(dword filename) { return; } |
||
85 | |||
86 | |||
87 | stop:1000;>15)> |