
// SAMPLE4.INF

// Setup Builder sample support file

// Copyright 1993 - 1997 GPP Software


// This sample demonstrates how the script language
// can be used to create a dialog and display a file
// within a list box.

// Typically, this is done during an installation
// to display licensing and/or copyright information
// to the user.


Set %Caption% = "Setup"
Set %Application% = "Demo"

// This demo shows the autoexec in a listbox dialog object,
// Firstly, create a backdrop object
CreateBackdrop("DEFAULTBACKDROP")
CreateControl("Text","%Application% Setup",-1,20,10,0,0,1048576,"Times New Roman",50,3,16777215,0)
CreateControl("Text","Install/De-Install created using Setup Builder Version 5.01.003/16|Copyright © 1993 - 1997 GPP Software|",-1,20,0,0,0,1114112,"Times New Roman",17,3,16777215,0)
EndObject()

// Now create the dialog object
CreateDialog("COPYRIGHT","%Caption%",0,0,260,165)
CreateControl("ListBox","",20,10,10,240,130,0,)
CreateControl("Button","#OK#",IDOK,70,150,54,14,0)
CreateControl("Button","#CANCEL#",IDCANCEL,130,150,54,14,0)
CentreDialog(3,3)
EndObject()

// Now display the backdrop
ShowBackdrop("DEFAULTBACKDROP")

// Ask the user if they want to view the file
MessageBox("Do you want to view your AUTOEXEC.BAT ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
IF %ERROR% == IDNO GOTO :NOAUTOEXEC

// Now put the AUTOEXEC.BAT into the dialog
Open("C:\AUTOEXEC.BAT", 1, READ)
IF %ERROR% == TRUE GOTO :CANTFIND

:NEXTLINE
ReadLine(1, %Buffer%)

IF %ERROR% == EOF GOTO :EOF
AddListItem("COPYRIGHT", 20, %Buffer%)
GOTO :NEXTLINE


:EOF
Close(1)

DialogBox("COPYRIGHT")
GOTO :NOAUTOEXEC


:CANTFIND
MessageBox("Error: Unable to find C:\AUTOEXEC.BAT", "%Caption%", MB_OK, MB_ICONEXCLAMATION)


:NOAUTOEXEC

