Rev 4137 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4137 | Rev 4407 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #define MEMSIZE 0xA1000 |
1 | #define MEMSIZE 0xA1000 |
2 | #include "..\lib\kolibri.h" |
2 | #include "..\lib\kolibri.h" |
3 | #include "..\lib\strings.h" |
3 | #include "..\lib\strings.h" |
4 | #include "..\lib\figures.h" |
- | |
5 | #include "..\lib\encoding.h" |
- | |
6 | #include "..\lib\file_system.h" |
4 | #include "..\lib\file_system.h" |
7 | #include "..\lib\mem.h" |
5 | #include "..\lib\mem.h" |
8 | #include "..\lib\dll.h" |
- | |
9 | #include "..\lib\copyf.h" |
6 | #include "..\lib\copyf.h" |
Line 10... | Line 7... | ||
10 | 7 | ||
Line 11... | Line -... | ||
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; |
8 | #include "add_appl_dir.c"; |
23 | 9 | ||
24 | #ifdef LANG_RUS |
10 | #ifdef LANG_RUS |
- | 11 | ?define T_WTITILE "Установка Kolibri N9" |
|
25 | ?define T_WTITILE "Установка Kolibri N9" |
12 | ?define T_END "Установка KolibriN успешно завершена." |
26 | ?define T_END "Установка KolibriN успешно завершена." |
13 | ?define T_LESS_RAM "Мало свободной оперативной памяти. Могут возникнуть проблемы" |
27 | #else |
14 | #else |
- | 15 | ?define T_WTITILE "Kolibri N9 Setup" |
|
28 | ?define T_WTITILE "Kolibri N9 Setup" |
16 | ?define T_END "KolibriN install complete." |
Line 29... | Line 17... | ||
29 | ?define T_END "KolibriN install complete." |
17 | ?define T_LESS_RAM "Too less free ram. May cause problems" |
30 | #endif |
18 | #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]> |
- | |
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 | 19 | ||
63 | void Install() |
- | |
64 | { |
20 | void main() |
Line -... | Line 21... | ||
- | 21 | { |
|
- | 22 | int i; |
|
Line 65... | Line 23... | ||
65 | int i; |
23 | proc_info Process; |
66 | dword temp; |
24 | |
67 | proc_info Process; |
25 | mem_Init(); |
68 | 26 | if (GetFreeRAM()/1024<15) notify(T_LESS_RAM); |
|
69 | 27 | ||
70 | for (i=0; i<1000; i++;) |
28 | for (i=0; i<1000; i++;) |
71 | { |
29 | { |
72 | GetProcessInfo(#Process, i); |
30 | GetProcessInfo(#Process, i); |
73 | if (strcmp(#Process.name, "@ICON")==0) KillProcess(Process.ID); |
31 | if (strcmp(#Process.name, "@ICON")==0) KillProcess(Process.ID); |
74 | } |
32 | } |
- | 33 | SetAddApplDir("kolibrios", abspath("kolibrios")+1); |
|
- | 34 | RunProgram("/sys/REFRSCRN", NULL); |
|
75 | SetAddApplDir("kolibrios", abspath("kolibrios")+1); |
35 | copyf(abspath("sys"), "/rd/1"); |
76 | RunProgram("/sys/REFRSCRN", NULL); |
36 | RunProgram("/sys/launcher", NULL); |
77 | copyf(abspath("sys"), "/rd/1"); |
37 | SetSystemSkin("/kolibrios/res/skins/Octo - flat.skn"); |
Line -... | Line 38... | ||
- | 38 | DeleteFile("/sys/3d/free3d04"); |
|
78 | RunProgram("/sys/launcher", NULL); |
39 | DeleteFile("/sys/games/invaders"); |
Line 79... | Line 40... | ||
79 | SetSystemSkin("/kolibrios/skins/latte.skn"); |
40 | notify(T_END); |
80 | notify(T_END); |
41 | ExitProcess(); |