2013-03-11 19:16:24 +01:00
|
|
|
|
|
|
|
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]><iclock[1];
|
|
|
|
_PutImage(WIN_W+LOGOW/2, WIN_H+LOGOH/2, LOGOW,LOGOH, LOGOW*LOGOH*3*iclock[0]+ #logo);
|
|
|
|
if (text1)
|
|
|
|
{
|
|
|
|
DrawBar(TEXTX, BLACK_H+30, Form.cwidth-TEXTX, 12, 0xFFFfff);
|
|
|
|
DrawBar(TEXTX, BLACK_H+50, Form.cwidth-TEXTX, 12, 0xFFFfff);
|
|
|
|
WriteText(TEXTX, BLACK_H+30, 0x80, 0, text1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Install()
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
proc_info Process;
|
|
|
|
|
|
|
|
ShowProgress("Mounting virtual disk...");
|
|
|
|
if (TmpDiskAdd(9, 100)!=0) RunProgram("/sys/tmpdisk", "a9s100");
|
|
|
|
for (i=2; i<256; i++;)
|
|
|
|
{
|
|
|
|
GetProcessInfo(#Process, i);
|
|
|
|
if (i==Form.ID) || (strchr(#Process.name, '/')) || (strchr(#Process.name, 'Z')) continue;
|
|
|
|
KillProcess(i);
|
|
|
|
}
|
2013-04-02 15:33:32 +02:00
|
|
|
//RunProgram("/sys/develop/board", NULL); //temp============
|
2013-03-11 19:16:24 +01:00
|
|
|
RunProgram("/sys/REFRSCRN", NULL);
|
|
|
|
pause(100);
|
|
|
|
ShowProgress("Copying files...");
|
2013-04-02 15:33:32 +02:00
|
|
|
copyf("/sys/docpack", "/tmp9/1/docpack");
|
2013-03-11 19:16:24 +01:00
|
|
|
DeleteFile("/sys/docpack");
|
2013-04-04 19:07:38 +02:00
|
|
|
copyf(abspath("sys"), "/rd/1");
|
2013-04-02 15:33:32 +02:00
|
|
|
copyf(abspath("tmp"), "/tmp9/1");
|
2013-03-11 19:16:24 +01:00
|
|
|
ShowProgress("Post install actions...");
|
|
|
|
RunProgram("/sys/launcher", NULL);
|
|
|
|
SetSystemSkin("/tmp9/1/skins/latte.skn");
|
|
|
|
EndLoop();
|
|
|
|
}
|
|
|
|
|
2013-03-31 22:25:54 +02:00
|
|
|
void copyf_Action(dword filename)
|
|
|
|
{
|
|
|
|
if (CheckEvent()==evReDraw) { DefineWindow("Installation Started", "Stop"); ShowProgress("Copying files..."); }
|
|
|
|
ShowProgress(NULL);
|
|
|
|
DrawBar(TEXTX, BLACK_H+50, Form.cwidth-TEXTX, 12, 0xFFFfff);
|
|
|
|
WriteText(TEXTX, BLACK_H+50, 0x80, 0, filename);
|
|
|
|
}
|
|
|
|
|
2013-03-11 19:16:24 +01:00
|
|
|
|
|
|
|
void EndLoop()
|
|
|
|
{
|
|
|
|
byte id, key;
|
|
|
|
|
|
|
|
goto _END_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) ExitProcess();
|
|
|
|
break;
|
|
|
|
case evKey:
|
|
|
|
key = GetKey();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case evReDraw: _END_DRAW:
|
|
|
|
if !(DefineWindow("Installation complete", "Exit")) break;
|
|
|
|
WriteText(TEXTX, BLACK_H*2, 0x80, 0, "KolibriN install complete.");
|
|
|
|
WriteText(TEXTX, BLACK_H*2+40, 0x80, 0, "I spent a lot of time improving KolibriN, so I hope you'll like it.");
|
|
|
|
WriteText(TEXTX, BLACK_H*2+55, 0x80, 0, "Please, donate as much as you can to help me further improve Kolibri,");
|
|
|
|
WriteText(TEXTX, BLACK_H*2+70, 0x80, 0, "the project I love so much. Visit my site for more information:");
|
|
|
|
DrawLink(TEXTX, BLACK_H*2+85, 0x80, 11, "http://kolibri-n.org/donate.php");
|
|
|
|
}
|
|
|
|
}
|