@DefineProject
        @Name = "OPUS PAYROLL"
        @Version = "3.0"
        @OutDrive = @BootDrive
        @Subdir = "\\PAYROLL"
        @Requires  @HardDisk
@EndProject

@Display
        @Cls

        This program will install @Name @Version on your computer
        system and verify the integrity of this distribution.
        You may press the ESC key at any time to quit the installation.

        We will give you the option of installing an evaluation copy
        OPUS PAYROLL with sample data, a presentation demo or both.

        Each question has a default answer.  If the default answer is
        correct, press the ENTER key in response to the question.
        Otherwise, type the answer and then press the ENTER key.

        If you make a mistake while typing, press the BACKSPACE key
        and then retype the answer.

        @Pause
@EndDisplay

@DefineVars
    @QString @GroupName = "OPUS PAYROLL"
    // Line to be added in CONFIG.SYS file
    @QString @LineBeingAdded = "DOS=HIGH,UMB,AUTO"
    @QString @LineRead = ""
    @QString @Exam = "Opus Payroll Example.PIF"
    @QString @Reg  = "Opus Payroll 800-442-0361.PIF"
    @QString @Demo = "Opus Payroll Demo.lnk"
    @Integer @EOF = 0
    @Integer @TMPTime = @SystemDate
    @QString @TMPFile = "@StrTail("@StrUpr("@TMPTime")",8).TMP"
@EndVars

@NumberOfDisks = 1
@GetOutDrive
        @Suppress(0,17)
        @Cls

@DlgCtrlSize(0,5,25,10,35)
        On which disk drive do you wish to install @Name?



@EndOutDrive
@DlgCtrlSize(0,-1,-1,0,0)

@GetSubdir
        @Cls
@DlgCtrlSize(0,8,15,9,55)
        Now you need to specify the disk destination subdirectory.  The
        subdirectory is the location on your disk where the @Name
        will be installed.  If you don't know what a "subdirectory" is, you
        need not worry about it, and should press ENTER.





@EndSubdir
@DlgCtrlSize(0,-1,-1,0,0)

@If(@WinMajor > 3)
    @GetString @GroupName
        Please enter the name of the Start Menu Item you
        wish to place @Name @Version

    @EndString
@ElseIf(@WinMajor = 3)
    @GetString @GroupName
        Please enter the name of the Program Manager
        Group you wish to place @Name @Version

    @EndString
@EndIf

Redo:

@FlushGroups()
@GetGroups
@DlgCtrlSize(0,6,6,9,42)
    // the following line, @CheckBox allows more than
    // one item to be selected from the same menu
    @Checkbox
    @Cls

    Please select what you want to install. Click on
    one or both items. Selections will be highlighted.

    @Set P = "OPUS PAYROLL with sample data"
    @Set O = "OPUS PAYROLL demonstration"


@EndGroups
@DlgCtrlSize(0,-1,-1,0,0)

@GetGroups
    You've selected to install the following:

    @If(@GroupIsSet(P))
         OPUS PAYROLL with Sample Data
    @ELSE

    @EndIf
    @If(@GroupIsSet(O))
         OPUS PAYROLL Demonstration
    @ELSE

    @EndIf
@DlgCtrlSize(0,11,20,15,30)

    Is this correct?

    @Set Y = "Yes"
    @Set N = "No"
@EndGroups

@If(@GroupIsSet(N))
    @FlushOptions()
    @FlushGroups()
    @Goto Redo
@EndIf

@If(((@GroupIsSet(O)) == 0) && ((@GroupIsSet(P)) == 0))
    @FlushOptions()
    @FlushGroups()
    @Goto Redo
@Else
      @If(@Exists("@OutDrive:\\@Subdir\\OPAYROLL.EXE"))
          @Display
                  @Cls

                                        ATTENTION!

                  @Name @Version is already installed on your computer.

                  If you continue you may overwrite work you have done.

                  You may press the ESC key at any time to quit the installation.

                  @Pause
          @EndDisplay
          @GetGroups
          @DlgCtrlSize(0,11,20,15,30)

              Are you sure that you want to continue?

              @Set Y = "Yes"
              @Set N = "No"
          @EndGroups
          @If(@GroupIsSet(N))
              @Exit
          @EndIf
          @DlgCtrlSize(0,-1,-1,0,0)
      @EndIf

    @SubDir = "@SubDir\\DEMO\\"
@EndIf

@DlgCtrlSize(0,-1,-1,0,0)

@DefineDisk
        @Label = "Disk #1"
        @BeginLib D.001
                @F AC_CTRL2.K01 @S 1024    @Group P
                @F AP_1099.K01 @S 1024     @Group P
                @F AP_1099.DAT @S 533      @Group P
                @F AP_ACCTS.DAT @S 192     @Group P
                @F AP_ACCTS.K01 @S 1024    @Group P
                @F AP_CKS.DAT @S 380       @Group P
                @F AP_CKS.K01 @S 1024      @Group P
                @F AP_TRAN.DAT @S 14404    @Group P
                @F AP_TRAN.K01 @S 4096     @Group P
                @F AP_TRAN.K02 @S 2560     @Group P
                @F AP_TRAN.K03 @S 3072     @Group P
                @F AP_TRAN.K04 @S 2560     @Group P
                @F AP_TRAN.K05 @S 5632     @Group P
                @F AP_TRAN.K06 @S 2048     @Group P
                @F AP_TR_DE.DAT @S 218     @Group P
                @F AP_TR_DE.K01 @S 1024    @Group P
                @F BENEFIT.DAT @S 332      @Group P
                @F BENEFIT.K01 @S 1024     @Group P
                @F BSCHED.DAT @S 1125      @Group P
                @F BSCHED.K01 @S 1024      @Group P
                @F CARD.DBF @S 28939       @Group P
                @F CARDS2.EXE @S 623010    @Group P
                @F CONFIG.DAT @S 876       @Group P
                @F CONREGIS.DAT @S 3403    @Group P
                @F CONTCON.DAT @S 509      @Group P
                @F CONTCON.K01 @S 1024     @Group P
                @F CONTPOST.DAT @S 191     @Group P
                @F CONTPOST.K01 @S 1024    @Group P
                @F DDREGIS.DAT @S 520      @Group P
                @F DEDCON.DAT @S 1567      @Group P
                @F DEDCON.K01 @S 1024      @Group P
                @F DEDPOST.DAT @S 191      @Group P
                @F DEDPOST.K01 @S 1024     @Group P
                @F DEDREGIS.DAT @S 5097    @Group P
                @F DEMO.EXE @S 858867      @Group O
                @F DEPTCON.DAT @S 799      @Group P
                @F DEPTCON.K01 @S 1024     @Group P
                @F DISK.ID @S 28           @Group P
                @F DR.001 @S 281           @Group P
                @F EICTABLE.DAT @S 1797    @Group P
                @F EICTABLE.K01 @S 1024    @Group P
                @F EVT.DBF @S 216483       @Group P
                @F GL_ACCTS.DAT @S 10991   @Group P
                @F GL_ACCTS.K01 @S 1024    @Group P
                @F GL_TRAN.DAT @S 44553    @Group P
                @F GL_TRAN.K01 @S 6144     @Group P
                @F JOBS.DAT @S 9128        @Group P
                @F JOBS.K01 @S 2048        @Group P
                @F MPROC1.TXT @S 126       @Group O
                @F PAYHIST.K01 @S 47616    @Group P
                @F PAYHIST.DAT @S 1917886  @Group P
                @F PAYTRANH.DAT @S 2945    @Group P
                @F PAYTRANH.K01 @S 1024    @Group P
                @F PAYTRANL.DAT @S 392     @Group P
                @F PAYTRANL.K01 @S 1024    @Group P
                @F PRCON.DAT @S 49214      @Group P
                @F PRCON.K01 @S 3584       @Group P
                @F PRDDA.DAT @S 356        @Group P
                @F PRDDA.K01 @S 1024       @Group P
                @F PRDED.DAT @S 10954      @Group P
                @F PRDED.K01 @S 5120       @Group P
                @F PRGLPOST.DAT @S 191     @Group P
                @F PRGLPOST.K01 @S 1024    @Group P
                @F PRMAS.DAT @S 166618     @Group P
                @F PRMAS.K01 @S 4096       @Group P
                @F PRMAS.K02 @S 11776      @Group P
                @F PRMAS.K03 @S 3072       @Group P
                @F PRMAS.K04 @S 1024       @Group P
                @F PRMAS.K05 @S 1024       @Group P
                @F PR_CTRL.DAT @S 1373     @Group P
                @F P_PLANS.DAT @S 1082     @Group P
                @F P_PLANS.K01 @S 1024     @Group P
                @F RE_TR_DE.DAT @S 187146  @Group P
                @F SETUP.EXE @S 700903     @Group P
                @F SHELCODE.DAT @S 2072    @Group P
                @F SHELCODE.K01 @S 1024    @Group P
                @F TAXTABLE.DAT @S 3863    @Group P
                @F TAXTABLE.K01 @S 1024    @Group P
                @F TEMP.DAT @S 330         @Group P
                @F TEMP.K01 @S 1024        @Group P
                @F TMPLOG.DAT @S 444       @Group P
                @F VEND.DAT @S 9415        @Group P
                @F VEND.K01 @S 2048        @Group P
                @F VEND.K02 @S 1024        @Group P
                @F W2BOX.DAT @S 3126       @Group P
                @F W2BOX.K01 @S 2560       @Group P
                @F W2FILE.DAT @S 79982     @Group P
                @F CLOSE.TXT @S 164        @Group O
                @F CPROC1.TXT @S 90        @Group O
                @F CPROC13.TXT @S 161      @Group O
                @F CPROC2.TXT @S 86        @Group O
                @F CPROC5.TXT @S 146       @Group O
                @F CPROC6.TXT @S 215       @Group O
                @F CPROC7.TXT @S 218       @Group O
                @F DATES.TXT @S 233        @Group O
                @F DATES1.TXT @S 245       @Group O
                @F DATES2.TXT @S 153       @Group O
                @F HISTORY.TXT @S 359      @Group O
                @F INTRO.TXT @S 1024       @Group O
                @F INTRO1.TXT @S 453       @Group O
                @F IPROC1.TXT @S 297       @Group O
                @F IS2.DAT @S 2926         @Group P
                @F MAIN.TXT @S 301         @Group O
                @F MAIN1.TXT @S 217        @Group O
                @F MSEL1.TXT @S 229        @Group O
                @F MSEL2.TXT @S 165        @Group O
                @F MSEL3.TXT @S 117        @Group O
                @F ORD_ALP.TXT @S 98       @Group O
                @F ORD_NUM.TXT @S 86       @Group O
                @F OVT_YNY.TXT @S 207      @Group O
                @F SYSENTER.TXT @S 314     @Group O
                @F AC_CTRL2.DAT @S 685     @Group P
                @F OPAYROLL.EXE @S 1420074 @Group P
                @F OPAYROLL.PIF @S 967     @Group P
                @F OREGISTR.PIF @S 967     @Group P
                @F OPAYROLL.HLP @S 169551  @Group P
                @F OREGISTR.EXE @S 460692  @Group P
        @EndLib
@EndDisk

@If(@GroupIsSet(P))
    @If(@Exists("@BootDrive:\\@TMPFILE.TMP"))
         @Delete("@BootDrive:\\@TMPFILE.TMP")
    @EndIf
    @If(@Exists("@BootDrive:\\CONFIG.SYS"))
       @Copy("@BootDrive:\\CONFIG.SYS","@BootDrive:\\@TMPFILE.TMP")
       @EOF = @ReadLine("@BootDrive:\\@TMPFILE.TMP",@LineRead)
    @EndIf
    @Write("@BootDrive:\\CONFIG.SYS","wt","DEVICE = @WinDrive:\\@WinDir\\HIMEM.SYS\n")
    @Write("@BootDrive:\\CONFIG.SYS","at","DEVICE = @WinDrive:\\@WinDir\\EMM386.EXE /NOEMS\n")
    @If(@WinMajor > 3)
       @Write("@BootDrive:\\CONFIG.SYS","at","FILESHIGH = 192\n")
    @Else
       @Write("@BootDrive:\\CONFIG.SYS","at","FILES = 192\n")
    @Endif
    @Write("@BootDrive:\\CONFIG.SYS","at","DOS=HIGH,UMB,AUTO\n")
@EndIf
Loop:
@If(@GroupIsSet(P))
    @If(@Exists("@BootDrive:\\@TMPFILE.TMP"))
        @If((@StrFind(@LineRead,"HIMEM") == (-1)) &&
        (@StrFind(@LineRead,"HIMEM") == (-1)) &&
        (@StrFind(@LineRead,"himem") == (-1)) &&
        (@StrFind(@LineRead,"EMM386") == (-1)) &&
        (@StrFind(@LineRead,"emm386") == (-1)) &&
        (@StrFind(@LineRead,"FILES") == (-1)) &&
        (@StrFind(@LineRead,"files") == (-1)) &&
        (@StrFind(@LineRead,"UMB") == (-1)) &&
        (@StrFind(@LineRead,"umb") == (-1)))
            @Write("@BootDrive:\\CONFIG.SYS","at","@LineRead\n")
            @If(@EOF == (-1))
                @Goto Continue
            @EndIf
            @EOF = @ReadLine(,@LineRead)
            @Goto Loop
        @Else
            @If(@EOF == (-1))
                @Goto Continue
            @EndIf
            @EOF = @ReadLine(,@LineRead)
            @Goto Loop
        @EndIf
    @EndIf
