@DefineProject
    @Name           = "Tally eis 5.0"
    @Version        = "Release 2 (h)"
    @OutDrive       = C
    @SubDir         = "\\TALLY"
    @Immediate      = @True
	@Requires 	    3000000
	@Requires	    @HardDisk
@EndProject

@NumberOfDisks = 1

@DefineVars
    @Dir     @DataDir       = "\\TALLY\\DATA"
    @Drive   @DataDrive     = C
    @QString @TallyGroup    = "Tally for Win95"
    @QString @TallyPrgName  = "Tally for Win95"
    @QString @TallyININame  = "TALLY.INI"
    @QString @TallyPrgPath  = ""
    @QString @TallyINIPath  = ""
    @QString @LineRead      = ""
    @QString @HeadOfStr     = ""
    @Integer @EOF           = 0
    @Integer @DatFound      = 0
    @Integer @CfgFound      = 0
    @QString @DataPath      = ""
    @QString @CfgPath       = ""
@EndVars

@DefineProto
    @Void @WindUp (@Void)
    @Void @StartUp (@Void)
    @Void @SetTallyINI (@Void)
@EndProto

/******************** Get the Destination ********************/

@GetOutDrive
    Please select the Drive where you
    wish to install TALLY eis 5.0:

    @Suppress(0,1)
    @Suppress(0,16)
@EndOutDrive

@GetSubDir
    Please enter the directory where you
    wish to install TALLY eis 5.0:

    (Do not specify the Drive again)

@EndSubDir

@GetOutDrive @DataDrive
    Please select the Drive where you
    wish to access the DATA Files:

    @Suppress(0,1)
    @Suppress(0,16)
@EndOutDrive

@GetSubDir @DataDir
    Please enter the directory where you
    wish to access the DATA Files:

    (Do not specify the Drive again)

@EndSubDir

/******************** Begin Activities ********************/

/******************** Startup Function ********************/

@DefineFunc @Void @StartUp (@Void)
    @TallyPrgPath = "@OutDrive:\\@SubDir\\W95TALLY.EXE"
    @TallyINIPath = "@OutDrive:\\@SubDir\\TALLY.INI"
    @DataPath     = "@DataDrive:\\@DataDir"
    @CfgPath      = "@OutDrive:\\@SubDir"
    @FileAttr("@OutDrive:\\@SubDir\\*.*", "r-")
    @MkDir("@DataDrive:\\@DataDir")
    @Return()
@EndFunc

@StartUp()

@DefineDisk
    @Label = "TALLY"
    @BeginLib TALLYW95.RED
        @File W95TALLY.EXE
        @File TALLYWIN.DAT
        @File NWIPXSPX.DLL
        @File NSLMS32.DLL
        @if (@Exists("@TallyINIPath") == @False) 
            @File TALLY.INI
        @endif
    @EndLib
@EndDisk

/******************** Set TallyINI ********************/

@DefineFunc @Void @SetTallyINI (@Void)

    @EOF = @ReadLine("@TallyINIPath", @LineRead)
    @Write("@OutDrive:\\@SubDir\\TALLY.IN2","wt","@LineRead\n")

Loop:

        @EOF = @ReadLine(, @LineRead)

        @if (@EOF != -1) 

            @HeadOfStr = @StrToken (@LineRead, 0, " ")

            @if (@StrCmpNos (@HeadOfStr, "Data") == 0)
                @Write(,,"Data = @DataPath\n")
                @DatFound = 1
            @elseif (@StrCmpNos (@HeadOfStr, "Config") == 0)
                @Write(,,"Config = @CfgPath\n")
                @CfgFound = 1
            @else
                @Write(,,"@LineRead\n")
            @endif

            @Goto Loop

        @EndIf

    @if (@DatFound == 0) 
        @Write(,,"Data = @DataPath\n")
    @Endif

    @if (@CfgFound == 0) 
        @Write(,,"Config = @CfgPath\n")
    @Endif

    @Delete ("@TallyINIPath")
    @Rename ("@OutDrive:\\@SubDir\\TALLY.IN2", "TALLY.INI")

    @Return ()

@EndFunc

/******************** WindUp ********************/

@DefineFunc @Void @WindUp (@Void)
    @FileAttr("@TallyPrgPath", "r+")
    @FileAttr("@OutDrive:\\@SubDir\\TALLYWIN.DAT", "r+")
    @FileAttr("@OutDrive:\\@SubDir\\NWIPXSPX.DLL", "r+")
    @FileAttr("@OutDrive:\\@SubDir\\NSLMS32.DLL", "r+")
    @ProgramManager("[CreateGroup(@TallyGroup)]")
    @ProgramManager("[AddItem(@TallyPrgPath,@TallyPrgName)]")
    @ProgramManager("[AddItem(@TallyINIPath,@TallyININame)]")
    @SetTallyINI()
    @Return()
@EndFunc

/******************** Finish ********************/

@Finish
    @WindUp()
    TALLY eis 5.0 
    successfully installed!
    @Pause
    @Exit
@EndFinish

