snyggebo
Joined: 24 Sep 2008 Posts: 2
|
Posted: Tue Apr 20, 2010 5:52 am Post subject: mcSetFileInfo help please! |
|
|
Hi!
Greetings to all i'm new here...
First thing first: i'm not a programmer nor do i have any experience with programming,
so please be understanding and don't take for granted that i know stuff :)
So the question is:
I am playing around with some old fmcb sources to make an installer that installs
a single file to "mc1:/BEEXEC-SYSTEM" and after the installation i would like it to
protect "BEEXEC-SYSTEM" using mcSetFileInfo... thus my kids can't erase it +
i have an easy way to update their Memorycards.
Tried lots of different stuff but i cant get it to work :(
Note: the code is heavily modified by trial and error method,
and i went with the embeded file method for ease of use.
Regards.
Code: | int Install_Hack(void)
{
int ret; //, i;
// u8 *OSDname;
// char OSD_Path[MAX_PATH];
// char path[MAX_PATH];
// char launch_path[MAX_PATH];
// u8 *cnf_file, *boot_file;
// int cnf_filesize, boot_filesize;
// int custom_cnf = 0;
// int fd, fd2, r, r2;
// char *p;
mcMkDir(1,0, "BEEXEC-SYSTEM");
mcSync(0, NULL, &ret);
//--> test_mcTable = mcDir[i];
//--> test_mcTable.attrFile = 0x8497;
//--> mcSetFileInfo(1, 0, "BEEXEC-SYSTEM", (char *) &test_mcTable, 0x0008)
Print_XY("Updating .....", pos_x, pos_y, MainTextColor, 0.5f, 0.7f);
Draw_Screen();
if (!(Create_File(install_tab[BOOT_ELF], &boot_elf, size_boot_elf)))
{
scr_printf("error creating %s\n", install_tab[BOOT_ELF]);
Print_XY("Klart !", pos_x + 250, pos_y, MainTextColor, 0.5f, 0.7f);
pos_y += FONT_HEIGHT;
Draw_Screen();
return 0;
}
Print_XY("Klart !", pos_x + 250, pos_y, TextGreen, 0.5f, 0.7f);
pos_y += FONT_HEIGHT;
Draw_Screen();
// mcSync(0, NULL, &ret);
return 1;
} |
|
|