@EndIf
Continue:
@If(@GroupIsSet(P))
    @Delete("@BootDrive:\\@TMPFILE.TMP")
@EndIf

@If(@GroupIsSet(O))
    @FileAttr("@OutDrive:\\@SubDir\\*.txt", "h-")
    @FileAttr("@OutDrive:\\@SubDir\\*.txt", "r-")
@EndIf


@Finish
@If(@GroupIsSet(P))
        Changes were made to the CONFIG.SYS file, we
        must reboot this machine so that the changes to
        the CONFIG.SYS file will take effect.

        It is a good idea to read the "Read This First"
        file before running OPUS PAYROLL.
    @Pause
@EndIf
    @If(@ProgramManager("[CreateGroup(@GroupName)]"))@EndIf
    @If(@ProgramManager("[ShowGroup(@GroupName,3)]"))@EndIf
    @If(@ProgramManager("[AddItem(@OutDrive:\\@SubDir\\README.TXT,Opus Payroll Read This First)]"))@EndIf

@If(@GroupIsSet(P))
    @If(@ProgramManager("[AddItem(@OutDrive:\\@SubDir\\OPAYROLL.PIF,Opus Payroll Example)]"))@EndIf
    @If(@ProgramManager("[AddItem(@OutDrive:\\@SubDir\\OREGISTR.PIF,Opus Payroll 800-442-0361)]"))@EndIf
@EndIf
@If(@GroupIsSet(O))
    @If(@ProgramManager("[AddItem(@OutDrive:\\@SubDir\\DEMO.EXE,Opus Payroll Demo)]"))@EndIf
@EndIf
@FileAttr("@OutDrive:\\@SubDir\\*.txt", "r+")
@FileAttr("@OutDrive:\\@SubDir\\*.txt", "h+")
@If(@Exists("@OutDrive:\\@SubDir\\readme.txt"))
    @FileAttr("@OutDrive:\\@SubDir\\readme.txt", "r-")
    @Delete("@OutDrive:\\@SubDir\\readme.txt")
@EndIf
@Copy("@InDrive:readme.txt","@OutDrive:\\@SubDir\\*.*")
@FileAttr("@OutDrive:\\@SubDir\\readme.txt", "r+")
@Copy("@InDrive:totals.dat","@OutDrive:\\@SubDir\\*.*")
@If(@GroupIsSet(O))
    @COPY("@WinDrive:@WinDir\\Start Menu\\Programs\\@GroupName\\@Demo","@WinDrive:@WinDir\\Desktop\\@Demo")
@EndIf
@If(@GroupIsSet(P))
    @COPY("@WinDrive:\\@WinDir\\Start Menu\\Programs\\@GroupName\\@Reg","@WinDrive:\\@WinDir\\Desktop\\@Reg")
    @COPY("@WinDrive:\\@WinDir\\Start Menu\\Programs\\@GroupName\\@Exam","@WinDrive:\\@WinDir\\Desktop\\@Exam")
@EndIf
@WinExec("Notepad.exe @OutDrive:\\@SubDir\\readme.txt",3,-1)
@If(@GroupIsSet(P))
    @WinExit(4)
@EndIf
@EndFinish
