?? dos 6.22.c
字號:
}
else if(flag == 3){
buttonDown(275,225,490,255,"Install Tools");
delay(150);
buttonUp(275,225,490,255,"Install Tools");
delay(150);
installTools();
}
else if(flag == 4){
buttonDown(275,260,490,290,"Install My Dos");
delay(150);
buttonUp(275,260,490,290,"Install My Dos");
delay(150);
installMyDos();
}
break;
case ESC : closegraph();
exit(1); break;
case F1 : helpmessage(); break;
default : Redo = 'Y';
}
}
} void quittodos(void){
buttonDown(275,330,490,360,"Exit");
delay(150);
buttonUp(275,330,490,360,"Exit");
delay(150);
closeDrv();
exit(1);
} void findfile(char * fp){
FILE * file;
if((file = fopen(fp,"rb")) == NULL){
draw_win_3D(200,160,450,315,1,"Error",4);
setcolor(0);
int x = ctextx(200,450,"Cannot find file");
int y = ctexty(160,315);
outtextxy(x,y - 10,"Cannot find file");
setcolor(4);
x = ctextx(200,450,fp);
outtextxy(x,y,fp);
auto_line(205,275,445,275);
buttonselect(284,285,365,306,"Continue");
getch();
buttonDown(284,285,365,305,"Continue");
delay(150);
buttonselect(284,285,365,306,"Continue");
delay(150);
programemain();
}
fclose(file);
} void helpmessage(void){
draw_win_3D(200,160,450,315,1,"About BootDisk",2);
setcolor(0);
int x = ctextx(200,450,"BootDisk Version 2000");
outtextxy(x,200,"BootDisk Version 2000");
outtextxy(x,210," by GoodJob studio ");
outtextxy(x,220," writer Yu Sheng ");
setcolor(9);
outtextxy(x-20,245,"Email Address:");
outtextxy(x+30,255,"goldyu@online.sh.cn");
auto_line(205,275,445,275);
buttonselect(284,285,365,306,"Continue");
getch();
buttonDown(284,285,365,305,"Continue");
delay(150);
buttonselect(284,285,365,306,"Continue");
delay(150);
programemain();
} void programemain(void){
mainmenu();
select();
} void fnf(void){
draw_win_3D(200,160,450,315,1,"Error",4);
setcolor(0);
int x = ctextx(200,450,"Cannot find file format.com");
int y = ctexty(160,310);
outtextxy(x,y,"Cannot find file format.com");
auto_line(205,275,445,275);
buttonselect(284,285,365,306,"Continue");
getch();
buttonDown(284,285,365,305,"Continue");
delay(150);
buttonselect(284,285,365,306,"Continue");
delay(150);
programemain();
} void fhd(void){
FILE * fp;
if((fp = fopen("Format.com","rb")) == NULL){
fnf();
}
else{
closeDrv();
system("format c:/q/u/s/v:GoodJob");
initDrv();
programemain();
}
fclose(fp);
} void installDos(void){
draw_win_3D(150,140,500,315,1,"Install Dos",2);
int x = ctextx(160,490,"Please wait a moment.");
setcolor(0);
outtextxy(x,180,"Please wait a moment");
x = ctextx(160,490,"it will updata your computer system");
outtextxy(x,195,"it will updata your computer system");
outtextxy(163,210,"After that,it will install MS-DOS on your");
outtextxy(163,225,"computer,it takes you only a few minutes.");
setcolor(1);
enoughspace();
searchDospath();
findfile("mscdex.exe");
x = ctextx(160,490,"Source File A:\\mscdex.exe");
outtextxy(x,240,"Source File A:\\mscdex.exe");
x = ctextx(160,490,"To C:\\dos\\mscdex.exe");
outtextxy(x,250,"To C:\\dos\\mscdex.exe");
copy(175,270,475,290,1,"mscdex.exe","c:\\dos\\mscdex.exe");
kill_words(170,240,480,260);
setcolor(1);
findfile("chkdsk.exe");
x = ctextx(160,490,"Source File A:\\chkdsk.exe");
outtextxy(x,240,"Source File A:\\chkdsk.exe");
x = ctextx(160,490,"To C:\\dos\\chkdsk.exe");
outtextxy(x,250,"To C:\\dos\\chkdsk.exe");
copy(175,270,475,290,1,"chkdsk.exe","c:\\dos\\chkdsk.exe");
kill_words(170,240,480,260);
setcolor(1);
findfile("cdrom.sys");
x = ctextx(160,490,"Source File A:\\cdrom.sys");
outtextxy(x,240,"Source File A:\\cdrom.sys");
x = ctextx(160,490,"To C:\\dos\\cdrom.sys");
outtextxy(x,250,"To C:\\dos\\cdrom.sys");
copy(175,270,475,290,1,"cdrom.sys","c:\\dos\\cdrom.sys");
kill_words(170,240,480,260);
setcolor(1);
findfile("fdisk.exe");
x = ctextx(160,490,"Source File A:\\fdisk.exe");
outtextxy(x,240,"Source File A:\\fdisk.exe");
x = ctextx(160,490,"To C:\\dos\\fdisk.exe");
outtextxy(x,250,"To C:\\dos\\fdisk.exe");
copy(175,270,475,290,1,"fdisk.exe","c:\\dos\\fdisk.exe");
kill_words(170,240,480,260);
setcolor(1);
findfile("format.com");
x = ctextx(160,490,"Source File A:\\format.com");
outtextxy(x,240,"Source File A:\\format.com");
x = ctextx(160,490,"To C:\\dos\\format.com");
outtextxy(x,250,"To C:\\dos\\format.com");
copy(175,270,475,290,1,"format.com","c:\\dos\\format.com");
kill_words(170,240,480,260);
setcolor(1);
findfile("smartdrv.exe");
x = ctextx(160,490,"Source File A:\\smartdrv.exe");
outtextxy(x,240,"Source File A:\\smartdrv.exe");
x = ctextx(160,490,"To C:\\dos\\smartdrv.exe");
outtextxy(x,250,"To C:\\dos\\smartdrv.exe");
copy(175,270,475,290,1,"smartdrv.exe","c:\\dos\\smartdrv.exe");
kill_words(170,240,480,260);
setcolor(1);
findfile("hdformat.exe");
x = ctextx(160,490,"Source File A:\\hdformat.exe");
outtextxy(x,240,"Source File A:\\hdformat.exe");
x = ctextx(160,490,"To C:\\dos\\hdformat.exe");
outtextxy(x,250,"To C:\\dos\\hdformat.exe");
copy(175,270,475,290,1,"hdformat.exe","c:\\dos\\hdformat.exe");
kill_words(170,240,480,260);
setcolor(1);
findfile("deltree.exe");
x = ctextx(160,490,"Source File A:\\deltree.exe");
outtextxy(x,240,"Source File A:\\deltree.exe");
x = ctextx(160,490,"To C:\\dos\\deltree.exe");
outtextxy(x,250,"To C:\\dos\\deltree.exe");
copy(175,270,475,290,1,"deltree.exe","c:\\dos\\deltree.exe");
kill_words(170,240,480,260);
setcolor(1);
findfile("himem.sys");
x = ctextx(160,490,"Source File A:\\himem.sys");
outtextxy(x,240,"Source File A:\\himem.sys");
x = ctextx(160,490,"To C:\\dos\\himem.sys");
outtextxy(x,250,"To C:\\dos\\himem.sys");
copy(175,270,475,290,1,"himem.sys","c:\\dos\\himem.sys");
kill_words(170,240,480,260);
setcolor(1);
findfile("sys.com");
x = ctextx(160,490,"Source File A:\\sys.com");
outtextxy(x,240,"Source File A:\\sys.com");
x = ctextx(160,490,"To C:\\dos\\sys.com");
outtextxy(x,250,"To C:\\dos\\sys.com");
copy(175,270,475,290,1,"sys.com","c:\\dos\\sys.com");
kill_words(170,240,480,260);
setcolor(1);
findfile("dos.exe");
x = ctextx(160,490,"Source File A:\\dos.exe");
outtextxy(x,240,"Source File A:\\dos.exe");
x = ctextx(160,490,"To C:\\dos\\dos.exe");
outtextxy(x,250,"To C:\\dos\\dos.exe");
copy(175,270,475,290,1,"dos.exe","c:\\dos\\dos.exe");
kill_words(170,240,480,260);
setcolor(1);
x = ctextx(160,490,"Decompression Files");
outtextxy(x,245,"Decompression Files");
system("c:");
system("cd\\dos");
system("dos > NUL");
unlink("dos.exe");
system("a:");
kill_words(170,240,480,260);
setcolor(1);
x = ctextx(160,490,"Write autoexec.bat");
outtextxy(x,245,"Write autoexec.bat");
wautoexec();
delay(250);
kill_words(170,240,480,260);
setcolor(1);
x = ctextx(160,490,"Write config.sys");
outtextxy(x,245,"Write config.sys");
wconfig();
delay(250);
programemain();
} void installTools(void){
draw_win_3D(150,140,500,315,1,"Install Dos",2);
int x = ctextx(160,490,"Please wait a moment.");
setcolor(0);
outtextxy(x,180,"Please wait a moment");
x = ctextx(160,490,"it will updata your computer system");
outtextxy(x,195,"it will updata your computer system");
outtextxy(163,210,"After that,it will install Tools on your");
outtextxy(163,225,"computer,it takes you only a few minutes.");
setcolor(1);
enoughspace();
searchToolspath();
findfile("Tools.exe");
x = ctextx(160,490,"Source File A:\\Tools.exe");
outtextxy(x,240,"Source File A:\\Tools.exe");
x = ctextx(160,490,"To C:\\tools\\Tools.exe");
outtextxy(x,250,"To C:\\tools\\Tools.exe");
copy(175,270,475,290,1,"tools.exe","c:\\tools\\tools.exe");
kill_words(170,240,480,260);
setcolor(1);
x = ctextx(160,490,"Decompression Files");
outtextxy(x,245,"Decompression Files");
system("c:");
system("cd\\tools");
system("tools > NUL");
unlink("tools.exe");
system("a:");
programemain();
}
void installMyDos(void){
draw_win_3D(150,140,500,315,1,"Install Dos",2);
int x = ctextx(160,490,"Please wait a moment.");
setcolor(0);
outtextxy(x,180,"Please wait a moment");
x = ctextx(160,490,"it will updata your computer system");
outtextxy(x,195,"it will updata your computer system");
outtextxy(163,210,"After that,it will install MyDos on your");
outtextxy(163,225,"computer,it takes you only a few minutes.");
setcolor(1);
enoughspace();
searchMyDospath();
findfile("mydos.exe");
x = ctextx(160,490,"Source File A:\\Mydos.exe");
outtextxy(x,240,"Source File A:\\Mydos.exe");
x = ctextx(160,490,"To C:\\mydos\\Mydos.exe");
outtextxy(x,250,"To C:\\mydos\\Mydos.exe");
copy(175,270,475,290,1,"mydos.exe","c:\\mydos\\mydos.exe");
kill_words(170,240,480,260);
setcolor(1);
x = ctextx(160,490,"Decompression Files");
outtextxy(x,245,"Decompression Files");
system("c:");
system("cd\\mydos");
system("mydos > NUL");
unlink("mydos.exe");
system("a:");
programemain();
} void searchDospath(void){
char * p;
system("c:");
system("cd\\");
p = searchpath("Dos");
if(p == NULL){
mkdir("c:\\dos");
system("a:");
}
else{
system("cd\\dos");
struct ffblk ffblk;
int done = findfirst("*.*",&ffblk,0);
while(!done){
unlink(ffblk.ff_name);
done = findnext(&ffblk);
}
system("cd\\");
system("a:");
}
} void searchToolspath(void){
char * p;
system("c:");
system("cd\\");
p = searchpath("Tools");
if(p == NULL){
mkdir("c:\\tools");
system("a:");
}
else{
system("cd\\tools");
struct ffblk ffblk;
int done = findfirst("*.*",&ffblk,0);
while(!done){
unlink(ffblk.ff_name);
done = findnext(&ffblk);
}
system("cd\\");
system("a:");
}
} void searchMyDospath(void){
char * p;
system("c:");
system("cd\\");
p = searchpath("MyDos");
if(p == NULL){
mkdir("c:\\mydos");
system("a:");
}
else{
system("cd\\mydos");
struct ffblk ffblk;
int done = findfirst("*.*",&ffblk,0);
while(!done){
unlink(ffblk.ff_name);
done = findnext(&ffblk);
}
system("cd\\");
system("a:");
}
} void enoughspace(void){
struct dfree free;
long avail;
int drive;
system("c:");
drive = getdisk();
getdfree(drive+1, &free);
if (free.df_sclus == 0xFFFF){
draw_win_3D(200,160,450,315,1,"Error",4);
setcolor(0);
int x = ctextx(200,450,"Internal command error");
int y = ctexty(160,310);
outtextxy(x,y,"Internal command error");
auto_line(205,275,445,275);
buttonselect(284,285,365,306,"Continue");
getch();
buttonDown(284,285,365,305,"Continue");
delay(150);
buttonselect(284,285,365,306,"Continue");
delay(150);
system("a:");
programemain();
}
avail = (long) free.df_avail
* (long) free.df_bsec
* (long) free.df_sclus;
struct ffblk ffblk;
int done = findfirst("a:\\*.*",&ffblk,0);
long howlong = 0;
while(!done){
howlong = howlong + ffblk.ff_fsize;
done = findnext(&ffblk);
}
if(avail < howlong){
draw_win_3D(200,160,450,315,1,"Error",4);
setcolor(0);
int x = ctextx(200,450,"Not enough space");
int y = ctexty(160,310);
outtextxy(x,y,"Not enough space");
auto_line(205,275,445,275);
buttonselect(284,285,365,306,"Continue");
getch();
buttonDown(284,285,365,305,"Continue");
delay(150);
buttonselect(284,285,365,306,"Continue");
delay(150);
system("a:");
programemain();
}
else{
system("a:");
}
} void wautoexec(void){
FILE * autoexec;
autoexec = fopen("c:\\autoexec.bat","w+");
fprintf(autoexec,"@ECHO OFF\n");
fprintf(autoexec,"SET DIRCMD=/W/P/L/OD\n");
fprintf(autoexec,"PATH C:\\DOS;C:\\TOOLS;C:\\MYDOS;C:\\ \n");
fprintf(autoexec,"SET TEMP=C:\\TEMP\n");
fprintf(autoexec,"LH C:\\DOS\\MOUSE.COM\n");
fprintf(autoexec,"LH C:\\DOS\\MSCDEX.EXE /D:IDECD001 /V /M:1\n");
fprintf(autoexec,"LH C:\\DOS\\SMARTDRV.EXE\n");
fprintf(autoexec,"CLS");
fclose(autoexec);
} void wconfig(void){
FILE * config;
config = fopen("c:\\config.sys","w+");
fprintf(config,"DOS=HIGH,UMB\n");
fprintf(config,"STACKS=9,265\n");
fprintf(config,"LASTDRIVE=F\n");
fprintf(config,"FILES=40\n");
fprintf(config,"BUFFERS=30,0\n");
fprintf(config,"DEVICE=C:\\DOS\\HIMEM.SYS /TESTMEM:OFF /SHADOWRAM:ON\n");
fprintf(config,"DEVICE=C:\\DOS\\EMM386.EXE NOEMS\n");
fprintf(config,"DEVICEHIGH=C:\\DOS\\CDROM.SYS /D:IDECD001");
fclose(config);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -