/*INSTALLER FOR FLAMES VERSION 1.2 WITH ADVANCED GUI*/ #include #include #include #include #include #include void main() { FILE *fp; int result,i; char ch; textmode(80); clrscr(); textbackground(9); prompt(); ch=getchar(); switch(ch) { case 'y': case 'Y':clrscr(); system("c:\\"); system("cd\\"); result=install(); getch(); if(result==0) { textbackground(BLACK); textcolor(7); clrscr(); printf("Result: Installation Unsuccessful.\n\nRecommended: Reinstall the software or\n Reaquire the software on good media."); printf("\n\nFLAMES 1.2 with Advanced GUI Programmed by SHEKHAR A. SHERIKAR.\nApplication Terminated.\n"); break; } if(result==1) { if((fopen("flames.exe","r"))==NULL) { textbackground(BLACK); textcolor(7); clrscr(); printf("Result: Installation Unsuccessful.\n\nRecommended: Reinstall the software or\n Reaquire the software on good media."); printf("\n\nFLAMES 1.2 with Advanced GUI Programmed by SHEKHAR A. SHERIKAR.\nApplication Terminated.\n"); break; } textcolor(LIGHTGREEN); printf("\n\nResult: Installation Successful."); textcolor(YELLOW); printf("\nYou can now run FLAMES 1.2 with Advanced GUI by typing FLAMES\n in directory FLAMES in the drive you specified from MSDOS Prompt. "); printf("\n\nDo you want to run FLAMES 1.2 with Advanced GUI now? ÛY/NÛ>> "); ch=getch(); if(ch=='y'||ch=='Y') { printf("\n\nGET READY FOR SOME FUN!!!"); sleep(1); system("flames.exe"); } } restorecrtmode(); textbackground(BLACK); textcolor(WHITE); textmode(80); textbackground(BLACK); textcolor(7); clrscr(); printf("\nPlease Remember: "); printf("\nDONOT... Repeat DONOT modify the contents of the directory FLAMES any way. \n Run the program preferably from MSDOS Mode.\n HAVE FUN... Thanks!"); printf("\nFLAMES 1.2 Programmed & Devoloped by Shekhar A. Sherikar."); printf("\nFeel free to distribute this software. Suggestions are welcome."); printf("\n\n-----------------------------------------------------------"); printf("\nMODIFYING ANY PART OF THIS SOFTWARE BY ANY MEANS IS ILLEGAL"); printf("\n-----------------------------------------------------------"); printf("\nFLAMES Version 1.2, 14 FEBRUARY 2000. Refer README.TXT"); break; case 'n': case 'N':printf("\n"); cprintf(" INSTALLATION ABORTED"); printf("\n"); cprintf(" Press any key..."); getch(); textbackground(BLACK); textcolor(7); textmode(80); clrscr(); printf("FLAMES 1.2 with advanced GUI Installation Aborted.\n0 directories created.\n0 files copied."); printf("\nProgrammed and Devoloped by Shekhar A. Sherikar."); exit(0); break; default: textbackground(BLACK); textcolor(7); textmode(80); clrscr(); printf("\nERROR!\nUNABLE TO ACCEPT INPUT. Try reinstalling FLAMES 1.2\n or reaquire the software on another media"); printf("\nProgrammed and Devoloped by Shekhar A. Sherikar."); abort(); break; } textmode(80); textbackground(BLACK); textcolor(7); } prompt() { clrscr(); textcolor(YELLOW); cprintf(" ----------------------------------------------------------------------------"); printf("\n\n"); cprintf(" *** FLAMES ***"); printf("\n\n"); cprintf(" ----------------------------------------------------------------------------"); textcolor(LIGHTGREEN); printf("\n\n\n\t "); cprintf("FLAMES VERSION 1.2 WITH ADVANCED GRAPHICAL USER INTERFACE"); printf("\n\n\t\t\t\t"); textcolor(BROWN); cprintf(" -------------"); printf("\n\t\t\t\t"); cprintf(" | INSTALLER |"); printf("\n\t\t\t\t"); cprintf(" -------------"); textcolor(YELLOW); printf("\n\n"); cprintf(" YOU ARE ABOUT TO INSTALL FLAMES VERSION 1.2 IN YOUR COMPUTER"); printf("\n\n\t "); textcolor(LIGHTGREEN); cprintf(" Are you sure to continue with the installation?"); printf("\n\n\t\t\t\t "); textbackground(BROWN); textcolor(MAGENTA); cprintf("Û"); textcolor(RED); cprintf("Y/N"); textcolor(MAGENTA); cprintf("Û"); printf("\n\t\t\t\t "); printf("\n\n\n\n\n\n"); textbackground(BLUE); textcolor(YELLOW); cprintf(" ----------------------------------------------------------------------------"); gotoxy(41,19); } install() { int loop=0; char status=0; clrscr(); out("Please wait till FLAMES 1.2 with Advanced Graphical User Interface is installed."); out("Default Destination Drive: C"); out("Target Location: C:\\FLAMES"); printf("\n"); while(loop<6) { if(status!=0) { getch(); textbackground(BLACK); textcolor(7); clrscr(); printf("ERROR!"); printf("\nFLAMES 1.2 with Advanced GUI could not be Installed on your Computer."); printf("\n\nThere has been a serious error in execution of INSTALL.EXE or"); printf("\n the installation software/media has been corrupted."); printf("\n\nTry reinstalling the software. If reinstallation fails, "); printf("\n get another copy of FLAMES 1.2 with Advanced GUI installer pack."); printf("\n\nDO NOT... Repeat DO NOT try to copy the files manually from the "); printf("\n media, as this could cause the program to run incorrectly and could"); printf("\n problems in your computer's User Interface."); printf("\n\nPress a key to uninstall any components that have been installed"); printf("\n by the FLAMES 1.2 Installer... Select Y when prompted for deletion\n\n"); printf("Deleting installed components of FLAMES 1.2... \n"); system("cd \\"); system("C:"); status=system("deltree flames"); if(status==0) printf("\n\nTask Over... Installation Reverted."); else printf("\n\nError... Could Not Remove FLAMES 2.1\n Remove FLAMES 1.2 manually and try reinstalling it."); return(0); } switch(loop) { case 0: out("Creating Directory... "); status=system("C:\\"); status=system("cd \\"); status=system("md flames"); status=system("cd flames"); break; case 1: out("Installing Drivers... "); status=system("copy a:\\flames\\*.bgi"); break; case 2: out("Copying Essential Components... "); status=system("copy a:\\flames\\*.h"); status=system("copy a:\\flames\\*.chr"); break; case 3: out("Installing Flames.exe... "); status=system("copy a:\\flames\\flames.exe"); break; case 4: out("Copying Installer File... "); status=system("copy a:\\flames\\install.exe"); break; case 5: out("Copying Readme.txt..."); status=system("copy a:\\flames\\readme.txt"); break; } loop++; } printf("\n"); cprintf("Press a key..."); return(1); } out(char string[500]) { int i; for(i=0;string[i]!='\0';i++) cprintf("%c",string[i]); printf("\n"); }