home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Today (BR) Volume 2 #10 / CDROMTODAY_v2n10.iso / install / install.em1 < prev    next >
Text File  |  1995-06-22  |  18KB  |  482 lines

  1. //BAPI Installation of Science Fiction Archives Demo
  2. //6.20.95  11.30 pm
  3.  
  4.  
  5. @DefineProject
  6.     //Next two lines must match DISK.ID file exactly
  7.     @Name = "Science Fiction Archives"
  8.     @Version = "2D Build 2.0.5"           
  9.  
  10.     @Subdir = "\\SCIFI"
  11.     @OutDrive = C
  12.     @Requires @HardDisk
  13.     @AssumeHardDisk = @TRUE
  14.     @InDiskBell = @FALSE
  15.     @Immediate = @TRUE
  16. @EndProject
  17.  
  18. @DefineVars
  19.     @Integer @WIN          = 3
  20.     @Integer @SFFILES     = 1000   // Size required for files
  21.     @Integer @TSIZE        = @Eval(@SFFILES) // Total Sizes
  22.     @Integer @Red          = @RGB(255,0,0) //DEFINE COLOR RED
  23.     @Integer @Green        = @RGB(0,255,0) //DEFINE COLOR GREEN
  24.     @Integer @Blue         = @RGB(0,0,255) //DEFINE COLOR BLUE
  25.     @Integer @Black        = @RGB(0,0,0)   //DEFINE COLOR BLACK
  26.     @Integer @V            = @VideoCard
  27.     @Integer @UsingOldPM   = @FALSE  // Whether we could access the DDEML.DLL for @ProgramManager() calls
  28.     //@Qstring @WINSYSDIR    = "@WINDIR\\system\\"
  29.     @Qstring @QTDATE       = "1994/11/30"
  30.     @Qstring @GRPNAME      = "@Name" // used for Group Name
  31.     @Qstring @ShowNormal   = "" // used to show group normally
  32.     @Qstring @ShowMin      = "" // used to show group minimized
  33.     @Qstring @ShowIcon     = "" // used to show group iconized
  34.     @Qstring @SG           = "" // used for Show Group command
  35.     @Qstring @PMLIST       = "" // used for the @ProgramManager command
  36.     @Qstring @AI1          = "" // used for Adding Item 1 command   
  37.     @Qstring @AI2          = "" // used for Adding Item 2 command   
  38.     @Qstring @RI1          = "" // used for Replacing Item 1 command   
  39.     @Qstring @RI2          = "" // used for Replacing Item 2 command   
  40.     @Qstring @TTEnable     = "@GetINI("TrueType","TTEnable")"
  41.     @Qstring @DiskAccess   = "@GetINI("386enh","32BitDiskAccess","system.ini")"
  42.     @Qstring @MDriver      = "@GetINI("boot.description","mouse.drv","system.ini")"
  43.     @Qstring @NetDriver    = "@GetINI("boot","network.drv","system.ini")"
  44.     @Qstring @DispDriver   = "@GetINI("boot","display.drv","system.ini")"
  45.     @Qstring @WinShell     = "@GetINI("boot","shell","system.ini")"
  46.     @Qstring @WallPaper    = "@GetINI("desktop","wallpaper")"
  47.     @Qstring @PSwapFile    = "@GetINI("386Enh","PermSwapDOSDrive","system.ini")"
  48.     @Qstring @PSwapSize    = "@GetINI("386Enh","PermSwapSizeK","system.ini")"
  49.     @Integer @InternalTest = @FALSE // for KDC Internal use.
  50. @EndVars
  51.  
  52.  
  53. //---------------------------------------------------------------------
  54. //Intro Screen
  55.  
  56. @BackgroundMode(3,@Blue,@Black)
  57. @Display
  58.  This program will install @Name 
  59.  version @Version  onto your computer system and 
  60.  verify the integrity of the distribution files.
  61. @Prompt="@Name"
  62. @TitlePause
  63. @EndDisplay
  64.  
  65.  
  66. //------------------------------------------------------------------------
  67. //   Techie info only....Do not show any of this to the screen
  68. /*
  69. @Display
  70.     Your @CPU-based computer has the following system components:                       
  71.  
  72. Today's date ........................................................... @DateToStr(@SystemDate())
  73. Your processor is an .............................................. 80@CPU
  74. Your co-processor is .............................................. @If(@NDP)@!PRESENT @Else@!NOT PRESENT @EndIf
  75. DOS version ............................................................ @OSMajor.@OSMinor
  76. Total RAM memory ..................................................@Eval(@RAMTotal/1024)K
  77. Total EXT memory .................................................. @Eval(@EXTTotal/1024)K
  78. Bootdrive ................................................................. @BootDrive:
  79. Startup Drive and Directory .....................................@StartUpDrive:@StartUpDir
  80. Drive @OutDrive: is ................................................................ @If(@Removable(@outdrive))@!REMOVABLE @Else@!NON-REMOVABLE @EndIf
  81. Drive @OutDrive: formatted capacity .................................... @Eval(@DiskSize(@outdrive)/1024000) MB
  82. Drive @OutDrive: free space remaining ................................ @Eval(@DiskFree(@outdrive)/1024000) MB
  83. The Location of @OutDrive: is ................................................ @if(@DriveRemote(@outdrive))@!REMOTE @Else@!LOCAL @Endif
  84. Windows is located in ............................................ @WindowsDrive:@WindowsDir
  85. Windows version .................................................... @WindowsMajor.@WindowsMinor
  86. Windows current mode of operation ...................... @If(@WindowsMode == 1)@!STANDARD @ElseIf(@WindowsMode == 2)@!ENHANCED @Else@!REAL @EndIf
  87. @Pause
  88. @EndDisplay
  89.  
  90. @Display 
  91. Permanent Swap File Drive .................................@If("@PSwapFile" == "") N/A - TEMP SWAP FILE @Else @PSwapFile @EndIf
  92. Permanent Swap File Size ..................................@If(@StrToInt(@PSwapSize) <= 0) N/A - TEMP SWAP FILE @Else @PSwapSize K @EndIf
  93. True Type Fonts are ............................................ @If("@TTEnable" == "1")@!ENABLED @else@!DISABLED @EndIf
  94. 32BitDiskAccess is .............................................. @DiskAccess
  95. SHELL is ............................................................... @WinShell
  96. Wallpaper is ......................................................... @WallPaper
  97. CD-ROM Drive ..................................................... @If(@CDRomTotal < 1)@!NOT PRESENT @Else @CDRomFirst@!: @EndIf
  98. CD-ROM Driver Version ..................................... @If(@CDRomMajor == 0)@!NOT PRESENT @Else @CDRomMajor.@CDRomMinor@!: @EndIf
  99. Display driver ...................................................... @DispDriver
  100. Video card ............................................................@If(@V == 77 || @V == 72) MONO @ElseIf(@V == 69) EGA @ElseIf(@V == 86) VGA or better @ElseIf(@V == 67) CGA @Else UNKNOWN @EndIf
  101. Video RAM ............................................................ @VideoRam@!K
  102. Network ............................................................... @If(@Netbios)@!PRESENT @Else NOT PRESENT @EndIf
  103. Network Driver is ................................................ @If(@StrLen("@NetDriver") < 1)@!NOT INSTALLED @Else@!@NetDriver @EndIf
  104. Keyboard .............................................................. @If(@keyboard)@!ENHANCED @Else STANDARD @EndIf
  105. Mouse Driver is ................................................... @MDriver
  106. @Pause
  107. @EndDisplay
  108.  
  109. //End of not showing this to the screen
  110. */
  111.  
  112.  
  113. NEWDRIVE:  // re-select drive if needed
  114.  
  115. //Prompt for target drive...CD-Rom, removables, floppies, excluded
  116. @BackgroundMode(3,@Blue,@Black)
  117. @DlgCtrlSize(0,9,15,15,27)
  118. @GetOutDrive @OutDrive @Prompt = "Enter target drive"
  119. @Suppress(0,17)
  120. Please select the drive where you wish
  121. @Name files to be 
  122. installed on your machine.  Any drive
  123. available can be used assuming you have
  124. access rights to the drive you select, and
  125. there is enough space available for installation.
  126. @EndOutDrive
  127.  
  128.  
  129. NEWDIR: // goto label for reselecting the base path (if needed).
  130.  
  131. @BackgroundMode(3,@Blue,@Black)
  132. @DlgCtrlSize(0,7,0,8,35)
  133. @GetSubdir @Subdir @Prompt = "Enter target subdirectory"
  134. Please select the main subdirectory PATH where
  135. you wish @Name files are to 
  136. be installed.  
  137. @EndSubdir
  138.  
  139. //------------------------------------------------------------------------
  140. //Evaluate the selected drive for adequate free space
  141.  
  142. @TSIZE = @Eval((@SFFILES))
  143. @If(@TSIZE*1024 > @DiskFree(@OutDrive))
  144.     @BackgroundMode(3,@Red,@Black)
  145.     @Display
  146.     The @Name requires
  147.     @TSIZE K bytes of free disk space.  
  148.     The drive you have selected has only @Eval(@DiskFree(@OutDrive)/1K) K free.
  149.          
  150.         Please select another drive.
  151.                                     @Pause
  152.  
  153.     @EndDisplay
  154.     @GOTO NEWDRIVE
  155. @EndIf  // tsize>diskfree
  156.  
  157. @BackgroundMode(3,@Blue,@Black)
  158. @SetOption(1600) @ClearOption(1700)
  159.  
  160.  
  161. //-----------------------------------------------------------------------
  162. //Make the subdirectory and copy the files to the subdirectory
  163.  
  164. NONINTERACTIVE:
  165.  
  166. @MkDir("@OutDrive:\\@Subdir")
  167. //@Delete ("@WinDrive:\\@WinSysDir\\scifi.ttf")
  168.  
  169. //-----------------------------------------------------------------------
  170. //Remove fonts, notify Windows, delete font files.
  171.  
  172. @SetINI("FONTS","SciFi Normal (True Type)","","WIN.INI")
  173. @RemoveFont("Scifi.fot")
  174. @Delete ("@WinDrive:\\@WinSysDir\\scifi.fot")
  175. @SetINI("FONTS","SciFi 8, 8, 9, 10, 10, 12, 13, 14, 14, 15, 18, 21, 24 (96 dpi)","","WIN.INI")
  176. @RemoveFont("Scifi.fon")
  177. @Delete ("@WinDrive:\\@WinSysDir\\scifi.fon")
  178.  
  179. //------------------------------------------------------------------------
  180. //Copy Files
  181.  
  182. @DefineDisk
  183.     @Label = "CD 1"
  184.     @File nimoy2d.ex_      @Out nimoy2d.exe
  185.     @File nimoy2d.in_    @Out nimoy2d.ini
  186.     @File lingo.in_        @Out lingo.ini
  187.     @File readme.txt    @Out readme.txt
  188.     @File fileio.dl_       @Out fileio.dll
  189.     @File nimoy.ic_        @Out nimoy.ico
  190.     @File scifi.in_        @Out scifi.ini    
  191.     @File scifi.tt_        @Out @WinDrive:\\@WinSysDir\\scifi.ttf
  192.         @File scifi.f_t        @Out @WinDrive:\\@WinSysDir\\scifi.fot
  193.     @File scifi.f_n        @Out @WinDrive:\\@WinSysDir\\scifi.fon
  194.     
  195. @EndDisk
  196.  
  197. //-------------------------------------------------------------------
  198. //Prompt for windows group name
  199.  
  200. REENTERGRPNAME:
  201. @DlgCtrlSize(0,6,12,7,45)
  202. @GetString @GRPNAME @Prompt = "Enter Program Manager Group Name"
  203. Please enter a name for the Windows Program group that will 
  204. be created during this installation.  Valid group names may 
  205. contain spaces, and should be a minimum of at least 3 characters 
  206. and a maximum of 25 characters.
  207.  
  208. @EndString
  209.  
  210. @If(@StrLen("@GRPNAME") < 3 || @StrLen("@GRPNAME") > 25)
  211. @Display
  212. You entered an Windows group name invalid group name.  
  213. Please reenter a group name that is 3 - 25 characters long.
  214. @Prompt="Invalid Group Name"
  215. @TitlePause
  216. @EndDisplay
  217. @GOTO REENTERGRPNAME
  218.  
  219. @EndIf // if invalid GRPNAME
  220.  
  221.  
  222. @ShowNormal   = "[ShowGroup(@GrpName, 1)]" // used to show group normally
  223. @ShowMin      = "[ShowGroup(@GrpName, 6)]" // used to show group minimized
  224. @ShowIcon     = "[ShowGroup(@GrpName, 2)]" // used to show group iconized
  225.  
  226. @SG = "@ShowMin"
  227. @If(@ProgramManager("[CreateGroup(@GRPNAME)]@SG") == -1)
  228.     @UsingOldPM = @TRUE
  229. @Endif
  230.  
  231.  
  232. //----------------------------------------------------------------------
  233. //Set up Windows Items with icons
  234.  
  235. @RI1 = "[ReplaceItem(Sci Fi Demo)]"
  236. @AI1 = "[AddItem(@Outdrive:\\@Subdir\\nimoy2d.exe, Sci Fi Demo, @OutDrive:\\@Subdir\\nimoy.ico, 0,,,@OutDrive:\\@Subdir)]"
  237. @RI2 = "[ReplaceItem(Readme)]"
  238. @AI2 = "[AddItem(WRITE.EXE @OutDrive:\\@Subdir\\readme.txt, Readme, @OutDrive:\\@Subdir\\nimoy.ico, 0)]"
  239.  
  240.  
  241. //-----------------------------------------------------------------------
  242. //Add fonts, notify Windows
  243.  
  244. @SetINI("FONTS","SciFi Normal (True Type)","@WinDrive:\\@WinSysDir\\scifi.fot","WIN.INI")
  245. @AddFont("@WinDrive:\\@WinSysDir\\scifi.fot")
  246. @SetINI("FONTS","SciFi 8, 8, 9, 10, 10, 12, 13, 14, 14, 15, 18, 21, 24 (96 dpi)","@WinDrive:\\@WinSysDir\\scifi.fon","WIN.INI")
  247. @AddFont("@WinDrive:\\@WinSysDir\\scifi.fon")
  248.  
  249.  
  250. @Display
  251. @Cls
  252. @Name will now install the necessary 
  253. Windows GROUP and ICONS as well as modify the PIF files 
  254. to reflect the installation path you entered during
  255. the installation.
  256.  
  257. Click the OK button to continue.
  258. @Prompt="@Name"
  259.  
  260.  
  261. @If (!@InternalTest) @TitlePause @EndIf
  262. @EndDisplay
  263.  
  264.  
  265. @If(@WinVersion < 0x30A || @UsingOldPM)
  266.   // Installing under Windows 3.0 or Couldn't access the DDEML.DLL
  267.   @SG = "@ShowNormal"
  268.   @PMLIST = "@SG@AI1"
  269.   @ProgramManager("@PMLIST")
  270. @Else
  271.   // if installing under windows 3.1 or greater & using DDEML.DLL
  272.   @SG = "@SHOWNormal"
  273.   @ProgramManager("@SG@RI1")  @ProgramManager("@SG@AI1")
  274.   @ProgramManager("@SG@RI2")  @ProgramManager("@SG@AI2")
  275.   @SG = "@ShowMin"
  276.   @ProgramManager("@SG")
  277. @EndIf
  278.  
  279.  
  280.  
  281. @If(@WinVersion < 0x30A || @UsingOldPM)
  282.   // Installing under Windows 3.0 or Couldn't access the DDEML.DLL
  283.   @SG = "@ShowNormal"
  284.   @PMLIST = "@SG@AI2"
  285. @Endif
  286.  
  287. //-------------------------------------------------------------------
  288. //Prompts for Quicktime 
  289.  
  290. @GetOption @Prompt = "Quicktime for Windows?"
  291. Quicktime for Windows 2.0.1 or later is 
  292. required for optimal video playback.
  293. Would you like the installer to 
  294. check your system for the 
  295. existence of Quicktime for 
  296. Windows?
  297.  
  298.        @Option 20001 ="Yes"
  299.     @Option 20002= "No"
  300. @EndOption
  301.  
  302.  
  303.  
  304.  
  305. /*////////////////////////////////////////////////////////////////////////
  306. // Make the ProgramManager full screen if started from DOS.  (Whenever a
  307. // program is launched directly from the command line when bringing up
  308. // Windows, the ProgmanManager is iconized, this will make Progman full
  309. // screen again when the installation is finished.
  310. ////////////////////////////////////////////////////////////////////////*/
  311.  
  312. @If(@Platform == @WIN)
  313.     @WinExec("PROGMAN", 1, 0)
  314. @EndIf
  315.  
  316. //---------------------------------------------------------------------
  317. //Check for QTW
  318.  
  319. @If (20001 [= @Option)
  320.     @If (@Exists ("@WindowsDrive:@WinSysDir\\mciqtw.drv"))
  321.     @If (@FileDate ("@WindowsDrive:\\@WinSysDir\\mciqtw.drv") >= @StrToDate("@qtdate"))
  322.  
  323.        @BackgroundMode(3,@Blue,@Black)
  324.        @Display
  325.        @Cls
  326.            Setup has detected a valid version of 
  327.         Quicktime for Windows in your system
  328.     
  329.     @Prompt="@Name"
  330.        @If (!@InternalTest) @TitlePause @EndIf   
  331.        @EndDisplay
  332.     @EndIf //filedate is good
  333.  
  334.     @ElseIf (@Exists ("@WindowsDrive:@WinSysDir\\mciqtw.drv"))
  335.     @If (@FileDate ("@WindowsDrive:\\@WinSysDir\\mciqtw.drv") < @StrToDate("@qtdate"))
  336.  
  337.     //Older QTW version found        
  338.     @GetOption @Prompt = "Install Quicktime for Windows v2.0.1?"
  339.     An previous version of Quicktime for Windows has been detected.  
  340.     When the setup program 
  341.      finishes, do you want 
  342.     to install an updated 
  343.     version of Quicktime 
  344.     for Windows?
  345.  
  346.         @Option 20005 ="Yes"
  347.         @Option 20006= "No"
  348.         @EndOption
  349.     @EndIf //filedate is bad
  350.  
  351.     @Else
  352.     //No previous QTW version found        
  353.     @GetOption @Prompt = "Install Quicktime for Windows v2.0.1?"
  354.     Install does not detect Quicktime for Windows in your system.
  355.     When the setup program 
  356.      finishes, do you want 
  357.     to install an Quicktime 
  358.     for Windows?
  359.  
  360.     @Option 20005 ="Yes"
  361.     @Option 20006= "No"
  362.     @EndOption
  363.  
  364.     @EndIf  //Exists
  365. @EndIf //Option 20001
  366.  
  367.  
  368.  
  369. //------------------------------------------------------------
  370. //Launch QTW 2.0.1 Installer
  371.  
  372. @If ((20006 [= @Option) || (20002 [= @Option))
  373.    @BackgroundMode(3,@Blue,@Black)
  374.    @Display
  375.    @Cls
  376.        Quicktime for Windows 2.0.1 can be installed manually
  377.     from your cd-rom drive. Choose FILE-->RUN from the
  378.     Windows program manager and select
  379.         
  380.     <cd-rom drive letter:>\scifi_2d\qt_setup\setup.exe
  381.    
  382.     @Prompt="@Name"
  383.    @If (!@InternalTest) @TitlePause @EndIf   
  384.    @EndDisplay
  385. /*
  386.    @GetOption @Prompt = "View README file?"
  387.     Do you wish to read the README file immediately    
  388.     after the installation has finished?
  389.       @Option 30001 = "Yes"
  390.       @Option 30002 = "No"
  391.    @EndOption
  392. */
  393. @EndIf
  394.  
  395. //-------------------------------------------------------------------------------------
  396. //Closing screen
  397.  
  398. @If (20005 [= @Option)
  399.     @Display 
  400.     @Cls
  401.     @Name is finished installing.  If you have any technical 
  402.     or sales questions, please feel free to contact us at:
  403.     
  404.         Global Interactive
  405.         12121 Wilshire Blvd, Suite 1001
  406.         Los Angeles, CA  90025
  407.      
  408.         (800) 517-4738 Sales
  409.         (310) 442-7128 Fax
  410.  
  411.  
  412.  
  413.     Hit OK to begin the Quicktime Installation Process
  414.  
  415.     @Prompt="@Name"
  416.     @If (!@InternalTest) @TitlePause @EndIf
  417.     @EndDisplay
  418. @Else
  419.  
  420.     @Display 
  421.     @Cls
  422.     @Name is finished installing.  If you have any technical 
  423.     or sales questions, please feel free to contact us at:
  424.     
  425.         Global Interactive
  426.         12121 Wilshire Blvd, Suite 1001
  427.         Los Angeles, CA  90025
  428.      
  429.         (800) 517-4738 Sales
  430.         (310) 442-7128 Fax
  431.  
  432.     @Prompt="@Name"
  433.     @If (!@InternalTest) @TitlePause @EndIf
  434.     @EndDisplay
  435.  
  436. @EndIf//Closing Screen
  437.  
  438.  
  439. //-------------------------------------------------------------------------------------
  440. //Finish Block
  441.  
  442. @Finish
  443.  
  444. @If (20005 [= @Option)
  445.     @WinExec("@InDrive:\\scifi_2d\\qt_setup\\setup.exe",3,0)
  446.     @Exit
  447. @EndIf //Install Quicktime
  448.  
  449.  
  450. @EndFinish
  451.  
  452.  
  453.  
  454. /*////////////////////////////////////////////////////////////////////////
  455. // View the README.NOW file with WRITE.EXE if it exists. (Windows only)
  456. ////////////////////////////////////////////////////////////////////////*/
  457.  
  458. /*
  459. @If(@Platform == @WIN && 30001 [= @Option)
  460.     @If(@Exists("@OutDrive:\\@Subdir\\README.TXT") && @Exists("@WindowsDrive:\\@WindowsDir\\WRITE.EXE"))
  461.         @WinExec("WRITE @OutDrive:\\@Subdir\\README.TXT", 3)
  462.         @Exit
  463.     @EndIf
  464. @EndIf
  465. */
  466.  
  467. /*////////////////////////////////////////////////////////////////////////
  468. // Ordinarily you may also wish to have an @FINISH block at this point.  It
  469. // is not required, and only has the advantage of being executed after files
  470. // have been installed if you are not using the @IMMEDIATE mode (see the
  471. // manual for more information regarding @IMMEDIATE and @FINISH).  This
  472. // @FINISH block will also be executed after a @SETCONFIG or @SETAUTOEXEC
  473. // block has been executed.  We did not use either of these last two blocks
  474. // in this script.  They are only necessary if you wish to modify the
  475. // CONFIG.SYS and AUTOEXEC.BAT files during the installation.
  476. ////////////////////////////////////////////////////////////////////////*/
  477.  
  478.  
  479. @Exit
  480. /*End - of - File */
  481.  
  482.