WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Installation Licensing Setup
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Sample Setup Script from User

Keywords:     setup script installer 

Comment:

I have been using Winbatch and Compiler and this BBS for a couple years now. Martin has been a big help to me many, many times, but so have the other users of this board. Perhaps this is my way to some what return the favor to you all. Attached you will find a sample installer WBT script I wrote and use to install most everything that I need to put on a clients PC. It includes a 3-D graph for the coping of your files, as well as the ability to adjust its size to fit different displays (640x480,800x600,1024x768). If it fits your needs then feel free to use it.

Good luck! Rob Carberry

Sample Script:

;**************************************************************************
;		 SETUP/INSTALL SAMPLE APP
;
; Usage: Run this file from WinBatch, as an installer for your program
;	 files.	 This is setup to run an install and copy 12 different
;	 files, more can be added.  You can also get creative and add
;	 shortcut creation and Registry entries.
;
;  Note:  These Boxes are designed to change their size to fit three
;	  different display sizes. (640x480, 800x600, or 1024x768)
;
; Author: Rob Carberry (Xerox Corp.)
; 
;  Date	   Major changes
; -------  ----------------------------------------------------------------
; 26Jan98  Created.
;   
;**************************************************************************

errormode(@off)
windir = dirwindows(0)
BLACK="0,0,0"
WHITE="255,255,255"
RED="255,0,0"
GREEN="0,255,0" 
DKGRAY="128,128,128"
GRAY="192,192,192"
DKRED="128,0,0"
DKGREEN="0,128,0"
BLUE="0,0,255"
PURPLE="255,0,255"
YELLOW="255,255,0"
CYAN="0,255,255"
DKBLUE="0,0,128"
DKPURPLE="128,0,128"
DKYELLOW="128,128,0"
DKCYAN="0,128,128"
clr = "%blue%"
dsplynum = WinMetrics(0)
bxu6 = ("250,300,600,575") ;640
bxu8 = ("300,300,600,525") ; 800
bxu10 = ("345,290,610,485");1024
bxu = "%bxu10%"
if dsplynum == 800
	bxu = "%bxu8%"
	drop(bxu10,bxu6)
else
	if dsplynum == 640
		bxu = "%bxu6%"
		drop(bxu8,bxu10)
	endif
endif
drop(dsplynum)
BoxesUp("0,0,1000,1000", @normal) 
BoxColor(1, "%white%", 4)
BoxDrawRect(1, "0,0,1000,1000", 1)
BoxTextColor(1, "%white%")
BoxTextFont(1, "", 70, 170, 0)
BoxDrawText(1, "50,50,1000,1000", "Setup Title goes here!", @FALSE, 0)
BoxTextColor(1, "%blue%")
BoxTextFont(1, "", 70, 170, 0)
BoxDrawText(1, "47,51,1000,1000", "Setup Title goes here!", @FALSE, 0)
BoxTextColor(1, "%gray%")
BoxTextFont(1, "", 12, 170, 0)
BoxDrawText(1, "945,985,1000,1000", "R.Carberry", @FALSE, 0) ;;My name
BoxCaption(1, "Setup Caption name goes here")
m1= '   This can be a box that displays License info or any other instructions you wish'
m2= '   to display before the end user starts the setup.'
m3= '   Antother line of text goes here'
m4= '   Antother line of text goes here'
m5= '   Antother line of text goes here'
m6= '   Antother line of text goes here'
m7= '   Antother line of text goes here'
m8= '   Antother line of text goes here'
m9= '   Antother line of text goes here'
m10= '   Antother line of text goes here'
m11= '   Antother line of text goes here'
m12= '   Antother line of text goes here'
m13= '   Antother line of text goes here'
m14= '   Antother line of text goes here'
m15= '   Antother line of text goes here'
m16= '   Antother line of text goes here'
m17= '   Antother line of text goes here'
m18= '   Antother line of text goes here'
m19= '   Antother line of text goes here'
mainline = "                  ---- It is important to read this before you continue !!! ----"
tlne1=strcat(@tab,mainline,@tab,@tab,@tab,m1,@tab,@tab,m2,@tab,@tab,m3,@tab,@tab,m4,@tab,@tab,m5,@tab,@tab,m6,@tab,@tab,m7,@tab,@tab,m8,@tab,@tab,m9,@tab,@tab,m10)
tlne2 = strcat(@tab,@tab,m11,@tab,@tab,m12,@tab,@tab,m13,@tab,@tab,m14,@tab,@tab,m15,@tab,@tab,m16,@tab,@tab,m17,@tab,@tab,m18,@tab,@tab,m19,@tab,@tab)
tlne = strcat(tlne1,tlne2)
mmainFormat=`WWWDLGED,5.0`
mmainCaption=`Caption Title goes here`
mmainX=96
mmainY=67
mmainWidth=256
mmainHeight=156
mmainNumControls=3
mmain01=`68,132,52,DEFAULT,PUSHBUTTON,DEFAULT,"&Next >>",1`
mmain02=`4,6,244,122,ITEMBOX,tlne,DEFAULT`
mmain03=`138,132,52,DEFAULT,PUSHBUTTON,DEFAULT,"&Exit",2`
ButtonPushed=Dialog("mmain")
if buttonpushed == 2 then exit
pause("Caption Text", "%@crlf%This box gives the user one last time to abort.%@crlf%before your install will start coping files.%@crlf%%@crlf%Press Ok to continue.%@crlf%")
;;;;;;;;;;;;;;;;;
Boxnew(2,"%bxu%", @normal) 
BoxColor(2,"192,192,192",0)
BoxDrawRect(2, "0,0,1000,1000", 2)
BoxTextColor(2,"0,0,0")
BoxTextFont(2, "", 100, 0, 32)
BoxCaption(2, "Caption Text")
BoxDrawText(2, "130,275,880,350", "Please Wait!...%@crlf%Add some text here", @FALSE, 1)

delay(5) ;  add code to this area that will take place while the above box is displayed 

boxdestroy(2)
;;;;;;;;;;;;;;;;;;Here is where the file copy status starts
Boxnew(2, "%bxu%", @normal) 
BoxColor(2, "%gray%", 0)
BoxDrawRect(2, "0,0,1000,1000", 2)
BoxCaption(2, "Installing files")
boxpen(2,"%white%",8)
BoxDrawLine(2, "80,760,920,760");759
BoxDrawLine(2, "922,577,922,759")
boxpen(2,"%dkgray%",14)
BoxDrawLine(2, "85,574,917,574")
BoxDrawLine(2, "76,582,76,751")
BoxTextColor(2, "%black%")
BoxTextFont(2, "",95,0,32)
BoxDrawText(2, "90,130,250,250", "Coping files...", @FALSE, 0)
xx = 80
BoxColor(2, "%clr%", 0)
BoxDrawRect(2, "79,589,%xx%,750", 2);920 is the end
BoxDrawText(2, "90,330,550,250", "Files...  Name of file 1", @FALSE, 0)
delay(0.2)
xx = xx + 45
BoxColor(2, "%gray%", 0)
BoxDrawRect(2, "200,270,600,450", 2);920 is the end
filecopy("file.xx1", "%windir%", @false)
BoxColor(2, "%clr%", 0)
BoxDrawRect(2, "79,589,%xx%,750", 2);920 is the end
BoxDrawText(2, "90,330,550,250", "Files...  Name of file 2", @FALSE, 0)
delay(0.2)
xx = xx + 45
BoxColor(2, "%gray%", 0)
BoxDrawRect(2, "200,270,600,450", 2);920 is the end
filecopy("file.xx2", "%windir%", @false)
BoxColor(2, "%clr%", 0)
BoxDrawRect(2, "79,589,%xx%,750", 2);920 is the end
BoxDrawText(2, "90,330,550,250", "Files...  Name of file 3", @FALSE, 0)
delay(0.2)
xx = xx + 45
BoxColor(2, "%gray%", 0)
BoxDrawRect(2, "200,270,600,450", 2);920 is the end
filecopy("file.xx3", "%windir%", @false)
BoxColor(2, "%clr%", 0)
BoxDrawRect(2, "79,589,%xx%,750", 2);920 is the end
BoxDrawText(2, "90,330,550,250", "Files...  Name of file 4", @FALSE, 0)
delay(0.2)
xx = xx + 45
BoxColor(2, "%gray%", 0)
BoxDrawRect(2, "200,270,600,450", 2);920 is the end
filecopy("file.xx4", "%windir%", @false)
BoxColor(2, "%clr%", 0)
BoxDrawRect(2, "79,589,%xx%,750", 2);920 is the end
BoxDrawText(2, "90,330,550,250", "Files...  Name of file 5", @FALSE, 0)
delay(0.2)
xx = xx + 45
BoxColor(2, "%gray%", 0)
BoxDrawRect(2, "200,270,600,450", 2);920 is the end
filecopy("file.xx5", "%windir%", @false)
BoxColor(2, "%clr%", 0)
BoxDrawRect(2, "79,589,%xx%,750", 2);920 is the end
BoxDrawText(2, "90,330,550,250", "Files...  Name of file 6", @FALSE, 0)
delay(0.2)
xx = xx + 45
BoxColor(2, "%gray%", 0)
BoxDrawRect(2, "200,270,600,450", 2);920 is the end
filecopy("file.xx6", "%windir%", @false)
BoxColor(2, "%clr%", 0)
BoxDrawRect(2, "79,589,%xx%,750", 2);920 is the end
BoxDrawText(2, "90,330,550,250", "Files...  Name of file 7", @FALSE, 0)
delay(0.2)
xx = xx + 45
BoxColor(2, "%gray%", 0)
BoxDrawRect(2, "200,270,600,450", 2);920 is the end
filecopy("file.xx7", "%windir%", @false)
BoxColor(2, "%clr%", 0)
BoxDrawRect(2, "79,589,%xx%,750", 2);920 is the end
BoxDrawText(2, "90,330,550,250", "Files...  Name of file 8", @FALSE, 0)
delay(0.2)
xx = xx + 45
BoxColor(2, "%gray%", 0)
BoxDrawRect(2, "200,270,600,450", 2);920 is the end
filecopy("file.xx8", "%windir%", @false)
BoxColor(2, "%clr%", 0)
BoxDrawRect(2, "79,589,%xx%,750", 2);920 is the end
BoxDrawText(2, "90,330,550,250", "Files...  Name of file 9", @FALSE, 0)
delay(0.2)
xx = xx + 45
BoxColor(2, "%gray%", 0)
BoxDrawRect(2, "200,270,600,450", 2);920 is the end
filecopy("file.xx9", "%windir%", @false)
BoxColor(2, "%clr%", 0)
BoxDrawRect(2, "79,589,%xx%,750", 2);920 is the end
BoxDrawText(2, "90,330,550,250", "Files...  Name of file 10", @FALSE, 0)
delay(0.2)
xx = xx + 45
BoxColor(2, "%gray%", 0)
BoxDrawRect(2, "200,270,600,450", 2);920 is the end
filecopy("file.x10", "%windir%", @false)
BoxColor(2, "%clr%", 0)
BoxDrawRect(2, "79,589,%xx%,750", 2);920 is the end
BoxDrawText(2, "90,330,550,250", "Files...  Name of file 11", @FALSE, 0)
delay(0.2)

xx = 920    ;;;;;;;;;;;;;;;;;;;;;;this makes sure that the last file copied takes the bar to the end
BoxColor(2, "%gray%", 0)
BoxDrawRect(2, "200,270,600,450", 2);920 is the end
filecopy("file.x11", "%windir%", @false)
BoxColor(2, "%clr%", 0)
BoxDrawRect(2, "79,589,%xx%,750", 2);920 is the end
BoxDrawText(2, "90,330,550,250", "Files...  Name of file 12", @FALSE, 0)
filecopy("file.x12", "%windir%", @false)  ;;;;;;;;;;;;;;;;;;;;;;;;;;this is the last file to copy


delay(2)
boxdestroy(2)
Boxnew(2,"%bxu%", @normal) 
BoxColor(2, "%gray%", 0)
BoxDrawRect(2, "0,0,1000,1000", 2)
BoxCaption(2, "Completing the Setup") ;;this can be a finish up box caption
BoxTextColor(2, "%black%")
BoxTextFont(2, "",95,0,32)
BoxDrawText(2, "250,420,250,250", "This is a finish up box...", @FALSE, 0);; this can be a finish up box text

delay(5)
boxdestroy(2)
msg = '%@crlf%%@tab%The install has finished!%@crlf%%@crlf%%@tab%This is the install is completed box.%@tab%%@crlf%%@tab%You can give them some instructions here.%@tab%%@tab%%@crlf%'
message('Install Complete', '%msg%');;the last box displayed
boxshut();;this closes down all open boxes
exit




Article ID:   W13406
Filename:   Sample Setup Script from User.txt
File Created: 1999:04:15:16:53:48
Last Updated: 1999:04:15:16:53:48