Check for mandatory terminal window size and fail if it's not
[supernova.git] / src / INSTALL.PAS
1 {//-------------------------------------------------------------------------}\r
2 {/*                                                                         }\r
3 {Copyright (C) 2014 Jason Self <j@jxself.org>                               }\r
4 {                                                                           }\r
5 {This file is free software: you may copy, redistribute and/or modify it    }\r
6 {under the terms of the GNU Affero General Public License as published by   }\r
7 {the Free Software Foundation, either version 3 of the License, or (at your }\r
8 {option) any later version.                                                 }\r
9 {                                                                           }\r
10 {This file is distributed in the hope that it will be useful, but WITHOUT   }\r
11 {ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      }\r
12 {FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License}\r
13 {for more details.                                                          }\r
14 {                                                                           }\r
15 {You should have received a copy of the GNU Affero General Public License   }\r
16 {along with this program; if not, see https://gnu.org/licenses or write to: }\r
17 {  Free Software Foundation, Inc.                                           }\r
18 {  51 Franklin Street, Fifth Floor                                          }\r
19 {  Boston, MA 02110-1301                                                    }\r
20 {  USA                                                                      }\r
21 {                                                                           }\r
22 {This file incorporates work covered by the following copyright and         }\r
23 {permission notice:                                                         }\r
24 {                                                                           }\r
25 {Copyright (C) 1990, 2009 - Apogee Software, Ltd.                           }\r
26 {                                                                           }\r
27 {This file is part of Supernova.  Supernova is free software; you can       }\r
28 {redistribute it and/or modify it under the terms of the GNU General Public }\r
29 {License as published by the Free Software Foundation; either version 3     }\r
30 {of the License, or (at your option) any later version.                     }\r
31 {                                                                           }\r
32 {This program is distributed in the hope that it will be useful,            }\r
33 {but WITHOUT ANY WARRANTY; without even the implied warranty of             }\r
34 {MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                       }\r
35 {                                                                           }\r
36 {See the GNU General Public License for more details.                       }\r
37 {                                                                           }\r
38 {You should have received a copy of the GNU General Public License          }\r
39 {along with this program; if not, see https://gnu.org/licenses or write to: }\r
40 {  Free Software Foundation, Inc.                                           }\r
41 {  51 Franklin Street, Fifth Floor                                          }\r
42 {  Boston, MA 02110-1301                                                    }\r
43 {  USA                                                                      }\r
44 {                                                                           }\r
45 {Original Source: 1990 Scott Miller                                         }\r
46 {Prepared for public release: 03/19/09 - Joe Siegler, Apogee Software, Ltd. }\r
47 {*/                                                                         }\r
48 {//-------------------------------------------------------------------------}\r
49 program Install;  { Used to add FILES=16 to a CONFIG.SYS file. }\r
50 \r
51 uses crt, dos;\r
52 \r
53 {$V-}\r
54 label JUMP;\r
55 \r
56 var x,y,i    :integer;\r
57     Fil      :Text;\r
58     ComTest  :File;\r
59     TestStr  :string[200];\r
60     ch       :char;\r
61     result   :registers;\r
62 \r
63 procedure Pause(X:integer);\r
64  begin\r
65   textcolor(7);\r
66   if X=1 then write('Press any key to continue . . .')\r
67   else write('Press any key to end installation program . . .');\r
68   CH:=readkey;textcolor(15);writeln;\r
69  end;\r
70 \r
71 BEGIN JUMP:\r
72 textbackground(0);clrscr;textcolor(15);\r
73 clrscr;with Result do begin ax:=$b00;bx:=$1;end;intr($10,result);\r
74 gotoxy(25,2);writeln('SUPERNOVA INSTALLATION PROGRAM');\r
75 gotoxy(25,3);writeln('------------------------------');writeln;\r
76 textcolor(7);\r
77 writeln;\r
78 writeln('NOTE: Hard disk users don''t need to install SUPERNOVA! Hit <Ctrl-C> to abort.');\r
79 writeln;\r
80 writeln\r
81 ('This program will prepare a "boot" disk for SUPERNOVA.  The disk you wish');\r
82 writeln\r
83 ('to make your "boot" disk MUST have DOS already on it (version 2.0 or higher.)');\r
84 writeln\r
85 ('SUPERNOVA makes use of DOS file handles (explained in your DOS manual.)');\r
86 writeln\r
87 ('Everytime you play SUPERNOVA you must use this "boot" disk--which you are in');\r
88 writeln\r
89 ('the process of making--to power-on your computer.');writeln;\r
90 writeln('This program will either:');\r
91 writeln\r
92 ('* Create a CONFIG.SYS with the Files=16 DOS option,');\r
93 writeln\r
94 ('* Add the Files=16 DOS option to a CONFIG.SYS file that is found on the disk,');\r
95 writeln\r
96 ('* Modify a CONFIG.SYS file that already has the Files=# option in it.');\r
97 writeln;textcolor(15);\r
98 writeln('Insert the disk you wish to have installed for SUPERNOVA.');Pause(1);\r
99 gotoxy(1,wherey-1);delline;\r
100 writeln;\r
101 assign(ComTest,'command.com');\r
102 {$I-}\r
103 reset(ComTest);\r
104 {$I+}\r
105 if IOResult<>0 then\r
106  begin textbackground(0);textcolor(15);close(ComTest);\r
107   writeln('This disk does not have the DOS system on it (it''s missing COMMAND.COM).',^g);\r
108   write('You must install a disk that already has DOS, please find another disk...');\r
109   textbackground(0);textcolor(7);\r
110   writeln;writeln;Pause(1);goto JUMP;\r
111  end;\r
112 close(ComTest);\r
113 write('Searching for CONFIG.SYS...');\r
114 assign(Fil,'config.sys');\r
115 {$I-}\r
116 reset(Fil);\r
117 {$I+}\r
118 if IOResult<>0 then  { config.sys file needs to be created! }\r
119  begin\r
120   writeln('not found...will create one for you!');\r
121   rewrite(Fil);\r
122   writeln(Fil,'Files=16');\r
123   close(Fil);\r
124  end\r
125 else                 { config.sys file exists already! }\r
126  begin\r
127   writeln('found...will now modify it correctly.');\r
128   append(Fil);\r
129   writeln(Fil);\r
130   writeln(Fil,'Files=16');\r
131   close(Fil);\r
132  end;\r
133 writeln;\r
134 writeln('Your CONFIG.SYS file is now configured correctly for SUPERNOVA.');\r
135 Pause(1);\r
136 textbackground(0);textcolor(15);\r
137 clrscr;with Result do begin ax:=$b00;bx:=$1;end;intr($10,result);\r
138 gotoxy(25,3);writeln('SUPERNOVA INSTALLATION PROGRAM');\r
139 gotoxy(25,4);writeln('------------------------------');writeln;\r
140 textcolor(7);\r
141 writeln;\r
142 writeln\r
143 ('From now on you MUST use this disk (or any other "boot" disk you make) when');\r
144 writeln\r
145 ('you want to play SUPERNOVA, or the game will crash after you load it!');\r
146 writeln;\r
147 writeln\r
148 ('Simply turn on your computer with this "boot" disk in drive A: when you want');\r
149 writeln\r
150 ('to play SUPERNOVA, then after you see the DOS prompt A> type in NOVA and');\r
151 writeln\r
152 ('press <enter>.');writeln;\r
153 writeln\r
154 ('Before you can play SUPERNOVA you must turn your computer off, then follow');\r
155 writeln\r
156 ('the above instructions.');\r
157 writeln;\r
158 writeln('REMEMBER: If you boot from a hard disk you don''t need to make a "boot" disk.');\r
159 writeln;Pause(2);\r
160 \r
161 textbackground(0);textcolor(7);\r
162 clrscr;with Result do begin ax:=$b00;bx:=$0;end;intr($10,result);\r
163 \r
164 \r
165 END.\1a\r