2013-10-27 12:59:02 +01:00
|
|
|
#define MEMSIZE 0xA1000
|
|
|
|
#include "..\lib\kolibri.h"
|
|
|
|
#include "..\lib\strings.h"
|
|
|
|
#include "..\lib\figures.h"
|
|
|
|
#include "..\lib\encoding.h"
|
|
|
|
#include "..\lib\file_system.h"
|
|
|
|
#include "..\lib\mem.h"
|
|
|
|
#include "..\lib\dll.h"
|
|
|
|
#include "..\lib\copyf.h"
|
|
|
|
|
2013-10-27 13:05:04 +01:00
|
|
|
#include "add_appl_dir.c";
|
2013-10-27 12:59:02 +01:00
|
|
|
|
|
|
|
#define LOGOW 16
|
|
|
|
#define LOGOH 16
|
2013-10-30 02:12:01 +01:00
|
|
|
#define WIN_W 240
|
|
|
|
#define WIN_H 140
|
2013-10-27 12:59:02 +01:00
|
|
|
|
|
|
|
unsigned char logo[LOGOW*LOGOH*3]= FROM "img\logo.raw";
|
2013-10-30 02:12:01 +01:00
|
|
|
char iclock[3]={1,2};
|
2013-10-27 12:59:02 +01:00
|
|
|
|
|
|
|
proc_info Form;
|
|
|
|
system_colors sc;
|
|
|
|
|
|
|
|
#ifdef LANG_RUS
|
|
|
|
?define T_WTITILE "Установка Kolibri N9"
|
|
|
|
?define T_END "Установка KolibriN успешно завершена."
|
|
|
|
#else
|
|
|
|
?define T_WTITILE "Kolibri N9 Setup"
|
|
|
|
?define T_END "KolibriN install complete."
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2013-10-30 02:12:01 +01:00
|
|
|
byte id, started=false;
|
2013-10-27 12:59:02 +01:00
|
|
|
mem_Init();
|
|
|
|
|
|
|
|
loop() switch(WaitEvent())
|
|
|
|
{
|
|
|
|
case evButton:
|
2013-10-30 02:12:01 +01:00
|
|
|
if (GetButtonID() == 01) ExitProcess();
|
2013-10-27 12:59:02 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case evReDraw:
|
2013-10-30 02:12:01 +01:00
|
|
|
sc.get();
|
|
|
|
DefineAndDrawWindow(GetScreenWidth()-WIN_W/2,GetScreenHeight()-WIN_H/2-30, WIN_W+9, WIN_H+GetSkinHeight()+4,
|
|
|
|
0x34,0xFFFfff,T_WTITILE);
|
|
|
|
GetProcessInfo(#Form, SelfInfo);
|
|
|
|
if (Form.status_window>2) break;
|
2013-10-27 12:59:02 +01:00
|
|
|
|
2013-10-30 02:12:01 +01:00
|
|
|
_PutImage(Form.cwidth-LOGOW/2, Form.height-LOGOH/2, LOGOW,LOGOH, LOGOW*LOGOH*3*iclock[0]+ #logo); //iclock[0]><iclock[1];
|
|
|
|
WriteTextB(-strlen(T_WTITILE)*6+Form.cwidth/2, Form.cheight - 35, 0x90, 0, T_WTITILE);
|
|
|
|
|
|
|
|
if (!started)
|
2013-10-27 12:59:02 +01:00
|
|
|
{
|
2013-10-30 02:12:01 +01:00
|
|
|
started = true;
|
|
|
|
if (GetFreeRAM()/1024<15) notify("Too less free ram. May cause problems");
|
|
|
|
Install();
|
2013-10-27 12:59:02 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Install()
|
|
|
|
{
|
|
|
|
int i;
|
2013-10-30 02:12:01 +01:00
|
|
|
dword temp;
|
2013-10-27 12:59:02 +01:00
|
|
|
proc_info Process;
|
|
|
|
|
2013-10-30 02:12:01 +01:00
|
|
|
|
|
|
|
for (i=0; i<1000; i++;)
|
2013-10-27 12:59:02 +01:00
|
|
|
{
|
|
|
|
GetProcessInfo(#Process, i);
|
2013-10-30 02:12:01 +01:00
|
|
|
if (strcmp(#Process.name, "@ICON")==0) KillProcess(Process.ID);
|
2013-10-27 12:59:02 +01:00
|
|
|
}
|
|
|
|
SetAddApplDir("kolibrios", abspath("kolibrios")+1);
|
|
|
|
RunProgram("/sys/REFRSCRN", NULL);
|
|
|
|
copyf(abspath("sys"), "/rd/1");
|
|
|
|
RunProgram("/sys/launcher", NULL);
|
|
|
|
SetSystemSkin("/kolibrios/skins/latte.skn");
|
2013-10-30 02:12:01 +01:00
|
|
|
notify(T_END);
|
|
|
|
ExitProcess();
|
2013-10-27 12:59:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void copyf_Draw_Progress(dword filename) { return; }
|
|
|
|
|
|
|
|
|
|
|
|
stop:
|