home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Journal 1990 - 1995 / CUJ.iso / install.ins < prev    next >
Text File  |  1996-02-14  |  7KB  |  262 lines

  1.   { INSTALL.INS - CD-ROM Installation File - DOS-platform              }
  2.  
  3.   InstName := 'C/C++ Users Journal CD-ROM';
  4.   Cls;
  5.   StrRet := InstName;
  6.   DoFunc(0);
  7.  
  8. GetFrom:
  9.   DoFunc(5);
  10.   Mssg(6,3,'Enter the Drive letter of your CD-ROM drive.');
  11.   DoFunc(11);
  12.   DoFunc(2);
  13.   CDROMDrive := StrRet;
  14.   BranchEq(IntRet,0,Leaving);
  15.   BranchEq(IntRet,2,GetFrom);
  16.  
  17. GetDrive:
  18.   DoFunc(5);
  19.   Mssg(6,3,'Enter the Drive letter of your hard disk.');
  20.   StrRet := 'C';
  21.   DoFunc(2);
  22.   ToDrive := StrRet;
  23.   BranchEq(IntRet,0,Leaving);
  24.   BranchEq(IntRet,2,GetDrive);
  25.  
  26. GetPath:
  27.   DoFunc(5);
  28.   Mssg(6,3,'Enter the Path to Install the CD into.  The default');
  29.   Mssg(6,4,'path is \CUJ');
  30.   StrRet := '\CUJ';
  31.   DoFunc(3);
  32.   SysPath := '';
  33.   Concat(SysPath,ToDrive,':',StrRet);
  34.  
  35.   {Make SysPath2 contain the full path to the Batch file on their hard disk}
  36.   StrRet := SysPath;
  37.   DoFunc(6);
  38.   SysPath2 := StrRet;
  39.   ConCat(SysPath2,'CUJ.BAT');
  40.  
  41.   DoFunc(5);
  42.   Mssg(6,3,'You have specified the following:');
  43.   a := '';
  44.   Concat(a,'- CD-ROM is in Drive ',CDROMDrive,':');
  45.   Mssg(6,5,a);
  46.   a := '';
  47.   Concat(a,'- Application will be installed into ',SysPath);
  48.   Mssg(6,6,a);
  49.   DoFunc(7);
  50.   DoFunc(5);
  51.   BranchEq(IntRet,0,Leaving);
  52.   BranchEq(IntRet,2,GetFrom);
  53.   BranchEq(IntRet,3,Leaving);
  54.  
  55.   {Check if they have (IntRet*2+100) Kilobytes available on their hard disk}
  56.   IntRet := 1100;
  57.   DoFunc(4);
  58.   BranchEq(IntRet,0,Leaving);
  59.   BranchEq(IntRet,2,Leaving);
  60.   BranchEq(IntRet,3,Leaving);
  61.  
  62.   DoFunc(5);
  63.   Mssg(6,3,'Installing CD-ROM start up batch file now:');
  64.  
  65.   {Make The Directories Here}
  66.   Mssg(5,21,'Creating Directory...');
  67.   ChDir(CDROMDrive,':');
  68.   ChDir('\CUJ');       {built in directory name on the CD}
  69.   ChDir(ToDrive,':');
  70.   MkDir(SysPath);
  71.   ChDir(SysPath);
  72.  
  73.   Copy(CDROMDrive,':\CUJ\CUJ.BAT');
  74.   DoFunc(22);
  75.   Mssg(5,21,'Creating Batch File...');
  76.  
  77.   StrRet := SysPath2;
  78.   IntRet := 0;
  79.   DoFunc(23);
  80.   BranchEq(IntRet,0,BOpen);
  81.   Goto Error;
  82.  
  83. BOpen:
  84.   DoFunc(18);                    {Open or Create the Batch File}
  85.   BranchEq(IntRet,0,IsOpen);
  86.   Goto Error;
  87.  
  88. IsOpen:
  89.   StrRet := 'HR /Q';
  90.   DoFunc(19);
  91.   BranchEq(IntRet,0,WroteIt);
  92.   Goto Error;
  93.  
  94. WroteIt:
  95.   DoFunc(20);
  96.   BranchEq(IntRet,0,IsClosed);
  97.   Goto Error;
  98.  
  99. IsClosed:
  100.   StrRet := SysPath;
  101.   DoFunc(6);
  102.   ConCat(StrRet,'HR.INI');
  103.  
  104.   IntRet := 0;
  105.   DoFunc(23);
  106.   BranchEq(IntRet,0,DoCopy);
  107.   Goto Error;
  108.  
  109. DoCopy:
  110.   Copy(CDROMDrive,':\CUJ\HR.INI');
  111.   DoFunc(22);
  112.   Mssg(5,21,'Modifying Initialization File...');
  113.  
  114.   IntRet := 0;
  115.   DoFunc(23);
  116.   BranchEq(IntRet,0,DoOpen);
  117.   Goto Error;
  118.  
  119. DoOpen:
  120.   DoFunc(18);
  121.   BranchEq(IntRet,0,INIOpen);
  122.   Goto Error;
  123.  
  124. INIOpen:
  125.   StrRet := 'Document Path = ';
  126.   Concat(StrRet,CDROMDrive,':\CUJ');
  127.   DoFunc(19);
  128.   BranchEq(IntRet,0,Wrote1);
  129.   Goto Error;
  130.  
  131. Wrote1:
  132.   StrRet := 'Alternate Picture Path = ';
  133.   Concat(StrRet,SysPath);
  134.   DoFunc(19);
  135.   BranchEq(IntRet,0,Wrote2);
  136.   Goto Error;
  137.  
  138. Wrote2:
  139.   StrRet := 'Text Path=';
  140.   Concat(StrRet,SysPath);
  141.   DoFunc(19);
  142.   BranchEq(IntRet,0,Wrote3);
  143.   Goto Error;
  144.  
  145. Wrote3:
  146.   StrRet := 'Use Directories=2';
  147.   DoFunc(19);
  148.   BranchEq(IntRet,0,WroteINI);
  149.   Goto Error;
  150.  
  151. WroteINI:
  152.   DoFunc(20);
  153.   BranchEq(IntRet,0,INIClose);
  154.   Goto Error;
  155.  
  156. INIClose:
  157.   StrRet := SysPath;
  158.   DoFunc(6);
  159.   ConCat(StrRet,'HR.INI');
  160.   IntRet := 1;
  161.   DoFunc(23);
  162.   BranchEq(IntRet,0,INIROOK);
  163.   Goto Error;
  164.  
  165. INIROOK:
  166.  
  167.   {Mssg(5,21,'Copying Files...                ');}
  168.   DoFunc(22);
  169.   {Copy Files}
  170.   Copy(CDROMDrive,':\CUJ\HR.EXE');
  171.   Copy(CDROMDrive,':\CUJ\HR.OVR');
  172.   Copy(CDROMDrive,':\CUJ\HR.DIA');
  173.   Copy(CDROMDrive,':\CUJ\HR.CFG');
  174.   Copy(CDROMDrive,':\CUJ\HR.HS2');
  175.   Copy(CDROMDrive,':\CUJ\HWSYSTEM.VGA');
  176.   Copy(CDROMDrive,':\CUJ\SANS.VGA');
  177.   Copy(CDROMDrive,':\CUJ\SERIF.VGA');
  178.   Copy(CDROMDrive,':\CUJ\STEM.KS');
  179.   Copy(CDROMDrive,':\CUJ\THES.KS');
  180.   Copy(CDROMDrive,':\CUJ\HRW.HW4');
  181.   Copy(CDROMDrive,':\CUJ\HRW.HWT');
  182.   Copy(CDROMDrive,':\CUJ\HRW.HWN');
  183.   Copy(CDROMDrive,':\CUJ\HRW.HWA');
  184.   Copy(CDROMDrive,':\CUJ\HRW.HWX');
  185.   Copy(CDROMDrive,':\CUJ\HRW.HWI');
  186.   Copy(CDROMDrive,':\CUJ\HRW.HWY');
  187.   Copy(CDROMDrive,':\CUJ\INDEX.HWY');
  188.  
  189.   Copy(CDROMDrive,':\CUJ\1990.PCX');
  190.   Copy(CDROMDrive,':\CUJ\1991.PCX');
  191.   Copy(CDROMDrive,':\CUJ\1992.PCX');
  192.   Copy(CDROMDrive,':\CUJ\1993.PCX');
  193.   Copy(CDROMDrive,':\CUJ\1994.PCX');
  194.   Copy(CDROMDrive,':\CUJ\1995.PCX');
  195.   
  196.   Copy(CDROMDrive,':\CUJ\_STARTUP.PCX');
  197.   Copy(CDROMDrive,':\CUJ\ALLYEARS.PCX');
  198.   Copy(CDROMDrive,':\CUJ\CLOSERCH.PCX');
  199.   Copy(CDROMDrive,':\CUJ\CONTENTS.PCX');
  200.   Copy(CDROMDrive,':\CUJ\INDEXSEL.PCX');
  201.   Copy(CDROMDrive,':\CUJ\MAIN.PCX');
  202.   Copy(CDROMDrive,':\CUJ\METAYEAR.PCX');
  203.   Copy(CDROMDrive,':\CUJ\_SEARCH.PCX');    
  204.   Copy(CDROMDrive,':\CUJ\_RESULTS.PCX');    
  205.  
  206.   Copy(CDROMDrive,':\CUJ\1990.HWN');
  207.   Copy(CDROMDrive,':\CUJ\1991.HWN');
  208.   Copy(CDROMDrive,':\CUJ\1992.HWN');
  209.   Copy(CDROMDrive,':\CUJ\1993.HWN');
  210.   Copy(CDROMDrive,':\CUJ\1994.HWN');
  211.   Copy(CDROMDrive,':\CUJ\1995.HWN');
  212.   Copy(CDROMDrive,':\CUJ\CONTENTS.HWN');
  213.   Copy(CDROMDrive,':\CUJ\INDEX.HWN');
  214.   Copy(CDROMDrive,':\CUJ\INDEXART.HWN');
  215.   Copy(CDROMDrive,':\CUJ\INDEXFUL.HWN');
  216.   Copy(CDROMDrive,':\CUJ\INDEXAUT.HWN');
  217.   Copy(CDROMDrive,':\CUJ\INDEXLIS.HWN');
  218.  
  219.   Copy(CDROMDrive,':\README.TXT');
  220.  
  221. {  Copy(CDROMDrive,':\CUJ\_CONTENT.PCX'); }
  222. {  Copy(CDROMDrive,':\CUJ\_EXIT.PCX');    }
  223. {  Copy(CDROMDrive,':\CUJ\_EXPORT.PCX');  }
  224. {  Copy(CDROMDrive,':\CUJ\_FIND.PCX');    }
  225. {  Copy(CDROMDrive,':\CUJ\_HELP.PCX');    }
  226. {  Copy(CDROMDrive,':\CUJ\_HIGHLIG.PCX'); }
  227. {  Copy(CDROMDrive,':\CUJ\_HITS.PCX');    }
  228. {  Copy(CDROMDrive,':\CUJ\_INDEX.PCX');   }
  229. {  Copy(CDROMDrive,':\CUJ\_NEXT.PCX');    }
  230. {  Copy(CDROMDrive,':\CUJ\_NOICON.PCX');  }
  231. {  Copy(CDROMDrive,':\CUJ\_NOTES.PCX');   }
  232. {  Copy(CDROMDrive,':\CUJ\_NSEARCH.PCX'); }
  233. {  Copy(CDROMDrive,':\CUJ\_OUTLINE.PCX'); }
  234. {  Copy(CDROMDrive,':\CUJ\_PREV.PCX');    }
  235. {  Copy(CDROMDrive,':\CUJ\_PRINT.PCX');   }
  236. {  Copy(CDROMDrive,':\CUJ\_PSEARCH.PCX'); }
  237.  
  238. Complete:
  239.   StrRet := InstName;
  240.   DoFunc(0);
  241.   Mssg(0,0,'Installation Complete');
  242.   Cls;
  243.   Mssg(6,22,'For important information, please see README.TXT file');
  244.   Mssg(6,23,'Type CUJ to begin C/C++ Users Journal CD-ROM');
  245.   Goto Exit;
  246.  
  247. Error:
  248.   StrRet := InstName;
  249.   DoFunc(0);
  250.   Mssg(0,0,'An error has occurred during the installation process.');
  251.   Cls;
  252.   Goto Exit;
  253.  
  254. Leaving:
  255.   StrRet := InstName;
  256.   DoFunc(0);
  257.   Mssg(0,0,'Installation aborted by User');
  258.   Cls;
  259.   Goto Exit;
  260.  
  261. Exit:
  262.