//*****************************************************************************
// Name         : INSTALL.DAT
// Project      : GARFIELD: Installation miro WINDOWS-BASIC-DISK
// Function     : Scriptfile for KDC-wINSTALL
// Author       : KF / miro Computer Products AG, 
//                Carl-Miele-Str. 4, D-38112 Braunschweig
// created      : 14.02.95
// changed      : KF 04.07.95
// revision......when...................who.....->.where.and.what..............
// $Log:$
//*****************************************************************************

//*** project header block ****************************************************


@DefineProject
  @Name       = "miro·video - Drivers for Windows"
  @Version    = "1.10"
  @OutDrive   = @WindowsDrive
  @SubDir     = "@WindowsDir"
  @InDiskBell = 1
@EndProject


//*** define variables ********************************************************

@DefineVars
  @QString @mName     = "Install disk"
  @Integer @Red       = @RGB (255,0,0)
  @Integer @Green     = @RGB (0,255,0)
  @Integer @Blue      = @RGB (0,0,255)
  @Integer @Black     = @RGB (0,0,0)
  @Integer @White     = @RGB (255,255,255)
  @Integer @UnInstall = @False
  @Integer @OldLang   = 0
  @Integer @Delay     = 0
  @Integer @d         = 5
  @If (@DirExists ("@WindowsDrive:@WindowsDir\\SYSTEM"))
    @Dir @wSysDir     = "@SubDir\\SYSTEM"
  @Else
    @Dir @wSysDir     = "@SubDir"
  @EndIf
  @Dir @TsengDir     = "\\VIDEO_TD"
  @Drive @TsengDrive = C
  @If (@DriveRemote (@InDrive))
    @Integer @IsFloppy = 0
  @ElseIf (@Removable (@InDrive))
    @Integer @IsFloppy = 1
  @Else
    @Integer @IsFloppy = 0
  @EndIf
  @QString @emex  = ""
  @QString @zemex = ""
  @QString @msvid = ""
  @QString @msvidx = ""
  @QString @oemset = ""
  @QString @merke = ""
  @Integer @i         = 1
  @Integer @j         = 0
  @Integer @isset = @FALSE
  @QString @l     = "B800"
  @Integer @lnew = 0
  @QString @h     = "BFFF"
  @Integer @hnew = 0
@EndVars


//*** input language from user ************************************************

@SetGroup (E)
@OldLang = 1
@SetLang (1)

