home *** CD-ROM | disk | FTP | other *** search
/ HomeWare 14 / HOMEWARE14.bin / comms / icom0425.arj / POSTINI.SCR < prev    next >
Text File  |  1994-04-25  |  18KB  |  512 lines

  1. ;----------------------------------------------------------------------------
  2. ; POSTINI.SCR  Intellicomm v2 script to configure POSTFILE.SCR.  This
  3. ; script is executed when you select 'POSTFILE.SCR Settings' from the
  4. ; File Transfer Settings screen in the Intellicomm main setup.  If you
  5. ; delete this script, you will not be able to use the POSTFILE.SCR Settings 
  6. ; option in the main setup.
  7. ;----------------------------------------------------------------------------
  8.  
  9. gosub Initialize
  10.  
  11. strset s "░" 0 $SCRN_WIDTH  ;fill 's' with ░, to the screen width
  12.  
  13. assign i 1
  14. while i <= $SCRN_HEIGHT
  15.  printraw 1 i $NORM_COLOR s
  16.  inc i
  17. endwhile
  18.  
  19. eraseline 1 $BORDER_COLOR
  20. printraw -1 1 $BORDER_COLOR "Please read the OVERVIEW before you change anything"
  21.  
  22. ;----------------------------------------------------------------------------
  23. MainMenu:
  24. ;----------------------------------------------------------------------------
  25.  
  26. menudefine m1 "-" m2 m3 m4 "-" m5 m6 m7
  27.  
  28. menuhlp 1 "What is POSTFILE.SCR and why must I set it up?"
  29. menuhlp 2 "Define picture types and a picture viewer [or disable picture viewing]"
  30. menuhlp 3 "Change the commands POSTFILE uses to decompress newly downloaded archives"
  31. menuhlp 4 "Define your Virus Checker and what POSTFILE does with contaminated files"
  32. menuhlp 5 "Enter the File Manager if you must look for a file or install something"
  33. menuhlp 6 "Select to temporarily [or permanently] disable POSTFILE.SCR and exit"
  34. menuhlp 7 "Select to save your changes, enable POSTFILE.SCR if necessary, and exit"
  35.  
  36. menuboxv "POSTFILE Main Setup" "" last_selection
  37. assign last_selection $MENUSELECTION   ;save for next menu display
  38. eraseline $SCRN_HEIGHT $STAT_COLOR
  39.  
  40. switch $MENUSELECTION
  41.  case 1
  42.   gosub Overview
  43.  endcase
  44.  case 2
  45.   gosub PicSettings
  46.  endcase
  47.  case 3
  48.   gosub ArcSettings
  49.  endcase
  50.  case 4
  51.   gosub VirusSettings
  52.  endcase
  53.  case 5
  54.   FileMan
  55.  endcase
  56.  case 6
  57.   goto Disable
  58.  endcase
  59.  case 7
  60.   goto Enable
  61.  endcase
  62. endswitch
  63.  
  64. goto MainMenu
  65.  
  66. ;----------------------------------------------------------------------------
  67. PressKey:
  68. ;----------------------------------------------------------------------------
  69. pause "^M^JPlease press a key... "
  70. cls
  71. return
  72.  
  73.  
  74. ;----------------------------------------------------------------------------
  75. Enable:
  76. ;----------------------------------------------------------------------------
  77.  
  78. assign s $SCRIPT_DIR "POSTFILE.SCR"
  79. exist s goto check_save
  80.  
  81. assign i $SCRIPT_DIR "POSTFILE.RCS"
  82. exist i goto rename_rcs
  83.  
  84. wndopen "NOTE"
  85. print "Cannot enable POSTFILE.SCR!^M^J"
  86. print "Neither POSTFILE.SCR nor POSTFILE.RCS (the disabled filename) could be found"
  87. print "in the " $SCRIPT_DIR " directory."
  88. gosub PressKey
  89.  
  90. wndclose
  91. goto check_save
  92.  
  93. rename_rcs:
  94.  
  95. rename i s
  96.  
  97. check_save:
  98.  
  99. menudefine "~Yes" "~No"
  100. menuboxh "Exit" "^ISave POSTFILE.SCR settings?"
  101.  
  102. if $MENUSELECTION = 1           ;save POSTFILE.INI
  103.  fopen fh postfileini "w"
  104.  if $ERRORLEVEL <> 0
  105.   msgwind "Can't open POSTFILE.INI"
  106.   exit
  107.  endif
  108.  fputs fh picview
  109.  fputs fh picfiles
  110.  fputs fh zipx
  111.  fputs fh arcx
  112.  fputs fh arjx
  113.  fputs fh lhax
  114.  fputs fh zoox
  115.  fputs fh pakx
  116.  fputs fh viruschk
  117.  fputs fh virusaction
  118.  fputs fh holdingarea
  119.  fputs fh FILEMAN_if_clean
  120.  fputs fh FILELIST_if_virus
  121.  fputs fh describe_4DOS
  122.  if $ERRORLEVEL <> 0 msgwind "Disk write error!"
  123.  fclose fh
  124. endif
  125.  
  126. exit
  127.  
  128. ;----------------------------------------------------------------------------
  129. Initialize:
  130. ;----------------------------------------------------------------------------
  131.  
  132. vpush
  133.  
  134. variable picview
  135. variable picfiles
  136. variable zipx
  137. variable arcx
  138. variable arjx
  139. variable lhax
  140. variable zoox
  141. variable pakx
  142. variable viruschk
  143. variable virusaction
  144. variable holdingarea
  145. variable FILEMAN_if_clean
  146. variable FILELIST_if_virus
  147. variable describe_4DOS
  148.  
  149. variable i
  150. variable s
  151. variable fh
  152. variable last_selection 1
  153. variable first_use 0
  154. variable m1 "POSTFILE.SCR ~Overview"
  155. variable m2 "~Picture Viewer Settings"
  156. variable m3 "~Decompression Settings"
  157. variable m4 "~Virus Checker Settings"
  158. variable m5 "~File Manager"
  159. variable m6 "D~isable POSTFILE.SCR and exit"
  160. variable m7 "Enable POSTFILE.SCR and e~Xit"
  161.  
  162. variable postfileini s $SCRIPT_DIR "POSTFILE.INI"
  163. notexist postfileini assign first_use 1
  164.  
  165. if first_use = 0
  166.  assign last_selection 2   ;skip Overview on main menu if exists
  167.  fopen fh postfileini "r"
  168.  if $ERRORLEVEL = 0
  169.   fgets picview fh
  170.   fgets picfiles fh
  171.   fgets zipx fh
  172.   fgets arcx fh
  173.   fgets arjx fh
  174.   fgets lhax fh
  175.   fgets zoox fh
  176.   fgets pakx fh
  177.   fgets viruschk fh
  178.   fgets virusaction fh
  179.   fgets holdingarea fh
  180.   fgets FILEMAN_if_clean fh
  181.   fgets FILELIST_if_virus fh
  182.   fgets describe_4DOS fh
  183.   fclose fh
  184.  endif
  185. endif
  186.  
  187. strblank picfiles assign picfiles ".GIF.JPG.MAC.BMP.PCX.PIC.TIF.IMG"
  188. strblank zipx assign zipx "PKUNZIP.EXE -3"
  189. strblank arcx assign arcx "PKUNPAK.EXE"
  190. strblank arjx assign arjx "ARJ.EXE e"
  191. strblank lhax assign lhax "LHA.EXE e"
  192. strblank zoox assign zoox "ZOO.EXE -e"
  193. strblank pakx assign pakx "PAK.EXE e"
  194. strblank viruschk assign viruschk "SW:SCAN *.* /A /nomem /noexpire"
  195.  
  196. return
  197.  
  198. ;----------------------------------------------------------------------------
  199. Overview:
  200. ;----------------------------------------------------------------------------
  201.  
  202. wndopen "Overview"
  203.  
  204. print "POSTFILE.SCR does the following:^M^J"
  205.  
  206. print "■ Checks a list of 'picture file' extensions (.GIF, .JPG, .MAC by default)"
  207. print "  and optionally displays any newly downloaded pictures to you.^M^J"
  208.  
  209. print "■ Or creates a temporary directory to extract newly downloaded archives into.^M^J"
  210.  
  211. print "■ Uncompresses each archive and virus checks it using the external virus"
  212. print "  checking program of your choice.^M^J"
  213.  
  214. print "■ Performs a user-defined action if a virus is found (delete the file,"
  215. print "  move it to a holding area, etc).^M^J"
  216.  
  217. print "■ Looks for FILE_ID.DIZ and DESC.SDI inside the archive and, if either"
  218. print "  exists, replaces the file description (which will be stored in your"
  219. print "  ^BFILELIST^B Tagger catalog) with the ^"official^" program description.^M^J"
  220.  
  221. print "■ Optionally displays the contents of the archive in the ^BFile Manager^B"
  222. print "  allowing you to view and install new programs, then deletes the extracted"
  223. print "  files and removes the temporary directory."
  224.  
  225. gosub PressKey
  226.  
  227. print "This main setup program allows you to define the external programs"
  228. print "POSTFILE.SCR uses to accomplish its task, and to set your preferences."
  229. print "If you don't want to view newly downloaded pictures automatically, you
  230. print "can shut the feature off using this program.  If you don't want the
  231. print "^BFile Manager^B to be called automatically when a file passes a virus
  232. print "check, again you can shut the feature off here.^M^J"
  233.  
  234. print "Your first time using this main setup program please select EVERY option"
  235. print "on the main menu just to check that everything is defined properly.  If you"
  236. print "find that you cannot define something properly (i.e. if you don't have a"
  237. print "Virus Checker as yet) select '^BDisable POSTFILE.SCR^B' when you exit.  You can"
  238. print "always come back and re-enable it once you have everything set up properly."
  239.  
  240. gosub PressKey
  241.  
  242. wndclose
  243. return
  244.  
  245. ;----------------------------------------------------------------------------
  246. PicSettings:
  247. ;----------------------------------------------------------------------------
  248. wndopen "Picture Settings"
  249.  
  250. print "If you have a picture viewer that is capable of viewing a variety of"
  251. print "picture types, AND if the viewer accepts a picture filename on the command"
  252. print "line, POSTFILE.SCR can use the viewer to display newly downloaded pictures"
  253. print "to you without your even having to press a key!^M^J"
  254.  
  255. print "Enter your picture viewer command below just as you'd enter it from the"
  256. print "DOS command line, but noting the following:^M^J"
  257.  
  258. print "■ If the command is preceded by ^BSW:^B then Intellicomm swaps out of base"
  259. print "  memory (to disk or EMS/XMS memory) leaving the picture viewer with"
  260. print "  more memory.  If your viewer uses more than 100-150 Kilobytes of memory"
  261. print "  (and most do) you should precede the command with ^BSW:^B to ensure that"
  262. print "  there is enough memory to load the viewer.^M^J"
  263.  
  264. print "■ If a percent sign (^B%^B) is placed in the command, POSTFILE.SCR removes"
  265. print "  the ^B%^B and inserts the ^BD:\PATH\FILENAME.EXT^B of the PICTURE where the"
  266. print "  % was.  If no % exists, POSTFILE.SCR specifies the picture filename"
  267. print "  just after the picture viewer command.^M^J"
  268.  
  269. print "Enter your Picture Viewer command, or press ^BEsc^B if you do not want"
  270. print "pictures to be automatically displayed:^M^J"
  271.  
  272. strblank picview assign picview "SW:CSHOW %+"
  273.  
  274. printnc "Picture Viewer: "
  275. gets picview 61
  276. if $ERRORLEVEL <> 0
  277.  assign picview ""
  278.  wndclose
  279.  return
  280. endif
  281.  
  282. cls
  283.  
  284. print "You can also add new picture types to the list below, if necessary.  This"
  285. print "list is compared to the file extension (^B.EXT^B) of each newly downloaded"
  286. print "file to determine which files to display using the Picture Viewer you just"
  287. print "defined.  Make sure you enter a period to separate one extension from the"
  288. print "next:^M^J"
  289.  
  290. printnc "^BPicture Extensions: ^B"
  291. gets picfiles 57
  292.  
  293. wndclose
  294. return
  295.  
  296. ;----------------------------------------------------------------------------
  297. ArcSettings:
  298. ;----------------------------------------------------------------------------
  299. wndopen "Decompression Settings"
  300.  
  301. print "POSTFILE.SCR supports ^B.ZIP^B, ^B.ARC^B, ^B.ARJ^B, ^B.LHA^B, ^B.ZOO^B and ^B.PAK^B archive types."
  302. print "In order to uncompress these archives, however, you must have the proper"
  303. print "utilities installed.  [Decompression utilities for all of the above archive"
  304. print "types are available for download on most any BBS.]  It isn't mandatory that"
  305. print "you obtain and install all the decompression programs, unless the BBS's you"
  306. print "call frequenly have mixed archive types online.^M^J"
  307.  
  308. print "If you don't have one of the utilities prompted for below, simply press"
  309. print "the ^BEnter^B key.  If you do have the utility but it is not in a directory"
  310. print "on your DOS PATH, press the ^BIns^B key until the cursor is large, then insert"
  311. print "the proper ^BD:\PATH\^B before the command (e.g. ^BC:\UTILS\PKUNZIP -3^B).^M^J"
  312.  
  313. printnc "^B.ZIP Extract: ^B"
  314. gets zipx 63
  315. print
  316. printnc "^B.ARC Extract: ^B"
  317. gets arcx 63
  318. print
  319. printnc "^B.ARJ Extract: ^B"
  320. gets arjx 63
  321. print
  322. printnc "^B.LHA Extract: ^B"
  323. gets lhax 63
  324. print
  325. printnc "^B.ZOO Extract: ^B"
  326. gets zoox 63
  327. print
  328. printnc "^B.PAK Extract: ^B"
  329. gets pakx 63
  330. print
  331.  
  332. wndclose
  333. return
  334.  
  335. ;----------------------------------------------------------------------------
  336. VirusSettings:
  337. ;----------------------------------------------------------------------------
  338. wndopen "Virus Checker Settings"
  339.  
  340. print "Once a newly downloaded archive is decompressed into a temporary directory"
  341. print "(which POSTFILE.SCR creates) it then executes the command defined below"
  342. print "to virus check the files within the archive.^M^J"
  343.  
  344. print "McAfee's ^BSCAN^B is the default virus checker as this utility is available"
  345. print "for download from most all BBS's.  If you wish to use another virus checker,"
  346. print "define the proper command below.^M^J"
  347.  
  348. print "■ Precede the command with ^BSW:^B (Swap) to ensure that the virus checker has
  349. print "  enough memory to work with.  Example: ^BSW:SCAN.EXE^B^M^J"
  350.  
  351. print "■ If your virus checker is not on your DOS PATH, press the ^BIns^B key until
  352. print "  the cursor is large and insert the proper D:\PATH\.
  353. print "  Example: ^BSW:C:\UTILS\SWAP.EXE^B^M^J"
  354.  
  355. print "■ Do NOT define a command that executes a batch file or anything other than
  356. print "  a ^B.COM^B or ^B.EXE^B.  POSTFILE.SCR must obtain the ^Berrorlevel^B return code
  357. print "  directly from the virus checking program and batch files do not allow this.^M^J"
  358.  
  359. printnc "^BVirus Checker: ^B"
  360. gets viruschk 62
  361.  
  362. cls
  363.  
  364. print "If your virus checker returns an errorlevel to indicate a problem, POSTFILE"
  365. print "performs one of the following actions:^M^J"
  366.  
  367. print "■ Enters the ^BFile Manager^B so you can View the files, and/or Delete"
  368. print "  the original archive, and/or shell to DOS.  If the archive still"
  369. print "  exists when you exit the File Manager you are asked whether to"
  370. print "  delete it or not (so you needn't go out of your way in the File"
  371. print "  Manager to locate and delete the proper archive).^M^J"
  372.  
  373. print "■ OR ^BDeletes^B the archive unconditionally.^M^J"
  374.  
  375. print "■ OR ^BMoves^B the archive to a temporary holding area for later examination.^M^J"
  376.  
  377. print "■ OR ^BIgnores^B the error (you can do what you want with the file later).^M^J"
  378.  
  379. print "Note that you will ALWAYS be aware that a file contained a virus, if you"
  380. print "View the ^BICOM.CAP^B file by selecting ^BReview Session Captures^B from the Icom"
  381. print "Main Menu.  POSTFILE appends the virus checker output to ICOM.CAP if there"
  382. print "is a problem.^M^J"
  383.  
  384. try_again:
  385. printnc "Please select: "
  386.  
  387. menudefine "~File Manager" "~Delete" "~Move" "~Ignore"
  388. menubar
  389.  
  390. if $MENUSELECTION < 1 goto try_again
  391.  
  392. assign virusaction $MENUSELECTION
  393.  
  394. if $MENUSELECTION = 3  ;Move
  395.  print "^M^J^JPlease enter the D:\PATH you would like files moved to:
  396.  gets holdingarea 64
  397. endif
  398.  
  399. cls
  400.  
  401. print "You also have the option of entering the ^BFile Manager^B to View and possibly"
  402. print "install new programs that PASS the virus check.  From the File Manager you"
  403. print "can ^"View^", ^"Edit^", ^"Copy^", ^"Rename/Move^", the files in the archive, or can"
  404. print "even shell to DOS to perform some custom work.^M^J"
  405.  
  406. print "Further, if you ^"View^" or ^"Edit^" a ^B.BAT^B, ^B.COM^B, or ^B.EXE^B file from the File"
  407. print "Manager, you are given the option to EXECUTE the file instead of viewing it."
  408. print "Thus, you could run any 'INSTALL' program that had been included in the"
  409. print "archive, to get new programs ready for action!^M^J"
  410.  
  411. printnc "Enter ^BFile Manager^B after uncompressing new downloads? "
  412.  
  413. menudefine "~Yes" "~No"
  414. menubar
  415.  
  416. if $MENUSELECTION = 1
  417.  assign FILEMAN_if_clean 1
  418. else
  419.  assign FILEMAN_if_clean 0
  420. endif
  421.  
  422. cls
  423.  
  424. print "^BPROGRAM/SCRIPT DEVELOPERS TAKE NOTE^B:  If the file ^B@ICOM.SCR^B is included in"
  425. print "your archive, POSTFILE.SCR gives the user the option to ^Brun^B it.  In"
  426. print "^B@ICOM.SCR^B you could ^BLIST ^"README.1ST^"^B, you could prompt the user for an"
  427. print "installation directory or any necessary information ... handling anything"
  428. print "necessary for program introduction and installation.^M^J"
  429.  
  430. print "If you include ^B@ICOM.SCR^B in your archive, when Icom users download your"
  431. print "program, they'll get auto-decompression to a temporary directory, auto-virus"
  432. print "checking, AND (preferably optional) installation!  You can do more from"
  433. print "^B@ICOM.SCR^B than you could from any INSTALL.BAT file, and probably even"
  434. print "more than your own custom INSTALL.EXE.  ^B@ICOM.SCR^B is particularly useful"
  435. print "if your program is an Icom-specific script or add-on."
  436.  
  437. gosub PressKey
  438.  
  439. print "Just after POSTFILE.SCR finishes, Icom moves the file record (filename,"
  440. print "description, size, etc) into the Tagger ^BFILELIST^B catalog, to allow you to"
  441. print "easily tag and upload the file to other BBS's later.  However, if a virus is"
  442. print "found in the file, you probably don't want it to be added to the FILELIST"
  443. print "catalog.^M^J"
  444.  
  445. printnc "Skip adding infected files to ^BFILELIST^B? "
  446. menubar
  447.  
  448. if $MENUSELECTION = 2        ;No, don't skip (make Yes the default)
  449.  assign FILELIST_if_virus 1
  450. else
  451.  assign FILELIST_if_virus 0
  452. endif
  453.  
  454. cls
  455.  
  456. print "And one last option.  If you use ^B4DOS^B or Norton ^BNDOS^B, POSTFILE.SCR can"
  457. print "use the ^BDESCRIBE^B command to add the file description to the file on disk!^M^J"
  458.  
  459. printnc "Would you like to use this feature? "
  460. menubar $SCRN_X $SCRN_Y 2
  461.  
  462. if $MENUSELECTION = 1
  463.  assign describe_4DOS 1
  464.  print "^M^J^J^G^BNOTE:^B  If you haven't done so already, create 4DOS.INI in your \4DOS"
  465.  print "directory and add the line:^M^J"
  466.  print "^BDescriptionMax = 200^B^M^J"
  467.  print "This allows a much longer description to be added.  The default is 40"
  468.  print "characters maximum (one line), and DESCRIBE will ^Bbeep^B at POSTFILE.SCR"
  469.  print "for trying to add longer descriptions without DescriptionMax = 200."
  470.  gosub PressKey
  471. else
  472.  assign describe_4DOS 0
  473. endif
  474.  
  475. wndclose
  476. return
  477.  
  478. ;----------------------------------------------------------------------------
  479. Disable:
  480. ;----------------------------------------------------------------------------
  481. assign i $SCRIPT_DIR "POSTFILE.RCS"
  482. assign s $SCRIPT_DIR "POSTFILE.SCR"
  483.  
  484. notexist i goto rename_scr
  485. menudefine "~Yes" "~No"
  486. menuboxh "WARNING" "^IPOSTFILE.RCS exists, overwrite it?"
  487. if $MENUSELECTION = 1
  488.  delete i
  489. else
  490.  assign i $SCRIPT_DIR "POSTFILE.RC1"
  491. endif
  492.  
  493. rename_scr:
  494.  
  495. rename s i
  496. exit
  497.  
  498. ;----------------------------------------------------------------------------
  499. ConfigReminder:
  500. ;----------------------------------------------------------------------------
  501.  
  502. if first_use = 0 return
  503.  
  504. wndopen $SCRIPT_NAME
  505. print "^M^JTo access this program again in the future, select ^BIntellicomm Setup^B from"
  506. print "the Icom main menu, then ^BFile Transfer Settings^B and ^BPOSTFILE.SCR Settings^B.^M^J"
  507. print "Or simply 'Run' the ^BPOSTINI.SCR^B script from the Script Manager."
  508. gosub PressKey
  509. wndclose
  510.  
  511. return
  512.