2021-12-27 22:44:46 +01:00
|
|
|
|
#define MEMSIZE 1024*60
|
2019-05-14 15:07:29 +02:00
|
|
|
|
|
2019-05-20 12:40:10 +02:00
|
|
|
|
#include "../lib/gui.h"
|
|
|
|
|
#include "../lib/copyf.h"
|
2019-05-21 20:04:27 +02:00
|
|
|
|
|
2019-05-20 12:40:10 +02:00
|
|
|
|
#include "../lib/obj/libini.h"
|
2019-05-21 20:04:27 +02:00
|
|
|
|
|
2019-05-20 12:40:10 +02:00
|
|
|
|
#include "../lib/patterns/restart_process.h"
|
2019-05-14 15:07:29 +02:00
|
|
|
|
|
2019-05-20 12:40:10 +02:00
|
|
|
|
char logo[] = "
|
2022-01-15 14:39:39 +01:00
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
|
|
|
|
|
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2019-05-20 12:40:10 +02:00
|
|
|
|
";
|
|
|
|
|
|
2019-05-21 20:04:27 +02:00
|
|
|
|
#ifdef LANG_RUS
|
2022-01-15 14:39:39 +01:00
|
|
|
|
#define T_INTRO "<22><><EFBFBD><EFBFBD><E0AEA1><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>㠫쭮<E3A0AB> <20><><EFBFBD>ଫ<EFBFBD><E0ACAB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> ࠭<><E0A0AD><EFBFBD> <20>뫮 <20><><EFBFBD><EFBFBD>㯭<EFBFBD> ⮫쪮 <20> KolibriNext.";
|
|
|
|
|
#define T_INSTALL "<22><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD>"
|
|
|
|
|
#define T_COMPLETE "<22><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD>"
|
|
|
|
|
#define T_EXIT "<22><>室"
|
2019-05-21 20:04:27 +02:00
|
|
|
|
#else
|
|
|
|
|
#define T_INTRO "Try a new visual design of KolibriOS, which previously was available only in KolibriNext.";
|
|
|
|
|
#define T_INSTALL "Install"
|
|
|
|
|
#define T_COMPLETE "Install complete"
|
|
|
|
|
#define T_EXIT "Exit"
|
|
|
|
|
#endif
|
2019-05-20 12:40:10 +02:00
|
|
|
|
|
|
|
|
|
#define B_INSTALL 10
|
2020-11-29 20:08:52 +01:00
|
|
|
|
#define B_EXIT 11
|
2019-05-14 15:07:29 +02:00
|
|
|
|
|
2019-05-21 20:04:27 +02:00
|
|
|
|
bool install_complete = false;
|
|
|
|
|
|
2019-05-14 15:07:29 +02:00
|
|
|
|
void main()
|
2019-05-20 12:40:10 +02:00
|
|
|
|
{
|
|
|
|
|
word btn;
|
2021-12-31 01:19:27 +01:00
|
|
|
|
saved_state = FILE_REPLACE;
|
2019-05-20 12:40:10 +02:00
|
|
|
|
load_dll(libini, #lib_init,1);
|
2021-12-27 22:44:46 +01:00
|
|
|
|
loop() switch(WaitEvent())
|
2019-05-20 12:40:10 +02:00
|
|
|
|
{
|
|
|
|
|
case evButton:
|
|
|
|
|
btn = GetButtonID();
|
2020-11-29 20:08:52 +01:00
|
|
|
|
if (btn == 1) || (B_EXIT == btn) ExitProcess();
|
|
|
|
|
if (B_INSTALL == btn) EventInstall();
|
2019-05-20 12:40:10 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evKey:
|
|
|
|
|
GetKeys();
|
|
|
|
|
if (key_scancode == SCAN_CODE_ESC) ExitProcess();
|
2019-05-21 20:04:27 +02:00
|
|
|
|
if (key_scancode == SCAN_CODE_ENTER) {
|
|
|
|
|
if (install_complete) ExitProcess();
|
|
|
|
|
else EventInstall();
|
|
|
|
|
}
|
2019-05-20 12:40:10 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evReDraw:
|
|
|
|
|
draw_window();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#define WINW 400
|
|
|
|
|
#define WINH 300
|
|
|
|
|
void draw_window()
|
|
|
|
|
{
|
2020-04-18 01:52:24 +02:00
|
|
|
|
sc.get();
|
2022-01-08 20:52:20 +01:00
|
|
|
|
DefineAndDrawWindow(screen.w-WINW/2,screen.h-WINH/2,
|
|
|
|
|
WINW+9,WINH+skin_h,0x34,sc.work,"KolibriN10",0);
|
2019-05-20 12:40:10 +02:00
|
|
|
|
DrawLogo();
|
2019-05-21 20:04:27 +02:00
|
|
|
|
if (install_complete) DrawInstallComplete(); else DrawIntro();
|
|
|
|
|
}
|
2019-05-20 12:40:10 +02:00
|
|
|
|
|
2019-05-21 20:04:27 +02:00
|
|
|
|
void DrawIntro()
|
|
|
|
|
{
|
2019-05-20 12:40:10 +02:00
|
|
|
|
DrawTextViewArea(30, 140, WINW-60, WINH-80,
|
2020-04-18 01:52:24 +02:00
|
|
|
|
T_INTRO, -1, sc.work_text);
|
2019-05-20 12:40:10 +02:00
|
|
|
|
DrawCaptButton(WINW-110/2, WINH-70, 110, 28, B_INSTALL,
|
2019-05-21 20:04:27 +02:00
|
|
|
|
0x0092D8, 0xFFFfff, T_INSTALL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrawInstallComplete()
|
|
|
|
|
{
|
2021-12-18 16:21:21 +01:00
|
|
|
|
draw_icon_32(WINW-32/2, 140, sc.work, 49);
|
2020-04-18 01:52:24 +02:00
|
|
|
|
WriteTextCenter(0,185, WINW, sc.work_text, T_COMPLETE);
|
2020-11-29 20:08:52 +01:00
|
|
|
|
DrawCaptButton(WINW-110/2, WINH-70, 110, 28, B_EXIT,
|
2019-05-21 20:04:27 +02:00
|
|
|
|
0x0092D8, 0xFFFfff, T_EXIT);
|
2019-05-20 12:40:10 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrawLogo()
|
|
|
|
|
{
|
|
|
|
|
#define LX -46*6+WINW/2
|
|
|
|
|
#define LY 25
|
2019-05-21 20:04:27 +02:00
|
|
|
|
WriteTextLines(LX-2, LY, 0x80, 0xF497C0, #logo, 9);
|
2019-05-20 12:40:10 +02:00
|
|
|
|
WriteTextLines(LX+3, LY, 0x80, 0x7ED1E3, #logo, 9);
|
|
|
|
|
|
|
|
|
|
pause(1);
|
|
|
|
|
|
|
|
|
|
WriteTextLines(LX+1, LY, 0x80, 0xEC008C, #logo, 9);
|
|
|
|
|
WriteTextLines(LX, LY, 0x80, 0xEC008C, #logo, 9);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EventInstall()
|
2019-05-14 15:07:29 +02:00
|
|
|
|
{
|
|
|
|
|
ini_set_int stdcall ("/sys/settings/taskbar.ini", "Flags", "Attachment", 0);
|
2021-12-27 22:44:46 +01:00
|
|
|
|
writing_error_channel = WRITE_ERROR_NOTIFY;
|
|
|
|
|
copy_state = FILE_REPLACE;
|
|
|
|
|
//if (copyf("/kolibrios/KolibriNext/settings", "/sys/settings")) return;
|
|
|
|
|
CopyFile("/kolibrios/KolibriNext/settings/app_plus.ini", "/sys/settings/app_plus.ini");
|
|
|
|
|
CopyFile("/kolibrios/KolibriNext/settings/docky.ini", "/sys/settings/docky.ini");
|
|
|
|
|
CopyFile("/kolibrios/KolibriNext/settings/icon.ini", "/sys/settings/icon.ini");
|
2019-05-14 15:07:29 +02:00
|
|
|
|
|
|
|
|
|
RestartProcessByName("/sys/@icon", MULTIPLE);
|
|
|
|
|
RestartProcessByName("/sys/@taskbar", SINGLE);
|
|
|
|
|
RestartProcessByName("/sys/@docky", SINGLE);
|
|
|
|
|
|
|
|
|
|
RunProgram("/sys/media/kiv", "\\S__/kolibrios/res/Wallpapers/Free yourself.jpg");
|
2019-05-21 20:04:27 +02:00
|
|
|
|
|
|
|
|
|
install_complete = true;
|
2021-11-28 00:03:47 +01:00
|
|
|
|
|
|
|
|
|
pause(150);
|
|
|
|
|
ActivateWindow_Self();
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-31 16:37:09 +02:00
|
|
|
|
void Operation_Draw_Progress(dword filename) { }
|