home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / demos / accurend / accurend.inf < prev    next >
Encoding:
INI File  |  1993-09-02  |  11.0 KB  |  409 lines

  1. ;;Modified 8/25/93 SD
  2.  
  3. Do Setup
  4.  
  5.  
  6.  
  7. ;; Source directory, used to check version
  8. [Dir10] := [InstallFromDirectory]
  9.  
  10. ;;QueFiles to [Dir10] Thermometer NoInterruption Quietly NoInsertionPrompt
  11. ;;    *.ver
  12. ;;EndQueFiles
  13.  
  14. ;;GetQuedFiles NoThermometer Quietly
  15. If FileExists [Dir10]\product.ver
  16.     Dialog
  17.       .cAbout to install AccuRender
  18.         .cinteractive ray-trace renderer
  19.       .cfor AutoCAD Release 12.
  20.       .c 
  21.       .cDOS version 1.00
  22.     EndDialog
  23. Else
  24.     Dialog
  25.         .cAbout to install AccuRender Demo
  26.         .cinteractive ray trace renderer
  27.         .cfor AutoCAD Release 12.
  28.         .c 
  29.         .cDOS DEMO version 1.00
  30.     EndDialog
  31. EndIf
  32.  
  33. Do Install
  34.  
  35.  
  36. ;;----------------------------------------------------------------------------
  37. Procedure Install
  38.  
  39. DetermineInstallationDrive 1,800,000 RequireFixed
  40. DetermineInstallationDirectory NoCreate
  41.  
  42.     If DirectoryExists [InstallationDirectory]
  43.         Dialog [YesOrNo1]
  44.             .cThe directory [InstallationDirectory] already exists.
  45.             .cThe ACCUREND.MLB file will be renamed ACCUOLD.MLB.
  46.             .cAll other files in [InstallationDirectory] will be overwritten.
  47.             .c
  48.             .cIf you have customized files in [InstallationDirectory],
  49.             .c stop now and move them to a safe place.
  50.             .c 
  51.             .cDo you want to continue installation ?
  52.         EndDialog
  53.         If [YesOrNo1] = N
  54.             Exit
  55.         Else
  56.             If FileExists [InstallationDirectory]\ACCUREND.MLB
  57.                 If FileExists [InstallationDirectory]\ACCUOLD.MLB
  58.                     DeleteFiles from [InstallationDirectory] Quietly
  59.                         ACCUOLD.MLB
  60.                     EndDeleteFiles
  61.                 EndIf
  62.                 If FileExists [InstallationDirectory]\ACCUOLD.MDX
  63.                     DeleteFiles from [InstallationDirectory] Quietly
  64.                         ACCUOLD.MDX
  65.                     EndDeleteFiles
  66.                 EndIf
  67.                 If FileExists [InstallationDirectory]\ACCUREND.MDX
  68.                     RenameFile [InstallationDirectory]\ACCUREND.MDX to ACCUOLD.MDX
  69.                 EndIf
  70.                 RenameFile [InstallationDirectory]\ACCUREND.MLB to ACCUOLD.MLB
  71.             EndIf
  72.             If FileExists [InstallationDirectory]\ACCUREND.LSP
  73.                 DeleteFiles from [InstallationDirectory] Quietly
  74.                     ACCUREND.LSP
  75.                 EndDeleteFiles
  76.             EndIf
  77.         EndIf
  78.     Else
  79.         CreateDirectoryifNecessary [InstallationDirectory]
  80.     EndIf
  81.  
  82.     QueFileGroup 1
  83.     QueFileGroup 2
  84.     QueFileGroup 3
  85.     
  86. ;;ask if you want the all materials or a shortened version
  87. If FileExists [Dir10]\product.ver
  88.     GetMenuChoice
  89.         Install all materials
  90.             ;Preferred Option:
  91.             ;Installs over 250 materials for use with AccuRender.
  92.             ;7 MB free disk space required.
  93.         Install short list of materials
  94.             ;Second Option:
  95.             ;Installs 80 materials for use with AccuRender.
  96.             ;3 MB free disk space required.
  97.     EndGetMenuChoice
  98.  
  99. ;;Process answer    
  100.     InCase Choice is
  101.         = 1: QueFileGroup 5
  102.         = 2: QueFileGroup 4
  103.     EndInCase
  104. Else
  105.     QueFileGroup 4
  106. EndIf
  107.     
  108. GetQuedFiles
  109.     
  110. ;;AccuRender order form, demo version only.
  111. If FileExists [InstallFromDrive]:\order.frm
  112.     CopyFiles from [InstallFromDrive]:\ to [InstallationDirectory] Quietly
  113.         order.frm
  114.     EndCopyFiles
  115. EndIf
  116.  
  117. If FileExists [InstallationDirectory]\*.ver
  118.     DeleteFiles from [InstallationDirectory] Quietly
  119.         *.ver
  120.     EndDeleteFiles
  121. Endif
  122.     
  123. ;;Modify the ACCUREND.ini file
  124. If FileExists [InstallationDirectory]\ACCUREND.INI
  125.     ExamineTextFile  [InstallationDirectory]\ACCUREND.INI
  126.         [Number1] := LineNumberWith (MAPPATH,=,)
  127.         [String1] := LineWith (MAPPATH,=,)
  128.     ForgetTextFile
  129.  
  130.     [Number11] := 0
  131.     [String6] := [InstallationDirectory]
  132.  
  133.     If [String1] <> BlankString   ;;{             There is a SET MAPPATH line
  134.         ;;{
  135.         [YesOrNo4] := Y
  136.         [Number3] := LengthOf [String1]
  137.         [Number4] := PositionOf = in [String1]
  138.         IncrementNumber [Number4]
  139.         IncrementNumber [Number4]
  140.         ;; Get environment string for MAPPATH= (string 3)
  141.         ;; If number4 is greater than string length, mappath =
  142.         If [Number4] < [Number3]
  143.             [String3] := SubstringOf [String1] from [Number4] to [Number3]
  144.         Else
  145.             [String3] := $empty$
  146.         EndIf
  147.  
  148.         [Number3] := LengthOf [String3]   ;;   Length of MAPPATH= after the =
  149.  
  150.         If [String3] Contains [String6]    ;;{ SET MAPPATH line contains current Accurend= string
  151.             [String9] := N
  152.         Else
  153.             ;; mappath =
  154.             If [String3] = $empty$
  155.                 [String9] := MAPPATH = [InstallationDirectory];
  156.             Else  ;; mappath has a value append it
  157.                 [String9] := MAPPATH = [InstallationDirectory];[String3]
  158.             EndIf
  159.         EndIf
  160.     EndIf
  161.  
  162.     If [String9] <> N
  163.         ModifyTextFile [InstallationDirectory]\ACCUREND.INI Quietly NoBackup
  164.             AddOrChangeLineWith (MAPPATH,=,) As "[String9]" At Beginning
  165.         EndModifyTextFile
  166.     EndIf
  167. EndIf
  168.     
  169. ;;ask if you want to modify Autoexec or make batch file
  170. If FileExists [Dir10]\order.frm
  171.     GetMenuChoice
  172.         Modify AUTOEXEC.BAT file
  173.             ;Preferred Option:
  174.             ;Modifies your AUTOEXEC.BAT file to run AccuRender
  175.             ;with AutoCAD. Refer to [InstallationDirectory]\ACCUREND.TXT
  176.             ;text file for more information.        
  177.         Create ACCUREND.BAT file
  178.             ;Second Option:
  179.             ;Creates a batch file ACCUREND.BAT in your
  180.             ;ACCUREND directory.  Use this batch file to 
  181.             ;start AutoCAD with AccuRender enabled.
  182.         Exit
  183.             ;Third Option:
  184.             ;Bypass automatic changes.  AccuRender will
  185.             ;not run properly unless you add the 
  186.             ;ACCUREND directory to your SET ACAD= statement.  
  187.             ;Refer to [InstallationDirectory]\ACCUREND.TXT
  188.             ;text file for more information.    
  189.     EndGetMenuChoice
  190. Else
  191.     GetMenuChoice
  192.         Modify AUTOEXEC.BAT file
  193.             ;Preferred Option:
  194.             ;Modifies your AUTOEXEC.BAT file to run AccuRender
  195.             ;with AutoCAD.  Refer to "Getting Started" in the 
  196.             ;AccuRender User's Guide for more information.        
  197.         Create ACCUREND.BAT file
  198.             ;Second Option:
  199.             ;Creates a batch file ACCUREND.BAT in your
  200.             ;ACCUREND directory.  Use this batch file to 
  201.             ;start AutoCAD with AccuRender enabled.
  202.         Exit
  203.             ;Third Option:
  204.             ;Bypass automatic changes.  AccuRender will
  205.             ;not run properly unless you add the 
  206.             ;ACCUREND directory to your SET ACAD= statement.  
  207.             ;Refer to "Getting Started" in the AccuRender 
  208.             ;User's Guide for more information.    
  209.     EndGetMenuChoice
  210. EndIf
  211.  
  212. ;;Process answer    
  213.     InCase Choice is
  214.         = 1: Do FixFiles
  215.         = 2: Do MakeBatFile
  216.         = 3: Do Abort
  217.     EndInCase
  218.  
  219.     If FileExists [Dir10]\order.frm
  220.         Dialog
  221.         .cAccuRender Demo installation complete.
  222.             .cPlease refer to the 
  223.             .c[InstallationDirectory]\ACCUREND.TXT text file
  224.             .cfor setup instructions.
  225.  
  226.             .cTo join the AccuRender Beta Program,
  227.             .crefer the [InstallationDirectory]\ORDER.FRM
  228.             .ctext file or call your local 
  229.             .cMcNeel Group dealer.
  230.         EndDialog
  231.     Else
  232.         Dialog
  233.             .cAccuRender installation complete.
  234.             .c 
  235.             .cRefer to "Getting Started" in the AccuRender User's Guide 
  236.             .cfor instructions on loading and running AccuRender.
  237.  
  238.             AccuRender 
  239.             (c) 1993-94 Roy Hirshkowitz.
  240.             AccuRender is a trademark of Robert McNeel & Associates.
  241.             AutoCAD is a trademark of Autodesk, Inc.
  242.         EndDialog
  243.     EndIf
  244.  
  245. EndProcedure
  246.  
  247. ;;----------------------------------------------------------------------------
  248. Procedure abort
  249.     Dialog
  250.         .cAccurender will not run properly,
  251.         .cset acad stament must be modified.
  252.     EndDialog
  253. EndProcedure
  254.  
  255. ;;----------------------------------------------------------------------------
  256. Procedure MakeBatFile ;;{
  257.  
  258.     Do GetAcadDir
  259.  
  260.     If [YesOrNo4] = N ;;{ if no valid acad directory identified.
  261.         Dialog
  262.             .cUnable to create Accurender batch file
  263.         EndDialog
  264.     Else ;;{ valid acad directory specified
  265.  
  266.         If FileExists [InstallationDirectory]\accurend.bat  ;;{
  267.           CopyFiles from [InstallationDirectory] to [InstallationDirectory] quietly
  268.                 accurend.bat as accurend.old
  269.             EndCopyFiles
  270.             DeleteFiles From [InstallationDirectory] quietly
  271.                 accurend.bat
  272.             EndDeleteFiles
  273.         Endif  ;;}
  274.  
  275.         ModifyTextFile [InstallationDirectory]\accurend.bat Quietly
  276.             InsertAtLine End "SET AC$=%ACAD%"
  277.             InsertAtLine End "SET ACD$=%ACADDRV%"
  278.             InsertAtLine End "[string9]"
  279.             InsertAtLine End "[string10]"
  280.             InsertAtLine End "[string11]"
  281.             InsertAtLine End "SET ACAD=%AC$%"
  282.             InsertAtLine End "SET ACADDRV=%ACD$%"
  283.             InsertAtLine End "SET AC$="
  284.             InsertAtLine End "SET ACD$="
  285.         EndModifyTextFile
  286.  
  287.         Dialog
  288.             .c[InstallationDirectory]\ACCUREND.BAT file created.
  289.             .c 
  290.             .cTo Start AutoCAD with Accurender. type 
  291.             .c[InstallationDirectory]\ACCUREND at the DOS prompt.
  292.         EndDialog
  293.         ;;}
  294.     EndIf;;}
  295.  
  296. EndProcedure  ;;}  MakeBatFile
  297.  
  298. ;;----------------------------------------------------------------------------
  299. Procedure FixFiles
  300.  
  301.     NoSysFileConfirmation
  302.  
  303.     ExamineTextFile [BootDrive]:\Autoexec.bat
  304.         [Number1] := LineNumberWith (SET,ACAD=,)
  305.         [String1] := LineWith (SET,ACAD=,)
  306.         [String2] := EnvironmentStringFor ACAD
  307.     ForgetTextFile
  308.  
  309.     [Number11] := 0
  310.     [String6] := [InstallationDirectory]
  311.  
  312.     If [String1] <> BlankString   ;;{             There is a SET ACAD line
  313.         ;;{
  314.         [YesOrNo4] := Y
  315.         [Number3] := LengthOf [String1]
  316.         [Number4] := PositionOf = in [String1]
  317.         IncrementNumber [Number4]
  318.         ;; Get environment string for ACAD= (string 3)
  319.         [String3] := SubstringOf [String1] from [Number4] to [Number3]
  320.         [Number3] := LengthOf [String3]   ;;   Length of ACAD= after the =
  321.  
  322.         If [String3] Contains [String6]    ;;{ SET ACAD line contains current Accurend= string
  323.             [String9] := N
  324.         Else
  325.             [String9] := SET ACAD=[String3];[InstallationDirectory]
  326.         Endif ;; }
  327.         ;;}
  328.     Else
  329.  
  330.         Do GetAcadDir
  331.  
  332.     EndIf ;;}
  333.  
  334.     If [YesOrNo4] = Y
  335.         If [String9] <> N
  336.             ModifyAutoexecBat Quietly
  337.                 AddOrChangeLineWith (SET,ACAD=,) As "[String9]" At Beginning
  338.             EndModifyAutoexecBat
  339.         EndIf
  340.     EndIf
  341.  
  342. EndProcedure  ;;}  FixFiles
  343.  
  344. ;;----------------------------------------------------------------------------
  345. Procedure GetAcadDir ;;{
  346.     [Point2]
  347.     [YesOrNo3] := N
  348.     [YesOrNo4] := N
  349.  
  350.     [Dir1] := C:\ACAD
  351.     Dialog [Dir1] 44
  352.         .cWe need to know the location of your AutoCAD system 
  353.         .cfiles so that AccuRender can create or modify
  354.         .cbatch files.
  355.  
  356.         Path to AutoCAD:
  357.     EndDialog
  358.  
  359.     If FileExists [Dir1]\ACAD.EXE ;;{
  360.         [String10] := EnvironmentStringFor ACADDRV
  361.         [String9]  := EnvironmentStringFor ACAD
  362.  
  363.         ;;if set acad currently set
  364.         If [String9] = ''
  365.             [String9]  := SET ACAD=[Dir1]\SUPPORT;[Dir1]\FONTS;[Dir1]\ADS;[InstallationDirectory]
  366.         Else
  367.             [String9]  := SET ACAD=[String9];[InstallationDirectory]
  368.         EndIf
  369.  
  370.         ;;if set acaddrv currently set
  371.         If [String10] = ''
  372.             [String10] :=    SET ACADDRV=[Dir1]\DRV
  373.         Else
  374.             [String10] := SET ACADDRV=[String10]
  375.         EndIf
  376.  
  377.         [String11] := [Dir1]\ACAD %1 %2 %3
  378.         [YesOrNo4] := Y
  379.     Else
  380.         Dialog [YesOrNo3]
  381.             .cCan't find [Dir1]\ACAD.EXE ...
  382.             .cTry again?
  383.         EndDialog
  384.     EndIf
  385.  
  386.     If [YesOrNo3] = Y
  387.         GoTo [Point2]
  388.     Else
  389.         Exit
  390.     EndIf
  391.  
  392. EndProcedure  ;;} GetAcadDir
  393.  
  394. ;;----------------------------------------------------------------------------
  395. Procedure Setup  ;;{
  396.   SetBackgroundCharTo B0
  397.   SetShadowAttrTo LightGrayOnDarkGray
  398.   SetScreenAttrTo WhiteOnBlue
  399.   SetPopupAttrTo WhiteOnBlue
  400.   SetTopLineAttrTo WhiteONBlue
  401.   SetBottomLineAttrTo WhiteONBlue
  402.     SetTopLineTo "                 Robert McNeel & Associates, Seattle, WA                  "
  403.     SetBottomLineTo "   Press <Ctrl+X> to quit.  Call your local dealer for help.   "
  404.   ClearScreen
  405. EndProcedure  ;;} Setup
  406. ;;----------------------------------------------------------------------------
  407. EndScript
  408.  
  409.