ZealOS/src/Home/DoDistro.ZC
TomAwezome 5169661ef5 Remove BootHDIns In() input strings for resolution setting since compile-time screen resolution setting has been removed.
TODO: Install scripts still have some remaining code that asks for screen resolution and grabs input, such as bare metal install code section. These sections need to also be updated!
2022-10-12 20:06:33 -04:00

82 lines
2.4 KiB
HolyC
Executable file

//Make Your own Distro by #include-ing this file.
#define STD_DISTRO_DVD_CONFIG "TB\nScale2Mem(2048,0x40000)\nT\n\n\n\n"
U0 MakeMyISO(U8 *_out_iso_filename)
{//Does everything with current drive.
//If you have not recompiled $FG,2$Kernel$FG$ and defined your CD/DVD drive, use $LK,"Mount",A="MN:Mount"$.
U8 *out_iso_filename = FileNameAbs(_out_iso_filename);
I64 line_count = LineRep("/*", "-r") + LineRep("/System/*") + LineRep("/Compiler/*", "-S+$$") + LineRep("/Kernel/*");
if (!DriveIsWritable)
{
"Drive must be writable. Install on Hard drive, first.\n";
return;
}
DocTreeFWrite("/System/Define.ZC", "LineRep", "DefinePrint(\"DD_ZEALOS_LOC\",\"%,d\");\n", line_count);
DefinePrint("DD_ZEALOS_LOC", "%,d", line_count);
"Total LOC:%12,d\n\n", line_count;
DelTree("/Distro");
Del(out_iso_filename);
// Generate all HTML docs before ISO creation.
PopUpRunFile("::/Home/HtmlGen.ZC");
ProgressBarsReset;
progress1_max = 14;
StrCopy(progress1_desc, "Copying files to /Distro");
DirMake("/Distro");
In(STD_DISTRO_DVD_CONFIG);
BootDVDIns;
progress1++;
Copy("/*", "/Distro");
progress1++;
DirMake("/Distro" BOOT_DIR);
Move(BOOT_DIR_DVD_KERNEL_ZXE, "/Distro" BOOT_DIR_KERNEL_ZXE);
progress1++;
CopyTree("/Home", "/Distro/Home");
progress1++;
Del("/Distro/Home/Registry.ZC");
CopyTree("/System", "/Distro/System");
progress1++;
CopyTree("/Apps", "/Distro/Apps");
progress1++;
CopyTree("/Compiler", "/Distro/Compiler");
progress1++;
CopyTree("/Demo", "/Distro/Demo");
progress1++;
CopyTree("/Doc", "/Distro/Doc");
progress1++;
CopyTree("/Kernel", "/Distro/Kernel");
progress1++;
CopyTree("/Misc", "/Distro/Misc");
progress1++;
//To save space, optionally delete dictionary.
//Del("/Distro/System/AutoComplete/ACDefs.DATA");
CopyTree("/Downloads", "/Distro/Downloads"); //You can leave this out.
progress1++;
DirMake("/Distro/Tmp");
DirMake("/Distro/Tmp/ScreenShots");
progress1++;
StrCopy(progress1_desc, "Building ISO");
RedSeaISO(out_iso_filename, "/Distro", "/Distro" BOOT_DIR_KERNEL_ZXE);
progress1++;
//If CD-ROM use MT_CD instead of MT_DVD.
//DVDImageWrite('T',out_iso_filename,MT_DVD); //Uncomment to burn.
DelTree("/Distro");
ProgressBarsReset;
Free(out_iso_filename);
}
MakeMyISO("/Tmp/MyDistro.ISO.C");
// Study the account examples $LK,"Config Strs",A="FL:::/Demo/AcctExample/TOS/TOSConfig.ZC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOS/TOSDistro.ZC,1"$.