; pcANYWHERE install script

[InstallVersion]
3.3

[WindowsVersion]
3.10
"pcANYWHERE for Windows requires"
"Windows version 3.1 or greater."

[process]
switch95 = IsWinVerGTE(0320)           ;switch95=TRUE if Win 4.0

switch94=Exists(Files10)               ;switch94=TRUE if version 1.0 host files exist
switch93=Exists(Files45)               ;switch93=TRUE if version 4.5 host files exist
switch92=Exists(Files50)               ;switch92=TRUE if version 5.0 host files exist
switch89=Exists(PcawIni)               ;switch89=TRUE if pcaw.ini exists
switch87=Exists(Files20)               ;switch87=TRUE if version 2.0 host files exist
#ifnot(switch87)                                                                ;or if NoReg file exists
	switch87=Exists(NoReg)
#endif
switch88=FALSE                         ;switch88=TRUE if any pcAW VCD files exist
switch88=VerifyIni(awvcd)
#ifnot(switch88)
	switch88=VerifyIni(aw_vcd)
#endif
#ifnot(switch88)
	switch88=VerifyIni(aw5vcd)
#endif

Bitmaps(pix)                           ;display background bitmap
AllowIntlChars()                       ;allow international characters
backup(pcawinst)                       ;copy install dll to Windows directory
				       ;setup the file information for copying
SetActiveCopy(PCACopy, install.inf)

switch01 = IsRegistered()              ;if not already registered, ask for registration
#ifnot(switch01)
     Registration()
     VersionSearch()                   ;search for existing version
#endif
GetPrevVerSize()                       ;for calculating space required
TargetDrive()                          ;get target drive/path

switch91=Exists(Admin10)               ;switch91=TRUE if old @@@ files exist
#ifnot(switch91)                       ;check for 1.0, 5.0, and 4.5 versions
   switch91=Exists(Admin50)            ;we won't copy new ones if they exist
   #ifnot(switch91)
      switch91=Exists(Admin45)
   #endif
#endif
switch90=Exists(BinFile)               ;switch90=TRUE if ANYWHERE.BIN file exists
switch86=Exists(Winaw)                 ;switch86=TRUE if WINAW.EXE in target already

Backup(SaveEm)                         ;backup system start-up files
messagebox(InformAboutBackup)

DisableUtils()
copy()                                  ;copy files
groups()                                ;setup groups
EnableUtils()

RemoveFromLoad(RemHost)                ;remove load=winhost from win.ini in case it is old

DelFromIni(OldVxDs)                    ;delete old pcAW VxD files in system.ini
AddToIni(AWVXDS)                       ;add new VxDs to system.ini

DelFromIni(DelOldSymevent)
AddToIni(SYMEVENT)                                                      ;add device=symevnt.386 to system.ini

switch01 = VerifyIni(CheckNetHeapSize) ;if no NetHeapSize, set it to 24
#ifnot(switch01)
    AddToIni(SetNetHeapSize)
#endif

switch01 = VerifyIni(TimeCriticalPresent) ;add TimerCriticalSection=10000 if not set in system.ini
#ifnot(switch01)
    AddToIni(TimeCriticalSection)
#endif

switch01 = VerifyIni(FindFontSection)    ;add font section to pcaw.ini if not already there
#ifnot(switch01)
    AddToIni(AddFontSection)
#endif

#if(switch88)                                                                           ;if we removed an old pcAW VCD
	switch01 = VerifyIni(VCDExists)                 ;restore original one if no other exists
	#ifnot(switch01)                                                                ;if not,
		switch02 = Exists(VCD386Exists)         ;check if vcd.386 exists
		#if(switch02)
			AddToIni(AddVCD386)              ;yes - use it
		#else
			AddToIni(AddVCD)                                                ;no - use *vcd
		#endif
	#endif
