; install ; 客 .. .MODEL SMALL include msystem.mac include sys.mac include conio.mac include mbios.mac include string.mac include mem.mac include dir.mac include io.mac include kbd.mac include stov.mac include color.m include menu.m include say.m include read.m include coder.m include key.m include diskete.m include install.m include install.e size_com = 15000+256 len_stack= 15000 len_vars = 15000 mfunc protect .CODE BEGIN START,100h,_main,{ coder_1_beg: nam_prg db len_prg dup(0) nam_zip db '/C pkunzip.exe -d -o ',0 nam_exe db '.exe',0 nam_poi db '.',0 path db 'c:\',len_path-3 dup(0),0 names db len_path dup(' '),0 firma db len_path dup(' '),0 senv db 'COMSPEC',0 cher db '\',0 space db ' ',0 eoln db 13,0 secto db 0 Ok db 'Ok ',0 f_s db '%S',0 f_w db '%W',0 f_b db '%B',0 f_@b db '@B',0 ehandle dw NIL version dw VER fz dd 0 is_handle db TRUE ii dw 0 ;--- func protect,, ; ⠭ push CS pop DS ; p뢠 䠩 fopen <* SI,2>, ; 砫 䠩 fgobof ; p p names xor BX, BX do len_path mov AL, names[BX] rol AL, 1 mov names[BX], AL inc BX enddo fwrite ; p p firma xor BX, BX do len_path mov AL, firma[BX] rol AL, 1 mov firma[BX], AL inc BX enddo fwrite ; BOOT ᥪp mov SI, diskbuf diskread diskread ; p p BPB mov DX, diskbuf add DX, ofs_bpb mov BX, DX do len_bpb mov AL, [BX] rol AL, 1 mov [BX], AL inc BX enddo fwrite ; p p p p ᪠ mov DX, diskbuf add DX, ofs_vol mov BX, DX do len_vol mov AL, [BX] rol AL, 1 mov [BX], AL inc BX enddo fwrite ; 뢠 ᫥ ᥪp p pᨨ fsize , fwrite fflush ; p뢠 fseek ftrunc ; p뢠 䠩 fclose endf ;--- func UserHello, endf ;--- func UserRead, endf ;--- is_install db FALSE func UserMenu,, mov DL, mode switch DL,<0,1> { case 1 { if$ { mov is_install, FALSE ; 室 p CR exit endif$ case 2 { if$ { mov is_install, TRUE endif$ endcase endf func main initcon release <* size_com,0> initsys initdrive if$ halt <1> endif$ initdisk argn , if$ halt <1> endif$ mov byte ptr START, 0E9h ; jmp near ptr mov AX, offset _newmain mov DX, offset START sub AX, DX sub AX, 0003h mov word ptr START+1, AX comsave <@ START,3> argv <1,@ nam_prg> comsave <@ nam_prg,len_prg> strcat <@ path,@ path,@ nam_prg> strtran <@ path,@ path,' '> strfill <' ',@ path,len_path> comsave <@ path,len_path> getmem , comsave <@ pro_treck,1> argn , if$ argv <2,* SI> stob <* SI>, comsave <@ pro_sector,1> endif$ comsave <@ max_sector,1> say <@ Ok,@ f_s> memcoder memsave <@ coder_2_beg,@ coder_2_end-2> memcoder coder_1_end: memsave <@ coder_1_beg,@ coder_1_end-2> endf box1 db '۲',0 box2 db ' ',0 hello1 db ' H ',0 hello2 db 'p᪮ p() 1993-1996',0 hello3 db ' p 客 ',0 hello4 db ' p 10.96 ',0 msg1_1 db ' pp 襬 p:',0 msg2_1 db ' :',0 msg3_1 db 'p:',0 msg4_1 db ' Enter.',0 msg1_2 db ' p p ',0 msg2_2 db ' p p p ',0 msgesc db ' 砥 ⪠ ⠭ - ESC.',0 func newmain memcoder coder_2_beg: cli mov SP, size_com+len_stack sti memcoder ; initsys mov BX, CS mov cs:PSPSeg, BX mov BX, 2Ch mov AX, CS:[BX] mov cs:EnvSeg, AX ; 뤥 release <* size_com+len_stack,0> getmem , ; p setcolor <00011011b> drawbox ; inkey - iinkey extrn _inkey:near extrn _iinkey:near memcpy <@ cs:_inkey,@ cs:_iinkey,32h> ; hello menufrom < 1, 1,@ hello1,TRUE> setcolor <00011011b> sayxy < 1, 2,@ hello2,@ f_s> sayxy < 1, 3,@ hello3,@ f_s> sayxy < 1, 4,@ hello4,@ f_s> menuto <1,@ cs:_UserHello> ; p訢 pp color drawtenj <10, 7,69,18> drawbox <12, 8,67,17,@ box2> sayxy <15, 9,@ msg1_1,@ f_s> getxy <15,10,@ path,@ f_s> sayxy <15,11,@ msg2_1,@ f_s> getxy <15,12,@ names,@ f_s> sayxy <15,13,@ msg3_1,@ f_s> getxy <15,14,@ firma,@ f_s> sayxy <15,15,@ msg4_1,@ f_s> sayxy <15,16,@ msgesc,@ f_s> read <1,@ cs:_UserRead> ; ᫨ CRKEY - ⠫p if$ { ; p訢 - ⠫p /H drawtenj <10, 8,69,17> drawbox <12, 9,67,16,@ box2> menufrom <15,11,@ msg1_2,TRUE> menufrom <15,12,@ msg2_2,TRUE> sayxy <15,14,@ msgesc,@ f_s> menuto <1,@ cs:_UserMenu>, if$ { ; CR - ⠫p clrscr ; ⠢ strtran <@ path,@ path,' '> strupr <@ path> ; ᮧ ⠫ _mkdir <@ path> ; ᪠ pp娢p getmem , inc SI strcat <* SI,@ nam_zip,@ nam_prg> strcat <* SI,* SI,@ space> strcat <* SI,* SI,@ path> if$ strcat <* SI,* SI,@ space> strcat <* SI,* SI,@ nam_prg> strcat <* SI,* SI,@ nam_poi> strcat <* SI,* SI,@ space> strcat <* SI,* SI,@ nam_prg> strcat <* SI,* SI,@ nam_exe> endif$ strcat <* SI,* SI,@ eoln> strlen <* SI>, dec SI mov [SI], AL getmem , getenv <@ senv,* DI> farrelease command <* DI,* SI> freemem <* DI> strcat <* SI,@ path,@ cher> strcat <* SI,* SI,@ nam_prg> strcat <* SI,* SI,@ nam_poi> protect freemem <* SI> int 19h endif$ endif$ setcolor <00000111b> clrscr ; 室 halt <0> coder_2_end: endf END START