INPUTLANG:
@GetGroups
  @DlgCtrlSize (0,8,20,12,35)
  @BackGroundMode (2,,)
  @Cls 
  @If ('D' [= @Group)

Willkommen bei der miro·video Installation 

Sprachauswahl:

  @Set E = "English"
  @Set D = "Deutsch"

  @Else

Welcome to the miro·video installation 

Language selection:

  @Set E = "English"

  @EndIf

@EndGroups

@If ('D' [= @Group && @OldLang != 1)
  @FlushGroups ()
  @SetGroup (D)
  @OldLang = 1
  @SetLang (1)
@ElseIf ('E' [= @Group && @OldLang != 1)
  @FlushGroups ()
  @SetGroup (E)
  @OldLang = 1
  @SetLang (1)
@EndIf  

//*** define language dependant strings ***************************************

@DefineVars
  @If ('D' [= @Group)
    @QString @M00 = "Die Installation unterstützt keine" 
    @QString @M01 = "Version von Windows vor 3.1 !"
    @QString @M10 = "Wählen Sie das Board aus, welches Sie installieren wollen:" 
    @QString @M12 = "Installierte Software komplett entfernen"
    @QString @M20 = "Wählen Sie mit der Maus die Software aus, die Sie installieren wollen:" 
    @QString @M22 = "Windows 3.1 Treiber Software"
    @QString @M23 = "miro Treiber für Video for Windows"
    @QString @M24 = "miroNIGHTSHOW"
    @QString @M30 = "Software entfernen:"
    @QString @M31 = "Die installierte Software ist aktiv und kann nicht gelöscht werden."
    @QString @M32 = "Drücken Sie OK, um mit der Installation fortzufahren."
    @QString @M40 = "Geben Sie das Laufwerk für die miro·video Tools an:"
    @QString @M45 = "Geben Sie das Verzeichnis für die miro·video Tools an:"
    @QString @M300 = "Der installierte miroVIDEO DC1 Treiber ist weiterhin aktiv." 
    @QString @M301 = "Sie können den miroVIDEO 10/20TD live Aufnahme-Treiber über "
    @QString @M302 = "das Fenster miroVIDEO DC1 Hardware-Einstellungen aktivieren."
    @QString @M303 = "Dem bisher aktiven Aufnahmegerät wird Gerätenummer "
    @QString @M304 = ""
    @QString @M305 = "zugewiesen."
  @Else
    @QString @M00 = "The installation does not support"
    @QString @M01 = "any version of Windows prior to 3.1 !"
    @QString @M10 = "Select with your mouse the board you want to install:" 
    @QString @M12 = "Completely remove installed software"
    @QString @M20 = "Select with your mouse the software you want to install:"
    @QString @M22 = "Windows 3.1 driver software"
    @QString @M23 = "miro driver for Video for Windows"
    @QString @M24 = "miroNIGHTSHOW"
    @QString @M30 = "Uninstall software:"
    @QString @M31 = "The installed software is active and can therfore not be deleted."
    @QString @M32 = "Press OK to proceed with the installation"
    @QString @M40 = "Enter the drive for the miro·video tools:"
    @QString @M45 = "Enter the directory for the miro·video tools:"
    @QString @M300 = "The installed miroVIDEO DC1 driver continues to be active." 
    @QString @M301 = "To activate the miroMAGIC 40PV video capture driver, go to "
    @QString @M302 = "the miroVIDEO DC1 Hardware Setup window."
    @QString @M303 = "Device number "
    @QString @M304 = " is assigned to the Video Capture Device"
    @QString @M305 = "that has been active until now."
  @EndIf
@EndVars

  
//*** check windows version ***************************************************

@If (@WindowsMajor < 3 || @WindowsMajor == 3 && @WindowsMinor < 1)
  @FlushKeyboard
  @Display
  @BackGroundMode (3, @Red, @Red)
  @Cls
@M00
@M01
  @Pause
  @Abort
  @EndDisplay
@Endif


//*** input board type by user ************************************************

BOARDSELECT:
@GetOption
  @DlgCtrlSize (0,4,0,8,50)
  @BackGroundMode (3,@Blue, @Blue)
  @Cls

@M10

  @Option 100 = "miroVIDEO 20TD" 
  @Option 101 = "miroVIDEO 10TD" 
  @Option 210 = "@M12"
@EndOption


//*** input items to install from user ****************************************

@If (210 [! @Option) // uninstall
  @SetOption (200)
  @SetOption (201)
  @GetOption
    @CheckBox
    @DlgCtrlSize (0,4,0,8,50)
    @BackGroundMode (3,@Blue, @Blue)
    @Cls
  
@M20

    @Option 200 = "@M22"
    @Option 201 = "@M23"
    @Option 202 = "@M24"
  @EndOption
@EndIf


//*** input SYSTEM directory by user ******************************************

@If (200 [= @Option || 201 [= @Option)

@GetOutDrive @TsengDrive
    @Suppress A
    @Suppress B
@DlgCtrlSize (0,4,0,8,50)
@BackGroundMode (3,@Blue, @Blue)
@Cls
@M40
@EndOutDrive

@GetSubDir @TsengDir
@DlgCtrlSize (0,4,0,5,50)
@BackGroundMode (3,@Blue, @Blue)
@Cls
@Default = "\\VIDEO_TD"
@M45
@EndSubDir

@EndIf


//*** Uninstall software ******************************************************

@If (210 [= @Option) // uninstall
@If (   (@StrFind(@GetINI ("boot", "display.drv", "system.ini"),"TLIW") > -1)
    ||  (@StrFind(@GetINI ("boot", "display.drv", "system.ini"),"tliw") > -1)
    )
  @FlushKeyboard
  @Display
@M31
@M32
  @Pause
  @EndDisplay
  @ClearOption (210)
  @UnInstall = @True
  @Goto BOARDSELECT

@Else

  @FlushKeyboard
  @Display
@M30
  @Pause
  @EndDisplay

  @Delete ("@OutDrive:@wSysDir\\OEMV20TD.*")
  @Delete ("@OutDrive:@wSysDir\\OEMV10TD.*")
  @Delete ("@OutDrive:@wSysDir\\V7VGA.*")
  @Delete ("@OutDrive:@wSysDir\\VDDTLI4.386")
  @Delete ("@TsengDrive:@TsengDir\\*.*")
  @Delete ("@OutDrive:@SubDir\\MIROTV.DAT")
  @Delete ("@OutDrive:@SubDir\\MIROTV.EXE")
  @Delete ("@OutDrive:@SubDir\\MIROTV.INI")
  @Delete ("@OutDrive:@wSysDir\\CTL3D.DLL")
  @Delete ("@OutDrive:@wSysDir\\MDI.DLL")
  @Delete ("@OutDrive:@wSysDir\\MIROCAP.DRV")
  @Delete ("@OutDrive:@wSysDir\\MIROMCI.DRV")
  @Delete ("@OutDrive:@wSysDir\\MIROVIXL.DRV")
  @Delete ("@OutDrive:@wSysDir\\DCIVIPER.DRV")
  @Delete ("@OutDrive:@wSysDir\\WINVIPER.DLL")
  @Delete ("@OutDrive:@wSysDir\\TLIW32*.DRV")

  @WinExec ("PROGMAN.EXE", 1) 
@Display // ???
  @ProgramManager ("[ShowGroup (miroVIDEO TD live, 2)]")
  @Delay = @SystemDate 
CLa: @If (@SystemDate - @Delay <= @d) @Goto CLa @EndIf 
  @ProgramManager ("[DeleteItem (Video Select)]")
  @Delay = @SystemDate 
CLb: @If (@SystemDate - @Delay <= @d) @Goto CLb @EndIf 
  @ProgramManager ("[DeleteItem (miroTV)]")
  @Delay = @SystemDate 
CLc: @If (@SystemDate - @Delay <= @d) @Goto CLc @EndIf 
  @ProgramManager ("[DeleteItem (Information)]")
  @Delay = @SystemDate 
CLd: @If (@SystemDate - @Delay <= @d) @Goto CLd @EndIf 
  @ProgramManager ("[DeleteGroup (miroVIDEO TD live)]")
  @Delay = @SystemDate 
CLe: @If (@SystemDate - @Delay <= @d) @Goto CLe @EndIf 
  @ProgramManager ("[DeleteGroup (miroVIDEO 20TD live)]")
  @Delay = @SystemDate 
CLj: @If (@SystemDate - @Delay <= @d) @Goto CLj @EndIf 
@EndDisplay

  @merke = @GetINI ("drivers", "VIDC.VIXL", "system.ini")
  @If ("@merke" == "MIROVIXL.DRV")
    @SetINI ("drivers", "VIDC.VIXL",, "system.ini")
  @EndIf
  @merke = @GetINI ("drivers", "DCI", "system.ini")
  @If ("@merke" == "DCIVIPER")
    @SetINI ("drivers", "DCI",, "system.ini")
  @EndIf
  @merke = @GetINI ("drivers", "VIDS.DRAW", "system.ini")
  @If ("@merke" == "MIROVIXL.DRV")
    @SetINI ("drivers", "VIDS.DRAW",, "system.ini")
  @EndIf
  @merke = @GetINI ("drivers", "VIDS.FULL", "system.ini")
  @If ("@merke" == "MIROVIXL.DRV")
    @SetINI ("drivers", "VIDS.FULL",, "system.ini")
  @EndIf

  @SetINI ("Tseng", "vidselect",, "system.ini")
  @SetINI ("Tseng", "DisplayIndex",, "system.ini")
  @SetINI ("Tseng", "refresh1280",, "system.ini")
  @SetINI ("Tseng", "frequency",, "system.ini")
  @SetINI ("Tseng", "DisplayInf",, "system.ini")
  @SetINI ("Tseng", "refresh1024",, "system.ini")
  @SetINI ("Tseng", "resolution",, "system.ini")
  @SetINI ("Tseng", "colordepth",, "system.ini")
  @SetINI ("Tseng", "color16format",, "system.ini")
  @SetINI ("Tseng", "fontsize",, "system.ini")
  @SetINI ("ScreenSaver.miroNIGHTSHOW", "MovingSpeed",, "control.ini")
  @SetINI ("ScreenSaver.miroNIGHTSHOW", "ShowType",, "control.ini")
  @SetINI ("ScreenSaver.miroNIGHTSHOW", "BitmapFile",, "control.ini")
  @SetINI ("ScreenSaver.miroNIGHTSHOW", "AVIFile",, "control.ini")
  @SetINI ("ScreenSaver.miroNIGHTSHOW", "VideoConfig",, "control.ini")
  @SetINI ("ScreenSaver.miroNIGHTSHOW", "VideoConfigLen",, "control.ini")
  @SetINI ("ScreenSaver.miroNIGHTSHOW", "PWProtected",, "control.ini")

    //del msvideo in drivers section
    @i = 1
    @msvid = @GetINI ("drivers", "msvideo", "system.ini")
    @If ("@msvid" == "mirocap.drv")
      @SetINI ("drivers", "msvideo",, "system.ini")
      @SetINI ("Userinstallable.drivers", "msvideo",, "control.ini")
    @Else 
DELMSVIDEO:
      @msvid = @GetINI ("drivers", "msvideo@i", "system.ini")
      @If ("@msvid" == "mirocap.drv")
        @SetINI ("drivers", "msvideo@i",, "system.ini")
        @SetINI ("Userinstallable.drivers", "msvideo@i",, "control.ini")
      @Else 
        @i = (@i + 1)
        @If (@i == 10)
        @Else
          @Goto DELMSVIDEO
        @EndIf
      @EndIf
    @EndIf

  @ClearOption (210)
  @UnInstall = @True
  @Goto BOARDSELECT

@EndIf
@EndIf


//*** files to be copied ******************************************************
@If (200 [= @Option) // Windows drivers
  @DefineDisk
    @Label = "Install disk # 1/1"
    @BeginLib DRIVERS.RED
      @File OEMSETUP.INF @Size 16000  @Out @wSysDir\\OEMV20TD.INF @Option 100 
      @File OEMV10TD.INF @Size 16000  @Out @wSysDir\\OEMV10TD.INF @Option 101

      @File TLIW32P1.DRV @Size 140000 @Out @wSysDir\\*.* @Option 100
      @File TLIW32P3.DRV @Size 140000 @Out @wSysDir\\*.* @Option 100  
      @File TLIW32P6.DRV @Size 140000 @Out @wSysDir\\*.* @Option 100  
      @File TLIW32P8.DRV @Size 140000 @Out @wSysDir\\*.* @Option 100  

      @File TLIW32P1.DRV @Size 140000 @Out @wSysDir\\*.* @Option 101
      @File TLIW32P3.DRV @Size 140000 @Out @wSysDir\\*.* @Option 101  
      @File TLIW32P6.DRV @Size 140000 @Out @wSysDir\\*.* @Option 101  
      @File TLIW32P8.DRV @Size 140000 @Out @wSysDir\\*.* @Option 101  

      @File VGACOLRX.GR2 @Size 5000   @Out @wSysDir\\*.* 
      @File V7VGA.3GR    @Size 15000  @Out @wSysDir\\*.* 
      @File VDDTLI4.386  @Size 35000  @Out @wSysDir\\*.* 
      @File VGALOGO.LGO  @Size 2000   @Out @wSysDir\\*.* 

      @File J18FIX.FON   @Size 8500   @Out @wSysDir\\vgafix.fon 
      @File J18OEM.FON   @Size 8500   @Out @wSysDir\\vgaoem.fon 
      @File J18SYS.FON   @Size 8500   @Out @wSysDir\\vgasys.fon 
      @File J22FIX.FON   @Size 15000  @Out @wSysDir\\8514fix.fon 
      @File J22OEM.FON   @Size 15000  @Out @wSysDir\\8514oem.fon 
      @File J22SYS.FON   @Size 15000  @Out @wSysDir\\8514sys.fon 
      @File CGA40WOA.FON @Size 7000   @Out @wSysDir\\*.* 
      @File CGA80WOA.FON @Size 5000   @Out @wSysDir\\*.* 
      @File CGA40850.FON @Size 6400   @Out @wSysDir\\*.* 
      @File CGA80850.FON @Size 4400   @Out @wSysDir\\*.* 
      @File COURF.FON    @Size 32000  @Out @wSysDir\\*.* 
      @File EGA40WOA.FON @Size 9000   @Out @wSysDir\\*.* 
      @File EGA80WOA.FON @Size 6000   @Out @wSysDir\\*.* 
      @File EGA40850.FON @Size 8400   @Out @wSysDir\\*.* 
      @File EGA80850.FON @Size 6000   @Out @wSysDir\\*.* 
      @File GSYS16.FON   @Size 350000 @Out @wSysDir\\*.* 
      @File GSYS20.FON   @Size 640000 @Out @wSysDir\\*.* 
      @File SERIFF.FON   @Size 83000  @Out @wSysDir\\*.* 
      @File SMALLF.FON   @Size 43000  @Out @wSysDir\\*.* 
      @File SSERIFF.FON  @Size 90000  @Out @wSysDir\\*.* 
      @File SYMBOLF.FON  @Size 82000  @Out @wSysDir\\*.* 

      @File TLIMODED.DLL @Size 87000  @Out @TsengDrive:@TsengDir\\*.*  
      @File TLIMODE.EXE  @Size 26000  @Out @TsengDrive:@TsengDir\\*.*
      @File TLITEST.EXE  @Size 12000  @Out @TsengDrive:@TsengDir\\*.*  
      @File TLITEST.PIF  @Size 600    @Out @TsengDrive:@TsengDir\\*.*  
      @File DVA.386      @Size 6000   @Out @wSysDir\\*.* 

    @EndLib
  @EndDisk
@EndIf

@If (200 [= @Option || 201 [= @Option)
  @DefineDisk
    @Label = "Install disk # 1/1"
    @BeginLib DRIVERS2.RED
      @File TDINIT.EXE   @Size 12000  @Out @TsengDrive:@TsengDir\\*.*  
      @File TESTPIC.EXE  @Size 87000  @Out @TsengDrive:@TsengDir\\*.*  
      @File DRICON.EXE   @Size 17000  @Out @TsengDrive:@TsengDir\\*.*  
    @EndLib
  @EndDisk
@EndIf

@If (201 [= @Option) // or video drivers
  @DefineDisk
    @Label = "Install disk # 1/1"
    @BeginLib DRIVERS2.RED
      @File MIROTV.DAT   @Size 800    @Out *.*
      @File MIROTV.EXE   @Size 250000 @Out *.* 
      @File MIROTV.INI   @Size 200    @Out *.*   
      @File CTL3D.DLL    @Size 21000  @Out @wSysDir\\*.* 
      @File WINVIPER.DLL @Size 36000  @Out @wSysDir\\*.* 
      @File DCIVIPER.DRV @Size 26000  @Out @wSysDir\\*.* 
                         
      @File MDI.DLL      @Size 45000  @Out @wSysDir\\*.*  
      @File MIROCAP.DRV  @Size 10000  @Out @wSysDir\\*.*  
      @File MIROMCI.DRV  @Size 17000  @Out @wSysDir\\*.*  
      @File MIROVIXL.DRV @Size 38000  @Out @wSysDir\\*.*  
    @EndLib
  @EndDisk
@EndIf

@If (202 [= @Option) // or video drivers
  @DefineDisk
    @Label = "Install disk # 1/1"
    @BeginLib DRIVERS2.RED
      @File MIRONTSH.SCR @Size 160000 @Out *.* 
    @EndLib
  @EndDisk
@EndIf


//*** set variables in .INI files *********************************************

@If (200 [= @Option) // Windows drivers
   @SetINI ("Tseng", "vidselect","@TsengDrive:@TsengDir\\tlimode.exe", "system.ini")
@EndIf
@If (201 [= @Option) // Video drivers
  @SetINI ("drivers", "VIDC.VIXL","MIROVIXL.DRV", "system.ini")
  @SetINI ("drivers", "DCI","DCIVIPER", "system.ini")
  @If (100 [= @Option)
    @SetINI ("drivers.desc", "MIROCAP.DRV","miroVIDEO 20TD live capture", "control.ini")
    @SetINI ("drivers.desc", "MIROMCI.DRV","[MCI] miroVIDEO 20TD live! Overlay Driver", "control.ini")
  @ElseIf (101 [= @Option)
    @SetINI ("drivers.desc", "MIROCAP.DRV","miroVIDEO 10TD live capture", "control.ini")
    @SetINI ("drivers.desc", "MIROMCI.DRV","[MCI] miroVIDEO 10TD live! Overlay Driver", "control.ini")
  @EndIf
  @SetINI ("drivers.desc", "MIROVIXL.DRV","miroVIDEO-XL Codec", "control.ini")


  //set msvideo in the drivers section
  @i = 1
  @msvid = @GetINI ("drivers", "msvideo", "system.ini")
  @If (("@msvid" == "") || ("@msvid" == "mirocap.drv"))
    @SetINI ("drivers", "msvideo","mirocap.drv", "system.ini")
    @SetINI ("Userinstallable.drivers", "msvideo","mirocap.drv", "control.ini")
  @Else
    @If (("@msvid" == "videodc1.drv") || ("@msvid" == "VIDEODC1.DRV"))
      @msvid = @GetINI ("drivers", "msvideo9", "system.ini")
      @SetINI ("drivers", "msvideo9","mirocap.drv", "system.ini")
      @SetINI ("Userinstallable.drivers", "msvideo9","mirocap.drv", "control.ini")
      @SetOption (300)
      @SetINI ("miro.dricon", "driver1", "videodc1.drv", "win.ini")
    @Else
      @SetINI ("drivers", "msvideo","mirocap.drv", "system.ini")
      @SetINI ("Userinstallable.drivers", "msvideo","mirocap.drv", "control.ini")
      @SetOption (301)
    @Endif
MSVIDEOCOUNT:
    @msvidx = @GetINI ("drivers", "msvideo@i", "system.ini")
    @If ("@msvidx" == "")
      @SetINI ("drivers", "msvideo@i","@msvid", "system.ini")
    @ElseIf (("@msvid" == "") || ("@msvid" == "mirocap.drv"))
      //msvideo==VIDEODC1
    @Else 
      @i = (@i + 1)
      @If (@i == 9)
        @i = (8888)
        @Goto MSVIDEOCOUNT
      @ElseIf (@i == 8900)
      @Else
        @Goto MSVIDEOCOUNT
      @EndIf
    @EndIf
  @EndIf

  //set EMMExclude 
  @emex = @GetINI ("386Enh", "EMMExclude", "system.ini")
  @If (@StrLen("@emex") > 1)
    @i = 0
UPPER:
    @j = (@StrLen("@emex") - @i)
    @j = (@j - 1)
    @If (@StrIndex("@emex", @i) == @StrIndex("a", 0))
      @zemex = "@StrHead("@emex",@i)A@StrTail("@emex", @j)"
    @ElseIf (@StrIndex("@emex", @i) == @StrIndex("b", 0))
      @zemex = "@StrHead("@emex",@i)B@StrTail("@emex", @j)"
    @ElseIf (@StrIndex("@emex", @i) == @StrIndex("c", 0))
      @zemex = "@StrHead("@emex",@i)C@StrTail("@emex", @j)"
    @ElseIf (@StrIndex("@emex", @i) == @StrIndex("d", 0))
      @zemex = "@StrHead("@emex",@i)D@StrTail("@emex", @j)"
    @ElseIf (@StrIndex("@emex", @i) == @StrIndex("e", 0))
      @zemex = "@StrHead("@emex",@i)E@StrTail("@emex", @j)"
    @ElseIf (@StrIndex("@emex", @i) == @StrIndex("f", 0))
      @zemex = "@StrHead("@emex",@i)F@StrTail("@emex", @j)"
    @EndIf
    @emex = @zemex
    @i = (@i +1)
    @If (@i < @StrLen("@emex"))
      @Goto UPPER
    @EndIf
      

    @i = @StrFind("@emex", "-")
    @If (@i == 4 && @StrLen("@emex") == 9)
      @l = @StrHead("@emex", 4)
      @h = @StrTail("@emex", 4)
      @isset = @TRUE
    @Else
      @SetINI ("386Enh", "EMMExclude","B800-BFFF", "system.ini")
    @EndIf
  @Else
    @SetINI ("386Enh", "EMMExclude","B800-BFFF", "system.ini")
  @EndIf

  @If (@isset == @TRUE)
    @If    (  (  @StrIndex("@l", 0)  > @StrIndex("B800",0)
              )
           || (  @StrIndex("@l", 0) == @StrIndex("B800",0) 
              && @StrIndex("@l", 1)  > @StrIndex("B800",1)
              )
           || (  @StrIndex("@l", 0) == @StrIndex("B800",0) 
              && @StrIndex("@l", 1) == @StrIndex("B800",1)
              && @StrIndex("@l", 2)  > @StrIndex("B800",2)
              )
           || (  @StrIndex("@l", 0) == @StrIndex("B800",0) 
              && @StrIndex("@l", 1) == @StrIndex("B800",1)
              && @StrIndex("@l", 2) == @StrIndex("B800",2)
              && @StrIndex("@l", 3)  > @StrIndex("B800",3)
              )
           )
      @lnew = 1 
    @EndIf
    @If (  (  @StrIndex("@h", 0)  < @StrIndex("BFFF",0)
           )
        || (  @StrIndex("@h", 0) == @StrIndex("BFFF",0) 
           && @StrIndex("@h", 1)  < @StrIndex("BFFF",1)
           )
        || (  @StrIndex("@h", 0) == @StrIndex("BFFF",0) 
           && @StrIndex("@h", 1) == @StrIndex("BFFF",1)
           && @StrIndex("@h", 2)  < @StrIndex("BFFF",2)
           )
        || (  @StrIndex("@h", 0) == @StrIndex("BFFF",0) 
           && @StrIndex("@h", 1) == @StrIndex("BFFF",1)
           && @StrIndex("@h", 2) == @StrIndex("BFFF",2)
           && @StrIndex("@h", 3)  < @StrIndex("BFFF",3)
           )
        )
      @hnew = 1 
    @EndIf

    @If (@lnew == 1 && @hnew == 1)
      @SetINI ("386Enh", "EMMExclude","B800-BFFF", "system.ini")
    @ElseIf (@lnew == 1 && @hnew != 1)
      @SetINI ("386Enh", "EMMExclude","B800-@h", "system.ini")
    @ElseIf (@lnew != 1 && @hnew == 1)
      @SetINI ("386Enh", "EMMExclude","@l-BFFF", "system.ini")
    @Else
      @SetINI ("386Enh", "EMMExclude","@l-@h", "system.ini")
    @EndIf
  @EndIf


@EndIf

@If (200 [= @Option) // Windows drivers
  //Index for oemsetup.inf
  @j = 0
OEMCOUNT:
  @If (@Exists("@OutDrive:@wSysDir\\oem@j.inf"))
    @If ("@GetINI ("OEM", "oem", "@OutDrive:@wSysDir\\oem@j.inf")" != "A1B23")
      @j = (@j +1)
      @Goto OEMCOUNT
    @EndIf
  @EndIf
@EndIf


  @If (300 [= @Option) // miro windows tools
    @FlushKeyboard
    @Display
  @M300
  @M301
  @M302
    @Pause
    @EndDisplay
  @EndIf
  @If (301 [= @Option) // miro windows tools
    @FlushKeyboard
    @Display
  @M303 @i @M304
  @M305
    @Pause
    @EndDisplay
  @EndIf

//*** old software to be deleted **********************************************

@If (200 [= @Option || 201 [= @Option)
@EndIf

//*** project trailer block ***************************************************

@Finish

  @BackGroundMode (3,@Blue, @Blue)
  @WinExec ("PROGMAN.EXE", 1) 

  @If (200 [= @Option    // copy if Windows drivers
      || 201 [= @Option) // or miro windows tools
    @Copy ("@InDrive:\\README.ENG","@TsengDrive:@TsengDir\\README.TXT")
  @EndIf

  @If (200 [= @Option || 201 [= @Option)
    @ProgramManager ("[CreateGroup (miroVIDEO TD live, MVIDEOTD.GRP)]")
    @Delay = @SystemDate 
La: @If (@SystemDate - @Delay <= @d) @Goto La @EndIf 
    @ProgramManager ("[ReplaceItem (Video Select)]")
    @Delay = @SystemDate 
Lb: @If (@SystemDate - @Delay <= @d) @Goto Lb @EndIf 
    @ProgramManager ("[AddItem (@TsengDrive:@TsengDir\\TLIMODE.EXE, Video Select)]")
    @Delay = @SystemDate 
Lc: @If (@SystemDate - @Delay <= @d) @Goto Lc @EndIf 
    @ProgramManager ("[ReplaceItem (miroTV)]")
    @Delay = @SystemDate 
Ld: @If (@SystemDate - @Delay <= @d) @Goto Ld @EndIf 
    @ProgramManager ("[AddItem (@OutDrive:@SubDir\\MIROTV.EXE, miroTV)]")
    @Delay = @SystemDate 
Le: @If (@SystemDate - @Delay <= @d) @Goto Le @EndIf 
    @ProgramManager ("[ReplaceItem (Information)]")
    @Delay = @SystemDate 
Lf: @If (@SystemDate - @Delay <= @d) @Goto Lf @EndIf 
    @ProgramManager ("[AddItem (NOTEPAD @TsengDrive:@TsengDir\\readme.txt, Information)]")
    @Delay = @SystemDate 
Ls: @If (@SystemDate - @Delay <= @d) @Goto Ls @EndIf 
    @ProgramManager ("[ShowGroup (miroVIDEO TD live, 1)]")
    @Delay = @SystemDate 
Lt: @If (@SystemDate - @Delay <= @d) @Goto Lt @EndIf 
  @EndIf

  @If (100 [= @Option)
    @SetINI ("UTILITIES", "defaultdir","@TsengDrive:@TsengDir", "@OutDrive:@wSysDir\\OEMV20TD.INF")
    //Index for oemsetup.inf
    @Delete ("@OutDrive:@wSysDir\\OEM@j.INF")
    @Rename ("@OutDrive:@wSysDir\\OEMV20TD.INF","OEM@j.INF")
    @Delete ("@OutDrive:@wSysDir\\OEMV20TD.*")
  @ElseIf (101 [= @Option)
    @SetINI ("UTILITIES", "defaultdir","@TsengDrive:@TsengDir", "@OutDrive:@wSysDir\\OEMV10TD.INF")
    //Index for oemsetup.inf
    @Delete ("@OutDrive:@wSysDir\\OEM@j.INF")
    @Rename ("@OutDrive:@wSysDir\\OEMV10TD.INF","OEM@j.INF")
    @Delete ("@OutDrive:@wSysDir\\OEMV10TD.*")
  @EndIf

  @ChDrive (@WindowsDrive)
  @ChDir ("@WindowsDir")
  @If (200 [= @Option) // Windows drivers
    @ReturnValue (4711)
    @WinExec ("@TsengDrive:@TsengDir\\TLIMODE.EXE", 1) 
  @EndIf
  @If (201 [= @Option) // Windows drivers
    @WinExec ("@TsengDrive:@TsengDir\\DRICON.EXE mirocap.drv", 1) 
  @EndIf
@EndFinish


//*** eof *********************************************************************