#endif
;------------------------------------------------------------------------------------
;Restore the original video, keyboard, mouse, and sound drivers if upgrading
;from a previous version of pcAW
;------------------------------------------------------------------------------------
switch01 = Exists(PcawIni)             ;check if pcaw.ini exists (it should - we created one)
#if(switch01)
   switch02 = VerifyIni(MouseDriverSaved) ;check if a mouse driver was saved in pcaw.ini
   #if(switch02)
      switch03 = VerifyIni(MouseCheckOld) ;check if a pcAW mouse driver is in system.ini
      #if(switch03)
	 CopyIni(MouseRestore)            ;restore original mouse driver
      #endif
   #else                                                                                        ;no driver saved but may be a 4.5 install
      switch03 = VerifyIni(MouseCheckOld) ;check if a pcAW mouse driver is in system.ini
      #if(switch03)
	 UpdateIni(MouseRestore1)            ;restore to mouse.drv and hope it's correct
      #endif
   #endif
   switch02 = VerifyIni(KbdDriverSaved)   ;check if a kbd driver was saved in pcaw.ini
   #if(switch02)
      switch03 = VerifyIni(KbdCheckOld)   ;check if a pcAW kbd driver is in system.ini
      #if(switch03)
	 CopyIni(KbdRestore)              ;restore original keyboard driver
      #endif
   #endif
   switch02 = VerifyIni(DisplayDriverSaved) ;check if a display driver was saved in pcaw.ini
   #if(switch02)
      switch03 = VerifyIni(DisplayCheckOld) ;check if a pcAW display driver is in system.ini
      #if(switch03)
	 CopyIni(DisplayRestore)            ;restore original display driver
      #endif
   #endif
   switch02 = VerifyIni(SoundDriverSaved) ;check if a sound driver was saved in pcaw.ini
   #if(switch02)
      switch03 = VerifyIni(SoundCheckOld) ;check if a pcAW sound driver is in system.ini
      #if(switch03)
	 CopyIni(SoundRestore)            ;restore original sound driver
      #endif
   #endif
#endif

;Create [oldfiles] section in pcaw.ini and list files that the main program should
;delete the first time it is run.
AddToIni(Oldfiles)
#if(switch94)
    AddToIni(DelOld10)
#endif
#if(switch93)
    AddToIni(DelOld45)
#endif
#if(switch92)
    AddToIni(DelOld50)
#endif
DelFromIni(Oldfiles)

switch85=Exists(CheckAuto)                        ;check if autoexec.bat exists
#if(switch85)                                                     ;if so,
	ModifyTextFile(autoexec)        ;remove old DOS TSR it.
#endif

CallProc(NetworkCustomize)         ;Update anywhere.bin and get admin options
Delete(OldBaseFiles)               ;remove old pcAW/Win files no longer used
Delete(InstallDLLs)                ;remove install files
MergeRegFile(Reg)                                                 ;merge reg file
#if(switch95)
	EndRebootOnly(ByeRestart)
#else
	End(ByeNoReboot)
#endif
End()

;-----------------------------------------------------------------------
; Copy.
;-----------------------------------------------------------------------
[PCACopy]
CopyMain.BaseFiles, "pcANYWHERE",    0, Y, N, Y

[PCACopy:CopyDialog]
caption = "Copying pcANYWHERE Files..."
posx = -50
posy = -50

;-----------------------------------------------------------------------
; Copy file information for remote-only version
;-----------------------------------------------------------------------

[PCARemoteCopy]
CopyMain.BaseFiles, "pcANYWHERE - %ldK ",    2000, Y, N, Y

[PCARemoteCopy:CopyDialog]
caption = "Copying pcANYWHERE Files..."
posx = -50
posy = -50

;-----------------------------------------------------------------------
; Copy file information for host-only version
;-----------------------------------------------------------------------

[PCAHostCopy]
CopyMain.BaseFiles, "pcANYWHERE - %ldK ",    2000, Y, N, Y

[PCAHostCopy:CopyDialog]
caption = "Copying pcANYWHERE Files..."
posx = -50
posy = -50

