void MakeRecoveryDisk(I1 drive) { //Assumes booted from standard CD-ROM //with 'B' RAM drive. You pass //the hard drive partition with //OldMBR on it. I1 buf[80],cd_image[80]; // InstallBoot(drive,'T'); SPrintF(cd_image,"%c:/LTCD.ISO",drive); Format('B',TRUE,FALSE); Drive('B'); CopyTree("::/LT","/LT"); CopyTree("::/Windows","/Windows"); MkDir("/Temp"); SPrintF(buf,"%c:/0000Boot",drive); CopyTree(buf,"/0000Boot"); CreateCDFile(cd_image,'B',CD_BOOT); coutln; coutln "Put Blank CD in drive"; PressAKey; WriteCDImage('T',cd_image); Drive(drive); } void InstallWizard() { TssStruct *tss=Fs->next_tss; I8 i,unit; I1 *base0,*base1,*irq,*ms,*dst; I1 *st1,*st2; while (tss->user_num!=2 && tss!=Fs) tss=tss->next_tss; XTalk(tss,"Edit(\"::/LT/Doc/Install.TXZ\");\r"); for (i=0;i<10;i++) CrLf; coutln "This wizard works if you have " "a partition ready. It will format the partition, " "copy files onto it, recompile the kernel " "and modify the boot sector.\r\n\r\n" "You can partition the drive or compile the kernel " "with different options if you do it by hand.\r\n"; cout "Continue "; if (YorN) { tss=SpawnUser; tss->win_top=Fs->win_top; tss->win_bottom=(Fs->win_top+Fs->win_bottom)>>2-1; Fs-> win_top=tss->win_bottom+3; tss->win_right=Fs->win_right; tss->win_left=Fs->win_left; WinToTop(Fs); XTalk(tss,"AddDrives;\r"); XTalk(tss,"C"); XTalk(tss,"3"); HintATA; coutln "\r\nInclude '0x' for hexidecimal numbers.\r\n"; base0=PmtStr("Hard drive base0 port: "); base1=PmtStr("Hard drive base1 port: "); irq =PmtStr("Hard drive irq number: "); ms =PmtStr("Master(0) or Slave(1): "); unit=AtoI(ms); XTalk(tss,"%s\r",base0); XTalk(tss,"%s\r",base1); XTalk(tss,"%s\r",irq); XTalk(tss,"%c",'0'+unit); XTalkWithWait(tss,"\r"); PartitionRep; dst =PmtStr("\r\nDestination Partition Letter: "); CrLf; st1=MSPrintF("%c:/LT",default_drive); st2=MSPrintF("%c:/LT",*dst); PrintF("$$FG,RED$$Format %c Partition?$$FG$$\r\n",*dst); if (YorN) { CrLf; Format(*dst,TRUE,FALSE,PT_LT); } else { cout "\r\n$$BK,1$$WARNING$$BK,0$$ if you answer yes to the following " "you will lose all LoseThos files in your /LT directory tree.\r\n"; cout "Delete ",st2," Directory "; if (YorN) DelTree(st2); CrLf; } CopyTree(st1,st2); st2=MSPrintF("%c:/0000Boot",*dst); MkDir(st2); Free(st2); st2=MSPrintF("%c:/Temp",*dst); MkDir(st2); Free(st2); XTalk(tss,"InstallBoot('%c');\r",*dst); XTalk(tss,"b10x20000\r"); XTalk(tss,"C"); XTalk(tss,"3"); XTalk(tss,"%s\r",base0); XTalk(tss,"%s\r",base1); XTalk(tss,"%s\r",irq); XTalk(tss,"%c",'0'+unit); XTalk(tss,"\r"); //exit adddrives XTalk(tss,"User\r"); XTalk(tss,"\r"); //cache XTalk(tss,"%s\r",base0); XTalk(tss,"%s\r",base1); XTalkWithWait(tss,"%c\r",'0'+unit); cout "$$FG,RED$$Install Master Boot loader?$$FG$$"; if (YorN) { coutln; InstallMasterBoot(*dst); } coutln; cout "$$FG,RED$$Make Recovery Disk?$$FG$$"; if (YorN) { XTalk(tss,"InstallBoot('%c','T');\r",*dst); XTalk(tss,"b10x20000\rt4\r"); XTalk(tss,"C"); XTalk(tss,"3"); XTalk(tss,"%s\r",base0); XTalk(tss,"%s\r",base1); XTalk(tss,"%s\r",irq); XTalk(tss,"%c",'0'+unit); XTalk(tss,"\r"); //exit adddrives XTalk(tss,"User\r"); XTalkWithWait(tss,"\r"); //cache MakeRecoveryDisk(*dst); } } Fs->win_top=tss->win_top; Kill(tss); } InstallWizard;