KolibriN Installer: temporary overpath of copyf() issues

git-svn-id: svn://kolibrios.org@9505 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2021-12-27 21:44:46 +00:00
parent c2f1ea1b1a
commit d96b3cc4ae
6 changed files with 36 additions and 23 deletions

View File

@ -1 +1 @@
[rbmenu] „¨á¯¥âç¥à ¯à®æ¥áᮢ=/sys/cpu ;<3B> áâனª  á⨫ï=/kolibrios/utils/appearance ;<3B> áâனª  梥⮢=/sys/skincfg ;‘¯«®è­®© ä®­=/sys/media/palitra [01] name=FILES path=/sys/File Managers/EOLITE param= ico=7 x=4 y=21 [02] name=FPLAY path=/kolibrios/media/fplay param= ico=96 x=65 y=21 [03] name=GAMES path=/sys/allgames param= ico=35 x=125 y=21 [04] name=TINYPAD path=/sys/tinypad param= ico=9 x=4 y=96 [05] name=zSEA path=/kolibrios/media/zsea/zsea param= ico=46 x=65 y=96 [06] name=WEBVIEW path=/sys/network/webview param= ico=31 x=125 y=96 ; ========= ; RIGHT TOP ; ========= [10] name=DEBUG path=/SYS/DEVELOP/MTDBG param= ico=39 x=-204 y=21 [11] name=BOARD path=/SYS/DEVELOP/BOARD param= ico=19 x=-140 y=21 [12] name=KPACK path=/SYS/KPACK param= ico=99 x=-77 y=21 [13] name=DIFF path=/sys/develop/diff param= ico=84 x=-203 y=96 [14] name=FASM path=/SYS/DEVELOP/FASM param= ico=10 x=-141 y=96 [15] name=DOCPACK path=/sys/network/webview param=/kolibrios/res/guide/guide.htm ico=8 x=-76 y=96 [16] name=SHELL path=/SYS/SHELL param= ico=1 x=-203 y=166 [17] name=HEXEDIT path=/SYS/DEVELOP/HEED param= ico=22 x=-141 y=166 [18] name=CEDIT path=/sys/develop/cedit param= ico=58 x=-74 y=166 [rbmenu] „¨á¯¥âç¥à ¯à®æ¥áᮢ=/sys/cpu <EFBFBD> áâனª  ¢­¥è­¥£® ¢¨¤ =/kolibrios/utils/appearance ;<3B> áâனª  梥⮢=/sys/skincfg ;‘¯«®è­®© ä®­=/sys/media/palitra [01] name=FILES path=/sys/File Managers/EOLITE param= ico=7 x=4 y=21 [02] name=FPLAY path=/kolibrios/media/fplay param= ico=96 x=65 y=21 [03] name=GAMES path=/sys/allgames param= ico=35 x=125 y=21 [04] name=TINYPAD path=/sys/tinypad param= ico=9 x=4 y=96 [05] name=zSEA path=/kolibrios/media/zsea/zsea param= ico=46 x=65 y=96 [06] name=WEBVIEW path=/sys/network/webview param= ico=31 x=125 y=96 ; ========= ; RIGHT TOP ; ========= [10] name=DEBUG path=/SYS/DEVELOP/MTDBG param= ico=39 x=-204 y=21 [11] name=BOARD path=/SYS/DEVELOP/BOARD param= ico=19 x=-140 y=21 [12] name=KPACK path=/SYS/KPACK param= ico=99 x=-77 y=21 [13] name=DIFF path=/sys/develop/diff param= ico=84 x=-203 y=96 [14] name=FASM path=/SYS/DEVELOP/FASM param= ico=10 x=-141 y=96 [15] name=DOCPACK path=/sys/network/webview param=/kolibrios/res/guide/guide.htm ico=8 x=-76 y=96 [16] name=SHELL path=/SYS/SHELL param= ico=1 x=-203 y=166 [17] name=HEXEDIT path=/SYS/DEVELOP/HEED param= ico=22 x=-141 y=166 [18] name=CEDIT path=/sys/develop/cedit param= ico=58 x=-74 y=166

View File

@ -14,6 +14,10 @@ enum {
FILE_SKIP, FILE_SKIP,
}; };
#define WRITE_ERROR_DEBUG 0
#define WRITE_ERROR_NOTIFY 1
:int writing_error_channel = WRITE_ERROR_DEBUG;
int copy_state = FILE_DEFAULT; int copy_state = FILE_DEFAULT;
:int copyf(dword from1, in1) :int copyf(dword from1, in1)
@ -81,7 +85,7 @@ int copy_state = FILE_DEFAULT;
debugln("Error: CopyFile->CopyFileAtOnce"); debugln("Error: CopyFile->CopyFileAtOnce");
} }
} }
if (error) debug_error(copy_from3, error); if (error) write_error(copy_from3, error);
return error; return error;
} }
@ -93,7 +97,7 @@ int copy_state = FILE_DEFAULT;
if (error = GetDir(#dirbuf, #fcount, from2, DIRS_ONLYREAL)) if (error = GetDir(#dirbuf, #fcount, from2, DIRS_ONLYREAL))
{ {
debugln("Error: CopyFolder->GetDir"); debugln("Error: CopyFolder->GetDir");
debug_error(from2, error); write_error(from2, error);
free(dirbuf); free(dirbuf);
return error; return error;
} }
@ -101,7 +105,7 @@ int copy_state = FILE_DEFAULT;
if (chrnum(in2, '/')>2) && (error = CreateDir(in2)) if (chrnum(in2, '/')>2) && (error = CreateDir(in2))
{ {
debugln("Error: CopyFolder->CreateDir"); debugln("Error: CopyFolder->CreateDir");
debug_error(in2, error); write_error(in2, error);
free(dirbuf); free(dirbuf);
return error; return error;
} }
@ -171,7 +175,7 @@ int copy_state = FILE_DEFAULT;
unsigned char *ERROR_TEXT[]={ unsigned char *ERROR_TEXT[]={
"Code #0 - No error", "Code #0 - No error",
"Error #1 - Base or partition of a hard disk is not defined", "Error #1 - Base or partition of a hard disk is not defined",
"Error #2 - Function isn't supported for this file system", "Error #2 - Function is not supported for this file system",
"Error #3 - Unknown file system", "Error #3 - Unknown file system",
0, 0,
"Error #5 - File or folder not found", "Error #5 - File or folder not found",
@ -188,19 +192,27 @@ int copy_state = FILE_DEFAULT;
"Error #32 - Too many processes", 0}; "Error #32 - Too many processes", 0};
#endif #endif
:dword get_error(int N) :dword get_error(int error_number)
{ {
char error[256]; char error_message[256];
N = fabs(N); error_number = fabs(error_number);
if (N<=33) strcpy(#error, ERROR_TEXT[N]); if (error_number<=33) {
else sprintf(#error,"%d%s",N," - Unknown error number O_o"); strcpy(#error_message, ERROR_TEXT[error_number]);
return #error; } else {
miniprintf(#error_message,"%i - Unknown error number O_o",error_number);
}
return #error_message;
} }
:void debug_error(dword path, error_number) :void write_error(dword path, error_number)
{ {
char notify_message[100];
if (path) debugln(path); if (path) debugln(path);
debugln(get_error(error_number)); debugln(get_error(error_number));
if (writing_error_channel == WRITE_ERROR_NOTIFY) {
miniprintf(#notify_message, "'%s' -E", get_error(error_number));
notify(#notify_message);
}
} }
#endif #endif

View File

@ -902,7 +902,7 @@ inline signed csshexdec(dword text)
return ret; return ret;
} }
:void miniprintf(dword dst, format, insert_line) :dword miniprintf(dword dst, format, insert_line)
{ {
dword in_pos = strchr(format, '%'); dword in_pos = strchr(format, '%');
EBX = ESBYTE[EAX+1]; EBX = ESBYTE[EAX+1];
@ -916,6 +916,7 @@ inline signed csshexdec(dword text)
strcat(dst, itoa(insert_line)); strcat(dst, itoa(insert_line));
strcat(dst, in_pos+2); strcat(dst, in_pos+2);
} }
return dst;
} }
inline cdecl int sprintf(dword buf, format,...) inline cdecl int sprintf(dword buf, format,...)

View File

@ -1,4 +1,4 @@
#define MEMSIZE 1024*160 #define MEMSIZE 1024*60
#include "../lib/gui.h" #include "../lib/gui.h"
#include "../lib/copyf.h" #include "../lib/copyf.h"
@ -38,7 +38,7 @@ void main()
{ {
word btn; word btn;
load_dll(libini, #lib_init,1); load_dll(libini, #lib_init,1);
loop() switch(@WaitEventTimeout(300)) loop() switch(WaitEvent())
{ {
case evButton: case evButton:
btn = GetButtonID(); btn = GetButtonID();
@ -58,10 +58,6 @@ void main()
case evReDraw: case evReDraw:
draw_window(); draw_window();
break; break;
default:
DrawLogo();
DrawLogo();
} }
} }
@ -108,8 +104,12 @@ void DrawLogo()
void EventInstall() void EventInstall()
{ {
ini_set_int stdcall ("/sys/settings/taskbar.ini", "Flags", "Attachment", 0); ini_set_int stdcall ("/sys/settings/taskbar.ini", "Flags", "Attachment", 0);
copyf("/kolibrios/KolibriNext/settings", "/sys/settings"); writing_error_channel = WRITE_ERROR_NOTIFY;
copyf("/kolibrios/KolibriNext", "/sys"); 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");
RestartProcessByName("/sys/@icon", MULTIPLE); RestartProcessByName("/sys/@icon", MULTIPLE);
RestartProcessByName("/sys/@taskbar", SINGLE); RestartProcessByName("/sys/@taskbar", SINGLE);

View File

@ -1,2 +1,2 @@
if tup.getconfig("NO_FASM") ~= "" then return end if tup.getconfig("NO_FASM") ~= "" then return end
tup.rule("default.asm", 'fasm "%f" "%o" ' .. tup.getconfig("KPACK_CMD"), "skin_feol_new.skn") tup.rule("default.asm", 'fasm "%f" "%o" ' .. tup.getconfig("KPACK_CMD"), "feol.skn")

View File

@ -22,7 +22,7 @@ skinlist = {
"Leency/Workbench/Workbench.skn", "Leency/Workbench/Workbench.skn",
"Leency/Yeah/Yeah.skn", "Leency/Yeah/Yeah.skn",
"maxcodehack/blacky/Blacky.skn", "maxcodehack/blacky/Blacky.skn",
"misc/feol/skin_feol_new.skn", "misc/feol/feol.skn",
"misc/loggy/loggy.skn", "misc/loggy/loggy.skn",
"misc/night/night.skn", "misc/night/night.skn",
"misc/subsilv/subsilv.skn", "misc/subsilv/subsilv.skn",