Rev 3440 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3440 | Rev 3444 | ||
---|---|---|---|
1 | void InstallationLoop() |
1 | void InstallationLoop() |
2 | { |
2 | { |
3 | byte id, key, started=false; |
3 | byte id, key, started=false; |
4 | goto _INSTALL_DRAW; |
4 | goto _INSTALL_DRAW; |
5 | 5 | ||
6 | loop() switch(WaitEvent()) |
6 | loop() switch(WaitEvent()) |
7 | { |
7 | { |
8 | case evButton: |
8 | case evButton: |
9 | id=GetButtonID(); |
9 | id=GetButtonID(); |
10 | if(id == 1) ExitProcess(); |
10 | if(id == 1) ExitProcess(); |
11 | if (id == 11) RunProgram("/sys/htmlv", "http://kolibri-n.org/donate.php"); |
11 | if (id == 11) RunProgram("/sys/htmlv", "http://kolibri-n.org/donate.php"); |
12 | if (id == 10) HalloLoop(); |
12 | if (id == 10) HalloLoop(); |
13 | break; |
13 | break; |
14 | case evKey: |
14 | case evKey: |
15 | key = GetKey(); |
15 | key = GetKey(); |
16 | break; |
16 | break; |
17 | 17 | ||
18 | case evReDraw: _INSTALL_DRAW: |
18 | case evReDraw: _INSTALL_DRAW: |
19 | if !(DefineWindow("Installation Started", "Stop")) break; |
19 | if !(DefineWindow("Installation Started", "Stop")) break; |
20 | if (started) break; |
20 | if (started) break; |
21 | started = true; |
21 | started = true; |
22 | Install(); |
22 | Install(); |
23 | } |
23 | } |
24 | } |
24 | } |
25 | 25 | ||
26 | 26 | ||
27 | char iclock[3]={1,2}; |
27 | char iclock[3]={1,2}; |
28 | void ShowProgress(dword text1) |
28 | void ShowProgress(dword text1) |
29 | { |
29 | { |
30 | iclock[0]> |
30 | iclock[0]> |
31 | _PutImage(WIN_W+LOGOW/2, WIN_H+LOGOH/2, LOGOW,LOGOH, LOGOW*LOGOH*3*iclock[0]+ #logo); |
31 | _PutImage(WIN_W+LOGOW/2, WIN_H+LOGOH/2, LOGOW,LOGOH, LOGOW*LOGOH*3*iclock[0]+ #logo); |
32 | if (text1) |
32 | if (text1) |
33 | { |
33 | { |
34 | DrawBar(TEXTX, BLACK_H+30, Form.cwidth-TEXTX, 12, 0xFFFfff); |
34 | DrawBar(TEXTX, BLACK_H+30, Form.cwidth-TEXTX, 12, 0xFFFfff); |
35 | DrawBar(TEXTX, BLACK_H+50, Form.cwidth-TEXTX, 12, 0xFFFfff); |
35 | DrawBar(TEXTX, BLACK_H+50, Form.cwidth-TEXTX, 12, 0xFFFfff); |
36 | WriteText(TEXTX, BLACK_H+30, 0x80, 0, text1); |
36 | WriteText(TEXTX, BLACK_H+30, 0x80, 0, text1); |
37 | } |
37 | } |
38 | } |
38 | } |
39 | 39 | ||
40 | 40 | ||
41 | void Install() |
41 | void Install() |
42 | { |
42 | { |
43 | int i; |
43 | int i; |
44 | proc_info Process; |
44 | proc_info Process; |
45 | 45 | ||
46 | ShowProgress("Mounting virtual disk..."); |
46 | ShowProgress("Mounting virtual disk..."); |
47 | if (TmpDiskAdd(9, 100)!=0) RunProgram("/sys/tmpdisk", "a9s100"); |
47 | if (TmpDiskAdd(9, 100)!=0) RunProgram("/sys/tmpdisk", "a9s100"); |
48 | for (i=2; i<256; i++;) |
48 | for (i=2; i<256; i++;) |
49 | { |
49 | { |
50 | GetProcessInfo(#Process, i); |
50 | GetProcessInfo(#Process, i); |
51 | if (i==Form.ID) || (strchr(#Process.name, '/')) || (strchr(#Process.name, 'Z')) continue; |
51 | if (i==Form.ID) || (strchr(#Process.name, '/')) || (strchr(#Process.name, 'Z')) continue; |
52 | KillProcess(i); |
52 | KillProcess(i); |
53 | } |
53 | } |
54 | //RunProgram("/sys/develop/board", NULL); //temp============ |
54 | //RunProgram("/sys/develop/board", NULL); //temp============ |
55 | RunProgram("/sys/REFRSCRN", NULL); |
55 | RunProgram("/sys/REFRSCRN", NULL); |
56 | pause(100); |
56 | pause(100); |
57 | ShowProgress("Copying files..."); |
57 | ShowProgress("Copying files..."); |
58 | copyf("/sys/docpack", "/tmp9/1/docpack"); |
58 | copyf("/sys/docpack", "/tmp9/1/docpack"); |
59 | DeleteFile("/sys/docpack"); |
59 | DeleteFile("/sys/docpack"); |
60 | copyf(abspath("sys"), "/sys"); |
60 | copyf(abspath("sys"), "/rd/1"); |
61 | copyf(abspath("tmp"), "/tmp9/1"); |
61 | copyf(abspath("tmp"), "/tmp9/1"); |
62 | ShowProgress("Post install actions..."); |
62 | ShowProgress("Post install actions..."); |
63 | RunProgram("/sys/launcher", NULL); |
63 | RunProgram("/sys/launcher", NULL); |
64 | SetSystemSkin("/tmp9/1/skins/latte.skn"); |
64 | SetSystemSkin("/tmp9/1/skins/latte.skn"); |
65 | EndLoop(); |
65 | EndLoop(); |
66 | } |
66 | } |
67 | 67 | ||
68 | void copyf_Action(dword filename) |
68 | void copyf_Action(dword filename) |
69 | { |
69 | { |
70 | if (CheckEvent()==evReDraw) { DefineWindow("Installation Started", "Stop"); ShowProgress("Copying files..."); } |
70 | if (CheckEvent()==evReDraw) { DefineWindow("Installation Started", "Stop"); ShowProgress("Copying files..."); } |
71 | ShowProgress(NULL); |
71 | ShowProgress(NULL); |
72 | DrawBar(TEXTX, BLACK_H+50, Form.cwidth-TEXTX, 12, 0xFFFfff); |
72 | DrawBar(TEXTX, BLACK_H+50, Form.cwidth-TEXTX, 12, 0xFFFfff); |
73 | WriteText(TEXTX, BLACK_H+50, 0x80, 0, filename); |
73 | WriteText(TEXTX, BLACK_H+50, 0x80, 0, filename); |
74 | } |
74 | } |
75 | 75 | ||
76 | 76 | ||
77 | void EndLoop() |
77 | void EndLoop() |
78 | { |
78 | { |
79 | byte id, key; |
79 | byte id, key; |
80 | 80 | ||
81 | goto _END_DRAW; |
81 | goto _END_DRAW; |
82 | 82 | ||
83 | loop() switch(WaitEvent()) |
83 | loop() switch(WaitEvent()) |
84 | { |
84 | { |
85 | case evButton: |
85 | case evButton: |
86 | id=GetButtonID(); |
86 | id=GetButtonID(); |
87 | if(id == 1) ExitProcess(); |
87 | if(id == 1) ExitProcess(); |
88 | if (id == 11) RunProgram("/sys/htmlv", "http://kolibri-n.org/index.php"); |
88 | if (id == 11) RunProgram("/sys/htmlv", "http://kolibri-n.org/index.php"); |
89 | if (id == 10) ExitProcess(); |
89 | if (id == 10) ExitProcess(); |
90 | break; |
90 | break; |
91 | case evKey: |
91 | case evKey: |
92 | key = GetKey(); |
92 | key = GetKey(); |
93 | break; |
93 | break; |
94 | 94 | ||
95 | case evReDraw: _END_DRAW: |
95 | case evReDraw: _END_DRAW: |
96 | if !(DefineWindow("Installation complete", "Exit")) break; |
96 | if !(DefineWindow("Installation complete", "Exit")) break; |
97 | WriteText(TEXTX, BLACK_H*2, 0x80, 0, "KolibriN install complete."); |
97 | WriteText(TEXTX, BLACK_H*2, 0x80, 0, "KolibriN install complete."); |
98 | WriteText(TEXTX, BLACK_H*2+40, 0x80, 0, "I spent a lot of time improving KolibriN, so I hope you'll like it."); |
98 | WriteText(TEXTX, BLACK_H*2+40, 0x80, 0, "I spent a lot of time improving KolibriN, so I hope you'll like it."); |
99 | WriteText(TEXTX, BLACK_H*2+55, 0x80, 0, "Please, donate as much as you can to help me further improve Kolibri,"); |
99 | WriteText(TEXTX, BLACK_H*2+55, 0x80, 0, "Please, donate as much as you can to help me further improve Kolibri,"); |
100 | WriteText(TEXTX, BLACK_H*2+70, 0x80, 0, "the project I love so much. Visit my site for more information:"); |
100 | WriteText(TEXTX, BLACK_H*2+70, 0x80, 0, "the project I love so much. Visit my site for more information:"); |
101 | DrawLink(TEXTX, BLACK_H*2+85, 0x80, 11, "http://kolibri-n.org/donate.php"); |
101 | DrawLink(TEXTX, BLACK_H*2+85, 0x80, 11, "http://kolibri-n.org/donate.php"); |
102 | } |
102 | } |
103 | }256;> |
103 | }256;> |