;----------------------------------------------------------------------------------
;[AdvoDefault]
;posx = 20
;posy = 20
;text = AdvoText

;[AdvoText]
;"Please fill out your registration"
;"form to be sure to get information"
;"about product updates."
;""

;-----------------------------------------------------------------------
; Groups.
;-----------------------------------------------------------------------
[groups]
"pcAnywhere",       winaw.grp, DELETE

[pcAnywhere]
"pcAnywhere for Windows",  winaw.exe,        BaseFiles
"Remove pcAnywhere",       "install.exe /u", BaseFiles
"Release Notes",        readme.txt, BaseFiles

[ByeNoReboot]
caption = "pcANYWHERE -- Install Complete"
"This concludes the installation of pcANYWHERE for Windows."
" "
"Please review the README.TXT file for last minute changes and corrections to the documentation."
" "
"Select one of the exit options."

[ByeRestart]
caption = "pcANYWHERE -- Install Complete"
"This concludes the installation of pcANYWHERE for Windows."
" "
"Please review the README.TXT file for last minute changes and corrections to the documentation."
" "

[InformAboutBackup]
caption = "Startup Files"
"The following startup files (if they exist) have been backed up to the directory that you have selected for the pcANYWHERE Installation:"
" "
"AUTOEXEC.BAT, WIN.INI, SYSTEM.INI"

[Registration]
caption =  "pcANYWHERE Installation"
text1   =  RegistText
text2   =  "&Name:"
text3   =  "&Company:"
Cancel  =  "Cancel"
Help     =  "&Help"
appname =  winaw.exe
string  =  "Symantec Install for Windows"
active  =  no

[RegistText]
"Welcome to pcANYWHERE for Windows!"
""
"pcANYWHERE will be installed to your hard drive."
""
""
"Please register your name"
"and company below."

[VersionSearch]
caption =  "Searching for Previous Version"
text1   =  "Searching for a previously installed"
text2   =  "version of pcANYWHERE for Windows."
appname =  "winaw.exe"
apppath =  c:\winaw

[TargetDrive]
caption =  "Install pcANYWHERE Program Files To"
defpath =  C:\WINAW
text   =  "Select the drive/directory where you would like the Program files to be installed."
reqspace= "Approximate disk space required for installation"

[errors]
noprev  =  "Symantec Install for Windows is already running!"

[FileCopy]
errorcaption  =  "Error Copying Files"
insertcaption =  "Insert Diskette"

[cancel]
caption = "pcANYWHERE"
text     = "Are you sure you want to exit?"

[cancelshell]
caption = "pcANYWHERE"
text     = "Are you sure you want to exit?"

;-----------------------------------------------------------------------

[SaveEm]
system.ini, system.ini, WINDOWS, target
win.ini, win.ini, WINDOWS, target
c:\autoexec.bat, autoexec.bat, dummy, target

[pcawinst]
awinst.dll, awinst.dll, SOURCE, WINDOWS
symkrnl5.dll, symkrnl5.dll, SOURCE, WINDOWS

[InstallDLLs]
AWINST.DLL, WINDOWS
SIWDLL.DLL, WINDOWS
AWLPFUNC.DLL, WINDOWS
SIW3ZIP.DLL, WINDOWS
SIWZIP.DLL, WINDOWS

[RemHost]
winhost.exe

[OldVxDs]
IniName = system.ini
SectionName = 386Enh
device=*vpcaw5.386*
device=*awvcd.386*
device=*aw_vcd.386*
device=*aw5vcd.386*
device=*vpcaw.386*
device=*awdos.386*

[AWVXDS]
IniName = system.ini
SectionName = 386Enh
device = "awdos.386          ; Added by pcANYWHERE"
device = "vpcaw.386          ; Added by pcANYWHERE"

[DelOldSymevent]
IniName = system.ini
SectionName = 386Enh
device = *symevnt.386*

[SYMEVENT]
IniName = system.ini
SectionName = 386Enh
device = "symevnt.386        ; Added by pcANYWHERE (may be used by other programs)"

[TimeCriticalSection]
IniName = system.ini
SectionName = 386Enh
TimerCriticalSection = "10000  ; Added by pcANYWHERE (may be used by other programs)"

[TimeCriticalPresent]
IniName = system.ini
SectionName = 386Enh
timercriticalsection=*

[CheckNetHeapSize]
IniName = system.ini
SectionName = 386Enh
NetHeapSize=*

[SetNetHeapSize]
IniName = system.ini
SectionName = 386Enh
NetHeapSize = "24            ; Added by pcANYWHERE (may be used by other programs)"

[MouseDriverSaved]
IniName = pcaw.ini
SectionName = uninstall
mouse.drv=*

[MouseCheckOld]
IniName = system.ini
SectionName = boot
mouse.drv=aw*.drv

[MouseRestore]
IniSrc = pcaw.ini
IniTrgt = system.ini
SectionName = uninstall
NewSectionName = boot
mouse.drv=*

[MouseRestore1]
IniName = system.ini
SectionName = boot
mouse.drv = mouse.drv

[KbdDriverSaved]
IniName = pcaw.ini
SectionName = pcANYWHERE
keyboard=*

[KbdCheckOld]
IniName = system.ini
SectionName = boot
keyboard.drv=aw*.drv

[KbdRestore]
IniSrc = pcaw.ini
IniTrgt = system.ini
SectionName = pcANYWHERE
NewSectionName = boot
keyboard=*, NewItemName=keyboard.drv

[DisplayDriverSaved]
IniName = pcaw.ini
SectionName = pcANYWHERE
display=*

[DisplayCheckOld]
IniName = system.ini
SectionName = boot
display.drv=aw*.drv

[DisplayRestore]
IniSrc = pcaw.ini
IniTrgt = system.ini
SectionName = pcANYWHERE
NewSectionName = boot
display=*, NewItemName=display.drv

[SoundDriverSaved]
IniName = pcaw.ini
SectionName = pcANYWHERE
sound=*

[SoundCheckOld]
IniName = system.ini
SectionName = boot
sound.drv=aw*.drv

[SoundRestore]
IniSrc = pcaw.ini
IniTrgt = system.ini
SectionName = pcANYWHERE
NewSectionName = boot
sound=*, NewItemName=sound.drv

[AddFontSection]
IniName=pcaw.ini
SectionName=font
logicalfonts=0

[FindFontSection]
IniName=pcaw.ini
SectionName=font
logicalfonts=*

[pix]
color = %s\winaw.bmp

[AutoexecDelItems]
*AW_HOST*

[NetworkCustomize]
dll  = awinst.dll
function   = AWNetworkCustomize
ConfigFile = anywhere.bin, target

[PcawIni]
pcaw.ini, windows

[aw5vcd]
IniName = system.ini
SectionName = 386Enh
device=aw5vcd.386

[awvcd]
IniName = system.ini
SectionName = 386Enh
device=awvcd.386

[aw_vcd]
IniName = system.ini
SectionName = 386Enh
device=aw_vcd.386

[OldBaseFiles]                ;old pcAW files to be deleted
AWMODEM.DAT,    TARGET
AWDB.DLL,       TARGET
AWUSRFNC.DLL,    SYSTEM

;These sections are for checking configuration (standard, remote-only, host-only)
[CheckStd]
ininame = %s\anywhere.ini, SOURCE
SectionName = ProgramInformation
configuration=standard
[CheckRemote]
ininame = %s\anywhere.ini, SOURCE
SectionName = ProgramInformation
configuration=remote
[CheckHost]
ininame = %s\anywhere.ini, SOURCE
SectionName = ProgramInformation
configuration=host

;These sections are for checking if older versions of pcAW host drivers are loaded
[Files20]
awdos.386, SYSTEM
[Files10]
aw5mouse.drv, SYSTEM
[Files45]
awmouse.drv, SYSTEM
[Files50]
aw_mouse.drv, SYSTEM
[Winaw]
winaw.exe, TARGET

;Check if anywhere.bin already exists
[BinFile]
anywhere.bin, TARGET

;These sections are to add the list of old files to be deleted by the main program.
[DelOld45]
IniName = pcaw.ini
SectionName = oldfiles
file=%s\AWVGA.DRV, SYSTEM
file=%s\AWVGAMON.DRV, SYSTEM
file=%s\AWEGA.DRV, SYSTEM
file=%s\AWKBD.DRV, SYSTEM
file=%s\AWKBDHP.DRV, SYSTEM
file=%s\AWKBDOLI.DRV, SYSTEM
file=%s\AWMOUSE.DRV, SYSTEM

[DelOld50]
IniName = pcaw.ini
SectionName = oldfiles
file=%s\AW_VGA.DRV, SYSTEM
file=%s\AW_VGABW.DRV, SYSTEM
file=%s\AW_EGA.DRV, SYSTEM
file=%s\AW_KBD.DRV, SYSTEM
file=%s\AW_KBDHP.DRV, SYSTEM
file=%s\AW_KBDOL.DRV, SYSTEM
file=%s\AW_MOUSE.DRV, SYSTEM
file=%s\AW_VCD.386, SYSTEM
file=%s\AWORGMSE.DRV, SYSTEM
file=%s\AWREMACC.DRV, SYSTEM
file=%s\AWCM.DLL, SYSTEM

[Oldfiles]
IniName = pcaw.ini
SectionName = oldfiles
x=x

[DelOld10]
IniName = pcaw.ini
SectionName = oldfiles
file=%s\AW5VGA.DRV, SYSTEM
file=%s\AW5VGABW.DRV, SYSTEM
file=%s\AW5EGA.DRV, SYSTEM
file=%s\AW5XGA.DRV, SYSTEM
file=%s\AW5KBD.DRV, SYSTEM
file=%s\AW5KBDHP.DRV, SYSTEM
file=%s\AW5KBDOL.DRV, SYSTEM
file=%s\AW5MOUSE.DRV, SYSTEM
file=%s\AW5SOUND.DRV, SYSTEM
file=%s\VPCAW5.386, SYSTEM
file=%s\AW5VCD.386, SYSTEM
file=%s\AWREMACC.DRV, SYSTEM
file=%s\AWCM.DLL, SYSTEM
file=%s\AWCM8250.DLL, SYSTEM
file=%s\AWCMBAN.DLL, SYSTEM
file=%s\AWCMIN14.DLL, SYSTEM
file=%s\AWCMIPX.DLL, SYSTEM
file=%s\AWCMNASI.DLL, SYSTEM
file=%s\AWCMNB.DLL, SYSTEM
file=%s\AWCMTACS.DLL, SYSTEM
file=%s\AWFONT.FON, SYSTEM

;These sections are for checking if older versions of the @@@ files exist
[Admin10]
aw@@@___.cn5, TARGET
[Admin45]
aw@@@___.lc1, TARGET
[Admin50]
aw@@@___.bin, TARGET

[autoexec]
caption = "pcANYWHERE -- Modify AUTOEXEC.BAT"
text1 = "The following line(s) need to be deleted from your AUTOEXEC.BAT:"
fileSpec = c:\autoexec.bat
filetype = autoexec
DelItems = autoexecdel
Rem1 = "rem"
FindRems = 0

[autoexecdel]
*aw5host*
*aw_host*
*awlovl1*
*awhovl1*

[VCDExists]
IniName = system.ini
SectionName = 386Enh
device = *vcd*

[VCD386Exists]
vcd.386, SYSTEM

[AddVCD386]
IniName = system.ini
SectionName = 386Enh
device = vcd.386

[AddVCD]
IniName = system.ini
SectionName = 386Enh
device = **vcd

[NoReg]
noreg, SOURCE

[Reg]
file = %s\winaw.reg, TARGET
location = TARGET

[CheckAuto]
c:\autoexec.bat
