kolibrios-gitea/programs/cmm/installer/install.c
Kirill Lipatov (Leency) e1a32382fd @taskbar: remove set ButtonStyle feature as duplication of eskin
KolibriN Install update

git-svn-id: svn://kolibrios.org@7660 a494cfbc-eb01-0410-851d-a64ba20cac60
2019-05-20 10:40:10 +00:00

97 lines
2.4 KiB
C
Raw Blame History

#define MEMSIZE 1024*160
#include "../lib/io.h"
#include "../lib/gui.h"
#include "../lib/copyf.h"
#include "../lib/obj/libini.h"
#include "../lib/patterns/restart_process.h"
char logo[] = "
ÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛÛÛÛÛ
ÛÛÛÛ ÛÛ ÛÛÛ ÛÛÛ ÛÛÛ ÛÛ ÛÛÛ ÛÛ
ÛÛÛÛÛ ÛÛ ÛÛÛ ÛÛÛÛÛ ÛÛ ÛÛÛ ÛÛ
ÛÛ ÛÛÛ ÛÛ ÛÛÛÛÛÛÛ ÛÛÛ ÛÛÛ
ÛÛ ÛÛÛÛÛ ÛÛÛ ÛÛÛÛÛ ÛÛÛ
ÛÛ ÛÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛ
ÛÛÛÛ ÛÛÛ ÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ
";
char intro[] = "<EFBFBD>®¯à®¡ã©â¥ ­®¢®¥ ¢¨§ã «ì­®¥ ®ä®à¬«¥­¨¥ Š®«¨¡à¨, ª®â®à®¥ à ­ìè¥ ¡ë«® ¤®áâ㯭® ⮫쪮 ¢ KolibriNext.";
#define B_INSTALL 10
void main()
{
word btn;
load_dll(libini, #lib_init,1);
loop() switch(WaitEventTimeout(300) & 0xFF)
{
case evButton:
btn = GetButtonID();
if (btn == 1) ExitProcess();
if (btn == B_INSTALL) EventInstall();
break;
case evKey:
GetKeys();
if (key_scancode == SCAN_CODE_ESC) ExitProcess();
break;
case evReDraw:
draw_window();
break;
default:
DrawLogo();
DrawLogo();
}
}
#define WINW 400
#define WINH 300
void draw_window()
{
system.color.get();
DefineAndDrawWindow(screen.width-WINW/2,screen.height-WINH/2,
WINW+9,WINH+skin_height,0x34,system.color.work,"KolibriN10",0);
DrawLogo();
DrawTextViewArea(30, 140, WINW-60, WINH-80,
#intro, -1, system.color.work_text);
DrawCaptButton(WINW-110/2, WINH-70, 110, 28, B_INSTALL,
0x0092D8, 0xFFFfff, "“áâ ­®¢¨âì");
}
void DrawLogo()
{
#define LX -46*6+WINW/2
#define LY 25
WriteTextLines(LX-1, LY, 0x80, 0x9F87B8, #logo, 9);
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()
{
//#include "..\lib\added_sysdir.c";
//SetAdditionalSystemDirectory("kolibrios", abspath("install/kolibrios")+1);
ini_set_int stdcall ("/sys/settings/taskbar.ini", "Flags", "Attachment", 0);
copyf("/kolibrios/KolibriNext/settings", "/sys/settings");
RestartProcessByName("/sys/@icon", MULTIPLE);
RestartProcessByName("/sys/@taskbar", SINGLE);
RestartProcessByName("/sys/@docky", SINGLE);
RunProgram("/sys/media/kiv", "\\S__/kolibrios/res/Wallpapers/Free yourself.jpg");
}
void Operation_Draw_Progress(dword filename) { debug("copying: "); debugln(filename); }