Advertisement
Guest User

Untitled

a guest
Nov 27th, 2023
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.56 KB | None | 0 0
  1. PROGRAM RGINSTAL;
  2.  
  3. USES
  4. Crt,
  5. Dos;
  6.  
  7. {$I records.pas}
  8.  
  9. CONST
  10. DYNY: BOOLEAN = FALSE;
  11.  
  12. VAR
  13. GeneralFile: FILE OF GeneralRecordType;
  14. General: GeneralRecordType;
  15. F: FILE;
  16. S: STRING;
  17.  
  18. function bslash(b: boolean; s: STRING): STRING;
  19. begin
  20. if (b) then
  21. begin
  22. while (copy(s,(length(s) - 1),2) = '//') do
  23. s := copy(s,1,(length(s) - 2));
  24. if (copy(s,length(s),1) <> '/') then
  25. s := s + '/';
  26. end
  27. else
  28. while (s[length(s)] = '/') do
  29. dec(s[0]);
  30. bslash := s;
  31. end;
  32.  
  33. FUNCTION ExistDir(Fn: STRING): Boolean;
  34. VAR
  35. DirInfo: SearchRec;
  36. BEGIN
  37. Fn := BSlash(FALSE,FN);
  38. IF (Length(Fn) = 2) AND (Fn[2] = ':') THEN
  39. ExistDir := TRUE
  40. ELSE
  41. BEGIN
  42. findfirst(Fn,AnyFile,DirInfo);
  43. ExistDir := (DOSError = 0) AND (DirInfo.Attr AND $10 = $10);
  44. END;
  45. END;
  46.  
  47. function sqoutsp(s: string):string;
  48. begin
  49. while (pos(' ',s)>0) do
  50. delete(s,pos(' ',s),1);
  51. sqoutsp := s;
  52. end;
  53.  
  54. function exist(fn: STRING): boolean;
  55. var
  56. srec: searchrec;
  57. begin
  58. findfirst(sqoutsp(fn),anyfile,srec);
  59. exist := (doserror = 0);
  60. end;
  61.  
  62. FUNCTION SYN(B: BOOLEAN): STRING;
  63. BEGIN
  64. IF (B) THEN
  65. SYN := 'Yes'
  66. ELSE
  67. SYN := 'No ';
  68. END;
  69.  
  70. FUNCTION YN: BOOLEAN;
  71. VAR
  72. C: CHAR;
  73. BEGIN
  74. Write(SQOutSp(SYN(DYNY)));
  75. REPEAT
  76. C := upcase(Char(ReadKey));
  77. UNTIL (C IN ['Y','N',^M]);
  78. IF (DYNY) AND (C <> 'N') THEN
  79. C := 'Y';
  80. IF (DYNY) AND (C = 'N') THEN
  81. Write(#8#8#8'No ')
  82. ELSE IF (NOT DYNY) AND (C = 'Y') THEN
  83. Write(#8#8'Yes');
  84. WriteLn;
  85. YN := (C = 'Y');
  86. DYNY := FALSE;
  87. end;
  88.  
  89. FUNCTION PYNQ(CONST S: STRING): BOOLEAN;
  90. BEGIN
  91.  
  92. Write(S);
  93. PYNQ := YN;
  94. END;
  95.  
  96. PROCEDURE UnArc(FileName,Path: STRING);
  97. BEGIN
  98. SwapVectors;
  99. Exec('unzip','-L '+FileName+' '+Path);
  100. SwapVectors;
  101. END;
  102.  
  103. procedure Kill(const fn: STRING);
  104. var
  105. f:file;
  106. begin
  107. assign(f,fn);
  108. erase(f);
  109. end;
  110.  
  111. function allcaps(s:string):string;
  112. var
  113. i:integer;
  114. begin
  115. for i:=1 to length(s) do
  116. if (s[i] in ['a'..'z']) then
  117. s[i] := chr(ord(s[i]) - ord('a')+ord('a'));
  118. allcaps:=s;
  119. end;
  120.  
  121. BEGIN
  122. ClrScr;
  123. WriteLn('Renegade Version 1.10 Install Utility');
  124. WriteLn;
  125. WriteLn('This utility will install Renegade BBS Version 1.19/Alpha.');
  126. WriteLn('Please make sure that PKUNZIP.EXE and this file are located');
  127. WriteLn('in the same directory as the archive RGV110.ZIP.');
  128. Writeln;
  129. WriteLn('You will only be asked to enter the main path for the BBS');
  130. WriteLn('directory.');
  131. WriteLn;
  132. IF PYNQ('Install Renegade BBS Version 1.10? ') THEN
  133. BEGIN
  134. Writeln;
  135. WriteLn('Please enter main path for the bbs (Example: C:/RG');
  136. Write(': ');
  137. ReadLn(S);
  138.  
  139. IF (S <> '') THEN
  140. BEGIN
  141. S := AllCaps(S);
  142. IF (S[Length(S)] = '/') THEN
  143. Dec(S[0]);
  144. IF (S <> '') AND (NOT ExistDir(S)) THEN
  145. MkDir(S);
  146. IF (Exist(S+'/renegade.dat')) THEN
  147. BEGIN
  148. WriteLn;
  149. Writeln(^G^G^G'Renegade is already installed in directory "'+S+'"');
  150. Exit;
  151. END
  152. ELSE
  153. BEGIN
  154. UnArc('rgv10.zip',S);
  155. MkDir(S+'/arcs');
  156. MkDir(S+'/data');
  157. MKDir(S+'/logs');
  158. MkDir(S+'/misc');
  159. MkDir(S+'/msgs');
  160. MkDir(S+'/netfoss');
  161. MkDir(S+'/protocol');
  162. UNArc(S+'/bbs.rgd',S);
  163. UnArc(S+'/data.rgd',S+'/data');
  164. UnArc(S+'/misc.rgd',S+'/misc');
  165. UnArc(S+'/msgs.rgd',S+'/msgs');
  166. UnArc(S+'/netfoss.rgd',S+'/netfoss');
  167. UnArc(S+'/prot.rgd',S+'/protocol');
  168. Kill(S+'/bbs.rgd');
  169. Kill(S+'/data.rgd');
  170. Kill(S+'/misc.rgd');
  171. Kill(S+'/msgs.rgd');
  172. Kill(S+'/netfoss.rgd');
  173. Kill(S+'/prot.rgd');
  174. Assign(GeneralFile,S+'/renegade.dat');
  175. Reset(GeneralFile);
  176. Seek(GeneralFile,0);
  177. Read(GeneralFile,General);
  178. WITH General Do
  179. BEGIN
  180. General.Version := '1.19/Alpha'; (* <-- Update this with version *)
  181. DataPath := S+'/data/';
  182. MiscPath := S+'/misc/';
  183. MsgPath := S+'/msgs/';
  184. LogsPath := S+'/logs/';
  185. TempPath := S+'/temp/';
  186. ProtPath := S+'/protocol/';
  187. ArcsPath := S+'/arcs/';
  188. FileAttachPath := S+'/temp/';
  189. // MultPath := S+'/data/';
  190. NodePath := S+'/nodelist/';
  191. NetMailPath := S+'/netmail/';
  192. DefEchoPath := S+'/etchomail/';
  193. END;
  194. Seek(GeneralFile,0);
  195. Write(GeneralFile,General);
  196. Close(GeneralFile);
  197. END;
  198. Writeln;
  199. WriteLn(^G^G^G'Installation complete!');
  200. END;
  201. END;
  202. END.
  203.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement