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.000/32|Copyright ⌐ 1993 - 1996 GPP Software|",-1,20,0,0,0,1114112,"Times New Roman",17,3,16777215,0)
EndObject()
CreateCueCard("WELCOMECARD",20,50,310,200,2)
CreateControl("Text","%Application%",-1,20,20,150,45,0,"Times New Roman",50,0,10485760,0)
AddDeInstall("$STARTUP$","MessageBox(^034The %Application% software is about to be removed from your machine.^^013^^013All files, directories and the appropriate Program Manager Group will be deleted.^^013^^013Are you sure you wish to continue ?^034, ^034%Caption%^034, MB_YESNO, MB_ICONQUESTION)")
IF %Option1%==TRUE SET %Required%=%Required% + 2764800
IF %Option2%==TRUE SET %Required%=%Required% + 12288
IF %Option3%==TRUE SET %Required%=%Required% + 45056
IF %Space% >= %Required% GOTO :GOTSPACE
MessageBox("The %Application% software requires %Required% bytes of disk space and there is only %Space% bytes free on your %InstallDrive% drive.||Do you wish to continue to install the software ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
IF %ERROR% == IDNO GOTO :EXIT
:GOTSPACE
// Do the file copying
SET %TotalBlocks%=0
IF %Option% AND 1 != 0 SET %TotalBlocks% = %TotalBlocks% + 23
IF %Option% AND 2 != 0 SET %TotalBlocks% = %TotalBlocks% + 10
IF %Option% AND 4 != 0 SET %TotalBlocks% = %TotalBlocks% + 9
CopyFile(%TotalBlocks%)
Release()
IF %Option% AND 1==0 GOTO :OVER1
CheckExists("%CurrentDrive%DISK01", "Please insert the diskette labelled 'DISK01'")
IF "#INSTVER#" == "INST16" WriteProfileString("License", "Registration", "%LStr%", "%IniFile%")
IF "#INSTVER#" == "INST32" RegWriteSetting(2, "SOFTWARE\%Company%\%Application%\License", "Registration", "%LStr%")
:NOBUILDER
IF "#INSTVER#" == "INST16" GetProfileString("License", "Registration", "", "%IniFile%", %LStr%)
IF "#INSTVER#" == "INST32" RegGetSetting(2, "SOFTWARE\%Company%\%Application%\License", "Registration", "", %LStr%)
IF "%LStr%" != "" GOTO :GOTIT
GetLicense(%License%)
IF "#INSTVER#" == "INST16" WriteProfileString("License", "Registration", "%License%", "%IniFile%")
IF "#INSTVER#" == "INST32" RegWriteSetting(2, "SOFTWARE\%Company%\%Application%\License", "Registration", "%License%")
:GOTIT
// Tell Setup Builder where to find some files for creating install disks
IF "#INSTVER#" == "INST16" WriteProfileString("Executables", "Setup", "%InstallPath%setup.exe", "%IniFile%")
IF "#INSTVER#" == "INST16" WriteProfileString("Executables", "DeInstall", "%InstallPath%deinst.exe", "%IniFile%")
IF "#INSTVER#" == "INST16" WriteProfileString("Executables", "Inst16", "%InstallPath%inst16.exe", "%IniFile%")
IF "#INSTVER#" == "INST16" WriteProfileString("Executables", "Inst32", "%InstallPath%inst32.exe", "%IniFile%")
IF "#INSTVER#" == "INST16" WriteProfileString("Executables", "Cleanup", "%InstallPath%cleanup.exe", "%IniFile%")
IF "#INSTVER#" == "INST16" WriteProfileString("Install", "ImportList", "%InstallPath%IMPORT.INI", "%IniFile%")
IF "#INSTVER#" == "INST32" RegWriteSetting(2, "SOFTWARE\%Company%\%Application%\Executables", "Setup", "%InstallPath%setup.exe")
IF "#INSTVER#" == "INST32" RegWriteSetting(2, "SOFTWARE\%Company%\%Application%\Executables", "DeInstall", "%InstallPath%deinst.exe")
IF "#INSTVER#" == "INST32" RegWriteSetting(2, "SOFTWARE\%Company%\%Application%\Executables", "Inst16", "%InstallPath%inst16.exe")
IF "#INSTVER#" == "INST32" RegWriteSetting(2, "SOFTWARE\%Company%\%Application%\Executables", "Inst32", "%InstallPath%inst32.exe")
IF "#INSTVER#" == "INST32" RegWriteSetting(2, "SOFTWARE\%Company%\%Application%\Executables", "Cleanup", "%InstallPath%cleanup.exe")
IF "#INSTVER#" == "INST32" RegWriteSetting(2, "SOFTWARE\%Company%\%Application%\Install", "ImportList", "%InstallPath%IMPORT.INI")
// Delete the old DOSEXEC.PIF to fix compression errors
Delete("%WindowsDirectory%DOSEXEC.PIF")
// Delete old import file
Delete("%WindowsDirectory%IMPORT.INI")
// Now setup a new program manager group and its icons
MessageBox("Setup can create a Program Manager group|for the %Application% application.||Do you wish to create a Program|Manager group and icons ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
Set %PmGrp% = %Error%
IF %ERROR% == IDNO GOTO :NOPMGROUP
MakeGroup("%Application%", "")
IF %Option% AND 1 != 0 MakeIcon("Setup Builder (16-bit)", "%InstallPath%BLDR16.EXE ")
IF %Option% AND 1 != 0 MakeIcon("Setup Builder (32-bit)", "%InstallPath%Bldr32.exe ")
IF %Option% AND 1 != 0 MakeIcon("Setup Builder Help", "%InstallPath%BUILDER.HLP ")
IF %Option% AND 1 != 0 MakeIcon("Setup Script Help", "%InstallPath%SETUP.HLP ")
IF %Option% AND 1 != 0 MakeIcon("Install Notes", "%InstallPath%INSTALL.TXT ")
IF %Option% AND 1 != 0 MakeIcon("ReadMe", "%InstallPath%README.TXT ")
IF "#INSTVER#" == "INST16" DeleteIcon("Setup Builder (32-bit)")
IF "#INSTVER#" == "INST32" DeleteIcon("Setup Builder (16-bit)")
:NOICONS
// File association - Windows 3.x only
IF "#INSTVER#" == "INST32" GOTO :NOASSOC
MessageBox("Setup can install a file association|for File Manager with .SCR and .INF files.||Do you wish to install this association ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
IF %ERROR% == IDNO GOTO :NOASSOC
IF "#INSTVER#" == "INST16" WriteProfileString("Extensions", "inf", "%InstallPath%inst16.exe ^.inf", "WIN.INI")
IF "#INSTVER#" == "INST16" WriteProfileString("Extensions", "scr", "%InstallPath%inst16.exe ^.scr", "WIN.INI")
:NOASSOC
// Create the de-install icon
IF %PmGrp% == IDYES MakeIcon("Un-Install %Application%", "%WindowsDirectory%GPPSOFT\DEINST.EXE %Application%")
// Done
:SUCCESS
SET %Message1%="|%Application% installation has been successfully completed."
SET %Message2%=""
DialogBox("OkBox")
// User defined code - installation completion
MessageBox("Do you wish to view the|extra installation notes ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
IF %ERROR% == IDNO GOTO :NONOTES
WinExec("notepad.exe %InstallPath%README.TXT")
:NONOTES
GOTO :END
// User decided to quit
:EXIT
EndCopyFile()
SET %Message1%="Installation has been terminated. You should re-run this installation program at a later time to install %Application%."
SET %Message2%="|The %Application% software has not been installed."
DialogBox("OkBox")
GOTO :END
// Error
:ERROR
EndCopyFile()
SET %Message1%="An error occured during installation of the %Application% software."
SET %Message2%="|The %Application% software has not been fully installed."
DialogBox("OkBox")
GOTO :END
// Failed to create install directory
:DIRERROR
SET %Message1%="|Failed to create the installation directory '%MakeDir%'."
SET %Message2%="|Unable to install the %Application% software in the specified directory."
DialogBox("OkBox")
GOTO :RETRY
:END
// Delete all the bitmaps
Delete("%WindowsDirectory%TEMP\GPSOFT3.BMP")
Delete("%WindowsDirectory%TEMP\DIAMOND.BMP")
// Final tidy up - close files and remove components from H/D
CloseDeInstall()
Close()
CheckExists("%CurrentDirectory%CLEANUP.EXE", "Please insert the diskette labelled 'DISK01'")
IF %ERROR% == IDOK WinExec("%CurrentDirectory%CLEANUP.EXE")