home *** CD-ROM | disk | FTP | other *** search
/ Share Gallery 1 / share_gal_1.zip / share_gal_1 / UT / UT021.ZIP / INSTALL.PTB < prev    next >
Text File  |  1990-07-16  |  18KB  |  650 lines

  1. ; This is a listing of the Windows Batch file used to install Command Post
  2. ; This file is not runable as is.  It has been compiled into INSTALL.EXE
  3. ; by the PubTech BatchWorks Compiler, to be released in the summer of 1990
  4.  
  5. instver=712                ; INSTALL VERSION NUMBER
  6.  
  7. IgnoreInput(@TRUE)              ;disable keyboard/mouse input
  8. source=DirGet()                ;Cet current directory
  9. WriteTitle="Command Post Notes"        ;Title for Write Window
  10. ro=@FALSE                ;readonly error=FALSE
  11. StartCP=@FALSE                ;don't start CP
  12. disktemp=environ("TEMP")
  13. if strlen(disktemp)==0 then disktemp="C:\"  ;for HISTORY.TXT if install bombs
  14.  
  15. a=WinVersion(1)                ;Check Windows Version
  16. altshell="PROGMAN.EXE"            ;Set default shell
  17. altclass="Progman"            ;shell class name (techie stuff)
  18. if a==3 then winver="3XX"        ;PIF file suffix for Win 3.0
  19. if a==3 then goto gotver        
  20.  
  21. altshell="MSDOS.EXE"            ;Set def shell for Windows 2.x
  22. altclass="Session"            ;shell class name
  23. a=strupper(iniread("WIN386","ALTTAB","ZYX"))    ;Are we in WIN 2.x 386
  24. if a=="ZYX" then winver="2X2"        ;Probably not
  25. if a=="ZYX" then goto gotver        
  26. winver="2X3"                ;Prolly in WIN 2.x 386
  27.  
  28.  
  29.  
  30. :gotver
  31. cr=strcat(num2char(13),num2char(10))    ;Make a CRLF
  32. tab=num2char(9)                ;Make a TAB
  33. CPI="Command Post Installation"        ;Default Box title
  34. instdir="\CP-NOTES.TMP"            ;Working Directory
  35.  
  36.  
  37.                     ;Introductory messages
  38. Pause(CPI,"This is the Command Post%cr%installation procedure Ver %instver%.%cr%%cr%This install procedure was%cr%developed using%cr%PubTech« BatchWorks«.")
  39.  
  40. a=FileLocate(altshell)            ;Locate Alternate shell        
  41. if a!="" then goto MSOK            ;Can we find one???
  42. Message(CPI,"Error: File %altshell% not found in PATH,%cr%cannot use this installation program.")
  43. goto crash                ;Apparently not...exit
  44.  
  45. :MSOK                    ;Found alt shell
  46. a=FileLocate("notepad.exe")        ;Locate Notepad editor
  47. if a!="" then goto NOTEOK        ;Found Notepad?
  48. Message(CPI,"Error: File NOTEPAD.EXE not found in PATH,%cr%cannot use this installation program.")
  49. goto crash                ;Apparently not...exit
  50.  
  51. :NOTEOK                    ;Found Notepad
  52. a=FindWindow(altclass)            ;Is alternate shell running (techie stuff here)
  53. if a=="" then run(altshell,"")        ;If not, run alternate shell
  54.  
  55. RunZoom("NOTEPAD.EXE","")          ;Run NOTEPAD.EXE, and ZOOM it
  56. Yield
  57. Yield                   ;Make sure Write gets going
  58. WinTitle("Notepad",WriteTitle)          ;Change WRITE title
  59. Yield
  60. WinActivate(WriteTitle)            ;Activate WRITE WINDOW
  61. Clipput("Command Post Installation Notes%cr%(Using Install Ver %instver%)")  ;Put text into clipboard
  62. SendKey("+{INSERT}~~")            ;and paste it into write (neat huh?)
  63.  
  64.  
  65. WinActivate(WriteTitle)
  66. Clipput("Closing any preexisting Command Post windows.")
  67. SendKey("+{INSERT}~")
  68.  
  69.  
  70.                     ;Kill off any old Command Post's
  71. cpmax=10                 ;Kill off up to 10 of them
  72.     
  73. :killnext                ;top of loop
  74. if cpmax!=0 then goto killcont        ;if not 10 closed yet, keep trying
  75. beep                    ;Gee, closed 10 of em, aand there still here
  76. message("Error","Unable to terminate current Command Post.%cr%Restart Windows and retry.")
  77. goto crash                ;Give up
  78.  
  79. :killcont
  80. a=FindWindow("Peanuts24")        ;Find a 7.0+ series CP
  81.  
  82. if a == "" then goto killdone        ;if no find...Must be all closed
  83. winclose(a)                ;Close a 7.0+ Command Psot
  84. cpmax=cpmax-1                ;decrement counter
  85. yield                    ;pause a tad
  86. goto killnext                ;try again
  87.  
  88. :killdone
  89. if cpmax!=0 then goto killc2        ;Just like above, except close
  90. beep                    ;a 6.2K or previous CmdPost here
  91. Message("Error","Unable to terminate old Command Post.%cr%Please rerun install without Command Post.")
  92. goto crash
  93.  
  94. :killc2
  95. a=findwindow("CmdPostIsGreat")
  96. if a=="" then goto allclosed
  97. winclose(a)
  98. cpmax=cpmax-1
  99. yield
  100. goto killdone
  101.  
  102. :allclosed
  103. Error(@off)
  104. WinIconize("MS-DOS")
  105. Error(@CANCEL)
  106.  
  107. WinActivate(WriteTitle)            ;Write sumore stuff to WRITE
  108. Clipput("All CmdPost windows closed.  Checking for target directory.")
  109. SendKey("+{INSERT}~")
  110.  
  111. :redotarget
  112. path=strcat(strupper(environ("PATH")),";")    ;Get DOS PATH
  113.  
  114. target=filelocate("cmdpost.exe")        ;Find existing CmdPost, if any
  115. if target=="" then target=filelocate("WIN.INI") ;No find?  Try find WIN.INI
  116. a=strindex(target,"\",0,@BACKSCAN)        ;find final forwardslash
  117. if a!=0 then target=strsub(target,1,a)            ;peel off directory
  118.  
  119.                         ;Query for target directory
  120. target1=strupper(askLine("CmdPost Installation","Enter directory to install CmdPost into",target))
  121. if target1!="" then target=target1
  122. a=strlen(target)                ;remove possible final \
  123. if a<5 then goto next1
  124. if strsub(target,a,1)=='\' then target=strsub(target,1,a-1)
  125.  
  126. :next1                    ;Is directory specified in PATH
  127. target=strcat(target,";")
  128. a=strindex(path,target,0,@FWDSCAN)
  129. if a!=0 then goto okpath
  130. message("Attention","Directory specified not defined in PATH statement.%cr%CmdPost MUST be in a directory in the PATH")
  131. goto redotarget                ;try again. Gotta be in path!!
  132.  
  133.  
  134.  
  135.  
  136. :okpath                    ;OK, we like target directory
  137. WinActivate(WriteTitle)
  138. Clipput("Command Post installing to %target%.")
  139. SendKey("+{INSERT}~")
  140.  
  141. a=strsub(target,1,1)            ;Make sure target is not a floppy!!
  142. if a=="A" then goto flop
  143. if a=="B" then goto flop
  144. goto okpath2
  145. :flop
  146. Message("CmdPost Install Error","Cannot install to a floppy")
  147. goto allclosed
  148.  
  149. :okpath2            ;add final \ to dirname EXCEPT for X:\ case
  150. a=strlen(target)
  151. target=strsub(target,1,a-1)
  152. if a>4 then strcat(target,"\")
  153.  
  154. Error(@OFF)            ;Disable low-level errors
  155. WinActivate(WriteTitle)
  156. Clipput("Deleting old version of Command Post, if any.")
  157. SendKey("+{INSERT}~")
  158.  
  159. a="CMDPOST.EXE"            ;Set var a to a file name
  160. ret="zz1"
  161. goto DelFile
  162.  
  163. :zz1                ;Ditto, See above....
  164. a="CP_BLNK.EXE"
  165. ret="zz2"
  166. goto DelFile
  167.  
  168. :zz2
  169. a="CP_DLL.EXE"
  170. ret="zz3"
  171. goto DelFile
  172.  
  173. :zz3
  174. a="CP_DLL3.EXE"
  175. ret="zz4"
  176. goto DelFile
  177.  
  178. :zz4
  179. a="CP_INFO.EXE"
  180. ret="zz5"
  181. goto DelFile
  182.  
  183. :zz5
  184. a="CP_TREE.EXE"
  185. ret="zz6"
  186. goto DelFile
  187.  
  188. :zz6
  189. a="WININFO.EXE"
  190. ret="zz7"
  191. goto DelFile
  192.  
  193. :zz7
  194. a="cmdlib2.exe"
  195. ret="zz8"
  196. goto DelFile
  197.  
  198. :zz8
  199. a="cmdlib.exe"
  200. ret="zz9"
  201. goto DelFile
  202.  
  203. :zz9
  204. a="cmdtree.exe"
  205. ret="zz10"
  206. goto DelFile
  207.  
  208. :zz10
  209. a="cp_help.crd"
  210. ret="zzbrow"
  211. goto DelFile
  212.  
  213. :zzbrow
  214. a="browser.exe"
  215. ret="zz11"
  216. goto DelFile
  217.  
  218. :zz11                    ;Applets delete section here
  219.                     ;See if applets installed
  220. a=FileLocate("}PLACE.EXE")    
  221. b=FileLocate("}DELETE.EXE")
  222. c=FileLocate("}COPY.EXE")
  223. a=strcat(a,b,c)
  224. if a=="" then goto deltxt1        ;if a=="" applets apparently not here
  225.  
  226.                     ;Applets found, ask about delete
  227.                     ;Most people, this would be OK, cept
  228.                     ;some people use them in W4W or EXCEL macros
  229.  
  230. a=AskYesNo(CPI,"Applets detected on system.  The new Command Post%cr%supercedes Applets.  Do you%cr%wish to delete the Applet files?")
  231. if a==@NO then goto deltxt2        ; Skip delete of Applets
  232.  
  233. a = "}ARRANGE.EXE"            ;See file deletion comments way way
  234. ret="zz12"
  235. goto DelFile
  236.  
  237. :zz12
  238. a = "}BEEP.EXE"
  239. ret="zz13"
  240. goto DelFile
  241.  
  242. :zz13
  243. a = "}CLOSALL.EXE"
  244. ret="zz14"
  245. goto DelFile
  246.  
  247. :zz14
  248. a = "}CLOSE.EXE"
  249. ret="zz15"
  250. goto DelFile
  251.  
  252. :zz15
  253. a = "}COPY.EXE"
  254. ret="zz16"
  255. goto DelFile
  256.  
  257. :zz16
  258. a = "}DELETE.EXE"
  259. ret="zz17"
  260. goto DelFile
  261.  
  262. :zz17
  263. a = "}HIDE.EXE"
  264. ret="zz18"
  265. goto DelFile
  266.  
  267. :zz18
  268. a = "}ICONIZE.EXE"
  269. ret="zz19"
  270. goto DelFile
  271.  
  272. :zz19
  273. a = "}MOVE.EXE"
  274. ret="zz20"
  275. goto DelFile
  276.  
  277. :zz20
  278. a = "}NOP.EXE"
  279. ret="zz21"
  280. goto DelFile
  281.  
  282. :zz21
  283. a = "}PLACE.EXE"
  284. ret="zz22"
  285. goto DelFile
  286.  
  287. :zz22
  288. a = "}RENAME.EXE"
  289. ret="zz23"
  290. goto DelFile
  291.  
  292. :zz23
  293. a = "}SAY.EXE"
  294. ret="zz24"
  295. goto DelFile
  296.  
  297. :zz24
  298. a = "}SAYBEEP.EXE"
  299. ret="zz25"
  300. goto DelFile
  301.  
  302. :zz25
  303. a = "}SAYFILE.EXE"
  304. ret="zz26"
  305. goto DelFile
  306.  
  307. :zz26
  308. a = "}SHOW.EXE"
  309. ret="zz27"
  310. goto DelFile
  311.  
  312. :zz27
  313. a = "}ZOOM.EXE"
  314. ret="zz28"
  315. goto DelFile
  316.  
  317. :zz28
  318. a = "}RUN1ST.EXE"
  319. ret="zz29"
  320. goto DelFile
  321.  
  322. :deltxt1            ;Delete old DOC files, if any here...below
  323. :zz29
  324. a = "APPLETS.TXT"
  325. ret="zz30"
  326. goto DelFile
  327.  
  328. :deltxt2
  329. :zz30
  330. a = "BROWSER.TXT"
  331. ret="zz31"
  332. goto DelFile
  333.  
  334. :zz31
  335. a = "CMDPOST.TXT"
  336. ret="zz32"
  337. goto DelFile
  338.  
  339.  
  340.  
  341.  
  342.  
  343. :zz32                ;TaDaa....All files deleted.
  344. Error(@ON)            ;Re-enable errors
  345. if ro==@TRUE then goto readonly ;If readonly error flag set, goto error exit
  346.  
  347. disktemp=environ("TEMP")    ;Locate TEMP disk space
  348. if strlen(disktemp)==0 then goto tempnull    ;was TEMP defined in autoexec.bat?
  349. mydisk=strsub(disktemp,1,2)    ;Peel off temp disk drive
  350. goto tempgot            ;Got a temporary drive'
  351.  
  352. :tempnull            ;Hmmm not temp drive, well use C: then.
  353. mydisk="C:"
  354.  
  355. :tempgot            ;Got the temp drive...
  356. disktemp=strcat(mydisk,instdir) ;Build temp install path
  357.  
  358. disktemp=AskLine(CPI,"Enter pathname to working directory.%cr%Must have 600K bytes available on disk.%cr%All files in specified directory will be deleted.",disktemp)
  359. disktemp=strtrim(strupper(disktemp))
  360. a=strlen(disktemp)
  361. if a<3 then goto tempgot
  362. if strsub(disktemp,2,1)!=":" then goto tempgot
  363.  
  364. if a<5 then goto tempgot1
  365. if strsub(disktemp,a,1)=="\" then disktemp=strsub(disktemp,1,a-1)
  366. :tempgot1
  367. mydisk=strsub(disktemp,1,2)
  368. instdir=strsub(disktemp,3,strlen(disktemp)-2)
  369.  
  370. WinActivate(WriteTitle)
  371. Clipput("Using %disktemp%  on %mydisk% as temporary/documentation directory.")
  372. SendKey("+{INSERT}~")
  373.  
  374. logdisk(mydisk)            ;Log to temp disk
  375. error(@OFF)
  376. DirMake(instdir)        ;Create temp directory
  377. LastError=0
  378. DirChange(disktemp)
  379. if LastError==0 then goto dircont
  380. WinActivate(WriteTitle)
  381. Clipput("%disktemp% seems to be an invalid path/directory")
  382. SendKey("+{INSERT}~")
  383. error(@CANCEL)
  384. goto crash
  385. :dircont
  386. error(@CANCEL)
  387.  
  388.  
  389.  
  390. WinActivate(WriteTitle)        ;Delete files in temp directory
  391. Clipput("Deleting all files in %disktemp%")
  392. SendKey("+{INSERT}~")
  393.  
  394.  
  395. Error(@OFF)            ;Delete files in temp directory
  396. FileDelete(strcat(disktemp,"\*.*"))
  397. Error(@ON)
  398.  
  399. dirchange(source)        ;Change to source directory    
  400.  
  401. WinActivate(WriteTitle)
  402. Clipput("Copying CP_INST.SFX, a self-extracting compressed file, to %disktemp%.")
  403. SendKey("+{INSERT}~")
  404. FileCopy("cp_inst.sfx",strcat(disktemp,"\cp_inst.exe"))
  405.  
  406. WinActivate(WriteTitle)
  407. Clipput("Copying LICENSE.TXT to %disktemp%.")
  408. SendKey("+{INSERT}~")
  409. FileCopy("license.txt",strcat(disktemp,"\license.txt"))
  410.  
  411. WinActivate(WriteTitle)
  412. Clipput("Copying README.1ST to %disktemp%.")
  413. SendKey("+{INSERT}~")
  414. FileCopy("readme.1st",strcat(disktemp,"\readme.1st"))
  415.  
  416. WinActivate(WriteTitle)
  417. Clipput("Copying CP_QUEST.CRD, a Q&A cardfile to %disktemp%.")
  418. SendKey("+{INSERT}~")
  419. FileCopy("cp_quest.crd",strcat(disktemp,"\cp_quest.crd"))
  420.  
  421.  
  422. WinActivate(WriteTitle)
  423. Clipput("Generating CP_INST.PIF to run CP_INST.EXE.")
  424. SendKey("+{INSERT}~")
  425.                 ;Copying PIF file to temp directory
  426. FileCopy("CP_INST.%winver%",strcat(disktemp,"\cp_inst.pif"))
  427.  
  428. dirchange(disktemp)        ;change dir to temp directory
  429. WinActivate(WriteTitle)
  430. Clipput("Running CP_INST.EXE to extract files.")
  431. SendKey("+{INSERT}~")
  432. run("%disktemp%\cp_inst.exe","")        ;run the SFX file....
  433.  
  434.  
  435.  
  436. WinWaitCls("Command Post Install")    ;Wait 'till SFX done....
  437.  
  438.  
  439.  
  440. WinActivate(WriteTitle)        ;Clean up a tad
  441. Clipput("Deleting CP_INST.PIF and CP_INST.EXE.")
  442. SendKey("+{INSERT}~")
  443. FileDelete("CP_INST.PIF")
  444. FileDelete("CP_INST.EXE")
  445.  
  446.                     ;Show message about Licensing policy.
  447. Message(CPI,"The Command Post licensing policy follows.%cr%Please read carefully.%cr%Close Notepad when done.")
  448.  
  449. runzoom("notepad.exe","license.txt")   ;Notepad on licensing policy.
  450.  
  451. IgnoreInput(@OFF)            ;Allow user to close notepad.
  452. WinWaitCls("Notepad - LICENSE.TXT")    ;Wait till notepad closed.
  453. IgnoreInput(@ON)            ; disable keyboard
  454.  
  455.                     ;Does user agree???
  456. a=AskYesNo(CPI,"Do you agree to abide by the Command Post licensing agreement")
  457. if a==@YES then goto abide        ;If yes, what a swell guy...
  458.  
  459. Message(CPI,"Installation terminated")    ;NO?  Well this install is OVER!
  460. WinActivate(WriteTitle)                ;Move help cardfile
  461. Clipput("Licensing agreement not accepted.")
  462. SendKey("+{INSERT}~")
  463. Clipput("Installation process terminated.")
  464. SendKey("+{INSERT}~")
  465.  
  466. goto crash                ;exit
  467.  
  468.  
  469. :abide                    ;Agrees with license policy
  470. WinActivate(WriteTitle)
  471. Clipput("Licensing agreement accepted.  Installation continuing.")
  472. SendKey("+{INSERT}~")
  473.  
  474. FileRename("taskmanr.exe","taskmanr.rpl")    ;Hide taskmanr.exe from FileMove below
  475.  
  476. WinActivate(WriteTitle)
  477. Clipput("Moving EXE files from %disktemp% to %target%.")
  478. SendKey("+{INSERT}~")
  479.  
  480. Error(@OFF)
  481. FileMove("*.exe",strcat(target,"\*.*"))        ;Move all EXE file (cept taskmanr)
  482. Error(@CANCEL)
  483.  
  484. FileRename("taskmanr.rpl","taskmanr.exe")    ;Restore taskmanr
  485.  
  486. WinActivate(WriteTitle)                ;Move help cardfile
  487. Clipput("Moving CP_HELP.CRD file from %disktemp% to %target%.")
  488. SendKey("+{INSERT}~")
  489. FileMove("CP_HELP.CRD",strcat(target,"\*.*"))
  490.  
  491. WinActivate(WriteTitle)                ;Move help cardfile
  492. Clipput("Copying CP_VIRT.BAT file from %disktemp% to %target%.")
  493. SendKey("+{INSERT}~")
  494. FileCopy("CP_VIRT.BAT",strcat(target,"\*.*"))
  495.  
  496. dirchange(target)                ;Change to target directory
  497. user=FileLocate("CMDUSER.CPM")            ;scout around for cmduser.cpm
  498. post=FileLocate("CMDPOST.CPM")            ;scout around for cmdpost.cpm
  499. dirchange(disktemp)                ;back to temp directory
  500.  
  501.                 ;If no cmduser.cpm, use ours.
  502. if user=="" then FileCopy("CMDUSER.CPM",strcat(target,"\*.*"))
  503. if user=="" then Clipput("CMDUSER.CPM user menu file installed.")
  504.                 ;If cmduser.cpm found  NO TOUCH!!
  505. if user!="" then Clipput("CMDUSER.CPM user menu file found, NOT overwritten.")
  506. WinActivate(WriteTitle)
  507. SendKey("+{INSERT}~")
  508.  
  509.                 ;If no cmdpost.cpm, install ours
  510. if post=="" then FileCopy("CMDPOST.CPM",strcat(target,"\*.*"))
  511. if post=="" then clipput("CMDPOST.CPM master default menu installed.")
  512. if post=="" then goto cpmdid
  513.  
  514.                 ;CmdPost.cpm found.  Ask about it
  515. a=AskYesNo(CPI,"Do you wish to replace your CMDPOST.CPM file%cr%with our latest version?")
  516. clipput("CMDPOST.CPM file found.  NOT replaced, per your direction.")
  517. if a==@NO then goto cpmdid    ;If no, don't replace
  518.  
  519. c=strlen(post)            ;build name of x:\xxx\xxx\cmdpost.old
  520. postx=strsub(post,1,c-3)
  521. postx=strcat(postx,"OLD")
  522. Error(@OFF)
  523. FileDelete(postx)        ;Delete cmdpost.old if found
  524. Error(@CANCEL)
  525.  
  526. FileRename(post,postx)        ;rename cmdpost.cpm to cmdpost.old
  527. FileCopy("CMDPOST.CPM",post)    ;Copy out file to cmdpost.cpm
  528. clipput("%post% file updated with new version.%cr%Old Version renamed to %postx%")
  529.  
  530. :cpmdid                ;CPM file mashing complete.
  531. WinActivate(WriteTitle)
  532. SendKey("+{INSERT}~")
  533.  
  534.  
  535.                 ;Fixup WIN.INI
  536.                 ;Remove CmdPost from LOAD=
  537.                 ;Install CmdPost on RUN=
  538. a=strupper(iniread("windows","load",""))
  539. b=strupper(iniread("windows","run",""))
  540.  
  541. ;remove from load line
  542. if a=="" then goto noload
  543.  
  544. c=strindex(a,"CMDPOST.EXE",1,@FWDSCAN)        ;Whole bunch string parsing
  545. if c==0 then goto noload
  546. front=""
  547. back=""
  548. if c==1 then goto frontok
  549. front=strsub(a,1,c-1)
  550.  
  551. :frontok
  552. if strlen(a)<14 then goto backok
  553. if (c+13)>=strlen(a) then goto backok
  554. back=strsub(a,c+12,strlen(a)-c-12)
  555.  
  556. :backok
  557. clipput("CMDPOST.EXE removed from load=line in WIN.INI file.")
  558. WinActivate(WriteTitle)
  559. SendKey("+{INSERT}~")
  560.  
  561. iniwrite("windows","load",strcat(front," ",back))  ;re-write load=
  562.  
  563.  
  564. :noload
  565. if b=="" then goto addini
  566. c=strindex(b,"CMDPOST.EXE",1,@FWDSCAN)
  567. if c!=0 then goto runiniok        if already on run=, everything ok
  568.  
  569. :addini                    ;Add to run= line
  570. iniwrite("windows","run",strcat(b," CMDPOST.EXE"))
  571. clipput("CMDPOST.EXE added to run= line in WIN.INI file.")
  572. WinActivate(WriteTitle)
  573. SendKey("+{INSERT}~")
  574.  
  575. :runiniok
  576. dirchange(disktemp)            ;Back to temp directory.
  577.                     ;Windows 3.0....tell 'em about appendix
  578. if winver=="3XX" then Message(CPI,"Since you have Windows 3.0, please review%cr%the special Windows 3.0 appendix in the%cr%documentation to see how to make%cr%Command Post your primary shell and to%cr%see how to change the taskman.exe file.")
  579. IgnoreInput(@OFF)            ;Allow keyboard inputs.
  580.  
  581.                     ;Install all doned
  582. Message(CPI,"Command Post Installation Complete.%cr%Assorted documentation files may be%cr%found in the %disktemp%\ directory.%cr%%cr%If %disktemp%\ is on a RAM drive,%cr%please copy documentation files%cr%to a permanent drive before rebooting.")
  583. a=iniread("CmdPost","Info","AB2")
  584. if a=="AB2" then message(CPI,"If you have purchased a licensed%cr%copy of Command Post, please%cr%be sure to enter your license%cr%number to avoid the initial%cr%purchase solicitation messages.")
  585.  
  586.  
  587. Message(CPI,"The README.1ST file will be displayed%cr%Please read.%cr%Close Notepad when done.")
  588.  
  589. runzoom("notepad.exe","README.1ST")   ;Notepad on licensing policy.
  590.  
  591. IgnoreInput(@OFF)            ;Allow user to close notepad.
  592. WinWaitCls("Notepad - README.1ST")    ;Wait till notepad closed.
  593. IgnoreInput(@ON)            ; disable keyboard
  594.  
  595. StartCP=@TRUE
  596. clipput("*** Installation completed normally ***")
  597. WinActivate(WriteTitle)
  598. SendKey("+{INSERT}~")
  599.  
  600.  
  601. goto History
  602.  
  603.  
  604.  
  605.  
  606. :readonly                ;readonly file error exit
  607. Message(CPI,"Read-Only files found.  Please reset%cr%read-only attribute before trying again.")
  608.                     ;drop thru to general crash exit
  609. :crash
  610. Message(CPI,"ERROR: Command Post not properly installed")
  611. Message(CPI,"Tech Support, if required, at %cr% (206) 937-9335")
  612.                      ;hopefully not required
  613. clipput("*** Installation abnormally terminated. ***")
  614. WinActivate(WriteTitle)
  615. SendKey("+{INSERT}~")
  616.  
  617. :History
  618. WinActivate(WriteTitle)
  619. Error(@OFF)
  620. FileDelete("%disktemp%\HISTORY.TXT")
  621. Error(@CANCEL)
  622. WinActivate(WriteTitle)            ;Close down Write
  623. SendKey("!FA")
  624. SendKey("%disktemp%\HISTORY.TXT~")
  625. WinClose("Notepad - HISTORY.TXT")
  626.  
  627. if StartCP==@FALSE then exit
  628.  
  629. Display(3,CPI,"Please wait.%cr%Command Post starting up.");
  630. dirchange(target)            ;start up new Command Post.
  631. cpexe=strcat(target,"\cmdpost.exe")
  632. if FileLocate(cpexe)=="" then run("cmdpost.exe","")
  633. if FileLocate(cpexe)!="" then run(cpexe,"")
  634.  
  635. exit
  636.  
  637.  
  638.  
  639. :DelFile
  640. a=FileLocate(a)            ;Locate file name in path
  641. if a=="" then goto %ret%    ;if a=="" then file not found, do next one
  642. FileDelete(a)            ;Delete file
  643. WinActivate(WriteTitle)        ;Activate WRITE window
  644. Clipput("Deleted %a%")        ;Copy "Deleted <filename>" to clipboard
  645. b=FileLocate(a)            ;Check...Is file REALLY gone???
  646. if a==b then ro=@TRUE        ;if a==b, then file STILL THERE
  647. if a==b then ClipPut("*** %a% Not Deleted - Read/Only ***")  ;MUST BE READ ONLY, SET ERROR
  648. SendKey("+{INSERT}~")        ;Paste result to write
  649. goto %ret%
  650.