;**************************************************************************
;* Norton Administrator Installation Script                               *
;* (c)1994 - Symantec, Peter Norton Group                                 *
;*                                                                        *
;* for use with the Symantec Install for Windows version 3.3              *
;**************************************************************************

;switch usage:
;	69 - TRUE for install
;	42 - TRUE if install is shell
;	40 - result from copying DLLs to Windows directory
;	41 - TRUE if install is shell
;	91 - TRUE for automatic installation
;	92 - TRUE for custom installation
;	05 - TRUE if old nadmin.ini file exists
;	72 - TRUE for remote install, FALSE for normal install
;	42 - TRUE for existing applicat.dat
;	43 - TRUE for existing nadmin.lic
;	11 - used to test if various components are selected
;	15 = TRUE if modifying login script
;	30 = TRUE if including Inventory Agent
;	31 = TRUE if including Distribution Agent
;	59 - TRUE if running on OS/2
;

[process]
										; switch69 is true for install, 
										; false for uninstall
switch69 = TRUE

                                        ; move the DLLs we need to the
										; Windows directory. if we are
										; the Windows shell, then we
										; already copied the DLLs.
switch42 = IsInstallShell()
#ifnot(switch42)
	switch40 = backup(nadmindll)
	
	#ifnot(switch40)
	    MessageBox(CopyCustError)
	    Delete(FilesToDelete)
	
	    switch41 = IsInstallShell()
	
	    #if(switch41)
	        ExitWindows()
	    #else
	        exit
	    #endif
	#endif
#endif

Bitmaps(pix)
SetActiveCopy(nnucopy,install.inf)

										; load DLLs
CallProc(LoadSymnet)

Registration()

										; switch91 = Automatic Installation
										; switch92 = Custom Installation
SelectInstallType()
#if(switch92)
    PrimarySelect()
#endif

										; if there was an old ini file, 
										; blast the data line
switch05 = Exists(NadminFileExists)
#if(switch05)
    DelFromIni(NadminIniFile)
#endif
										; get target directories
										; switch72 is false for normal
										; install, true for remote install
switch72 = FALSE
CallProc(NetTargetDrive)
CallProc(NetWriteNailData)

										; check for files we won't be able
										; to overwrite. if this call fails
										; we exit immediately.
CallProc(CheckForOpenFiles)

										; set network files readwrite 
										; (to overwrite existing files)
CallProc(SetAllFilesToReadWrite)

										; check for adding entries to
										; module database for disklock
										; or NUA
CallProc(CheckDiskLock)
CallProc(CheckNUA)

                                        ; check for existing applicat.dat.
										; switch42 will be set if it
										; exists.
CallProc(CheckApplicatDat)

                                        ; check for existing nadmin.lic.
										; switch43 will be set if it
										; exists.
CallProc(CheckNadminLic)


										; copy files
copy()

                                        ; if old applicat.dat existed, 
										; restore it now. rename the new
										; applicat.dat to newapp.dat
#if(switch42)
	CallProc(RenameApplicatDat)	
#endif

                                        ; if old nadmin.lic existed, 
										; restore it now. rename the new
										; nadmin.lic to newadmin.lic
#if(switch43)
	CallProc(RenameNadminLic)	
#endif

										; Set the user registration
SetRegistration(UserReg)

										; update the product description file
										; with the stuff we just installed.
										; make sure this is done before
										; we launch nail.

CallProc(AddConsoleToProdDesc)

switch11=IsOptionSelected(meter)
#if(switch11)
	CallProc(AddMeterToProdDesc)
#endif

switch11=IsOptionSelected(inv)
#if(switch11)
	CallProc(AddInvToProdDesc)
#endif

switch11=IsOptionSelected(dist)
#if(switch11)
	CallProc(AddDistToProdDesc)
#endif

										; if install is the Windows shell,
										; we can't make use of the features
										; for defining additional sites.
switch58 = IsInstallShell()
#if(switch58)
										; let nail initialize itself
	ExecChildProcess(LaunchNailNoSites)

#else
										; let nail initialize itself
	ExecChildProcess(LaunchNail)

										; the function StartWanInstall
										; will set switch23 if we need
										; to perform wan installs. this
										; must follow the
										; launching Nail with /firsttime.
	CallProc(StartWanInstall)
#endif


										; see if user wants to modify the 
										; system login script.
										; non-Netware environments will 
										; skip this.
										;
										; switch30 = Include Inventory Agent
										; switch31 = Include Distribution Agent
										; switch32 = Include Metering Agent
										;
										; switch15 = TRUE or FALSE depending 
										;            upon OK or CANCEL
CallProc(FindLoginScript)

										; callproc here to backup and remove 
										; flags for login script
										; assumes file is in szExtStr1 
										; (in CallProc.NetTargetDrive)
#if(switch15)

										;change TARGET2 to UNC
    CallProc(BackupTarget2)
    CallProc(ChangeToUNC)

    CallProc(SetLoginScriptRW)
    ModifyTextFile(LoginScript)
    CallProc(SetLoginScriptRO)

										; restore TARGET2 from UNC
    CallProc(RestoreTarget2)
#endif

										; create DATA subdirectories
CreateDirectory(DataInDir)
CreateDirectory(DataOutDir)
CreateDirectory(DataBinDir)

										; reenable TSR if it's present
switch25 = CallProcEx(CheckTSR)

#if(switch25)
    CallProcEx(EnableTSR)
#endif

										; add entry to localins.ini
UpdateIni(UpdateLocalinsIni)

                                        ; copy disks.inf to nandisks.inf
CallProc(SaveDisksInf)

										; free DLLs
CallProc(FreeSymnet)

                                        ; build Windows group if we are
										; not under OS/2
CallProc(CheckForOS2)
#ifnot(switch59)
	Groups()
#endif

										; register the OLE2 DLLs we copied
Launch(RegisterOle)

										; delete DLLs from Windows directory
delete(FilesToDelete)

										; the function StartWanInstall
										; has set switch23 if we need
										; to perform wan installs. this
										; can only be the case if we
										; are not the Windows shell.
switch20 = IsInstallShell()
#if(switch20)
    End(ByeShell)
#else
	#if(switch23)
		Launch(LaunchNailASecondTime)
    	Exit()
	#else
	    Exit()
	#endif
#endif

end

; SubProc to be executed before we take over as the shell

[SubProc]
Backup(nadmindll)

switch20 = CallProcEx(CheckTSR)

#if(switch20)
   CallProcEx(DisableTSR)
#endif

Return


;**************************************************************************
;* Disks                                                                  *
;**************************************************************************

[InstallVersion]
4.0

[CompressionChars]
LZW = "_"
ZIP = "$"

[FilesToDelete]
naninst.dll,  WINDOWS
symls.dll,    WINDOWS
nautil.dll,   WINDOWS
symkrnl7.dll, WINDOWS
symdb7.dll,   WINDOWS
symnet7.dll,  WINDOWS
symnw37.dll,  WINDOWS
symnw47.dll,  WINDOWS
symnds7.dll,  WINDOWS
symbv47.dll,  WINDOWS
symlm27.dll,  WINDOWS
symutil7.dll, WINDOWS
symgui7.dll,  WINDOWS

[NadminIniFile]
IniName                    = %s\nadmin.ini, WINDOWS
SectionName                = Data
DefDataDir                 = "*"

[LaunchNail]
"%s\nconsole.exe /FIRSTTIME", TARGET

[LaunchNailNoSites]
"%s\nconsole.exe /FIRSTTIME /NOSITES", TARGET

[LaunchNailASecondTime]
"%s\nconsole.exe /WANINSTALL", TARGET

;**************************************************************************
;* Copy                                                                   *
;**************************************************************************

; %ld will be replaced at runtime by the install program

[nnucopy]
copymain.console,    "Norton Administrator for Networks - %ldK",  0, Y, N, Y
copymain.meter,        "&Metering - %ldK",                        0, N, N, Y
copymain.inv,          "&Inventory - %ldK",                       0, N, N, Y
copymain.dist,         "&Distribution - %ldK",                    0, N, N, Y
copymain.sb,           "Symantec &Basic - %ldK",                  0, N, N, Y


;**************************************************************************
;* Groups                                                                 *
;**************************************************************************

[groups]
"Norton Network Series",        nadmin.grp

[Norton Network Series]
"Norton Console",                      		 nconsole.exe,        console,,TARGET
"Site Manager",                              repmgr.exe,        console,,TARGET
"Symantec BASIC",                            sbedit.exe,        sb,1,TARGET
"Remove Norton Administrator",               install.exe,       console,,TARGET,,,"nanun.inf"
"Inventory Agent",                           nainvw.exe,        inv,,TARGET2
"Distribution Agent",                        nadistw.exe,       dist,,TARGET2
"Metering Agent",                            nanodew.exe,       meter,,TARGET2
"HP OpenView Integration",                   ovinst.exe,        console,,TARGET

[nnucopy:copydialog]
caption = "Copying Files"
posx = -10
posy = -10

[nnucopy:TypeSelect]
count       = 2
caption     = "Norton Administrator for Networks - Installation Type"
text        = "Please select the installation type you prefer."
grouptext   = "Install Types"
button1     = "&Automatic Installation"
button2     = "&Custom Installation"
descrip1    = "Installs the entire Norton Administrator for Networks package with all Tools and Utilities."
descrip2    = "Lets you choose which modules to install now.  If you need to add more options later, you can re-install."

[nnucopy:Primary]
caption = "Norton Administrator for Networks - Application Selection"
text = primarytext

[nnucopy:Advo]
posx = 10
posy = 50
location = naninst.dll
count = 1
BitmapsOnly = 1

[primarytext]
"Uncheck any modules you do not wish to install."

[AdvoDefault]
posx = 20
posy = 80
text = AdvoText

[AdvoText]
"Be sure to fill out your registration"
"card.  This will allow Symantec to contact"
"you about future product updates."


;**************************************************************************
;* Dialogs/Message box text                                               *
;**************************************************************************

[ByeShell]
caption = "Installation Complete"
"This concludes the installation of"
"Norton Administrator for Networks."
" "
"Please review the README.TXT file for any last"
"minute additions and/or corrections to the documentation."
" "
"Select one of the exit options."
" "

[ByeNoReboot]
caption = "Installation Complete"
"This concludes the installation of "
"Norton Administrator for Networks."
" "
"Please review the README.TXT file for any last"
"minute additions and/or corrections to the documentation."
" "
"Select one of the exit options."
" "

[TargetBrowse]
caption = "Browse Directories"
DefaultDir = C:\

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

[FileCopy]
copycaption   =  "Installing Norton Administrator for Networks"
errorcaption  =  "Error Copying Files"
insertcaption =  "Insert Diskette"

[cancel]
caption = "Norton Administrator for Networks"
text    = "Are you sure you want to exit?"

[cancelshell]
caption = "Norton Administrator for Networks"
"When you Cancel Install, Windows"
"will exit to the DOS prompt so"
"that the Windows environment can"
"be reset."
""
"Are you sure you want to exit?"

[CopyCustError]
caption = "Copy Error"
"There was an error copying some temporary files"
"to your Windows directory.  The problem may be"
"due to insufficient disk space.  Please correct"
"the problem and rerun Install."

;**************************************************************************
;* Misc install information                                               *
;**************************************************************************

[nadmindll]
naninst.dll,  naninst.dll,  SOURCE, WINDOWS
symkrnl7.dll, symkrnl7.dll, SOURCE, WINDOWS
symdb7.dll,   symdb7.dll,   SOURCE, WINDOWS
symnet7.dll,  symnet7.dll,  SOURCE, WINDOWS
symnw37.dll,  symnw37.dll,  SOURCE, WINDOWS
symnw47.dll,  symnw47.dll,  SOURCE, WINDOWS
symnds7.dll,  symnds7.dll,  SOURCE, WINDOWS
symbv47.dll,  symbv47.dll,  SOURCE, WINDOWS
symlm27.dll,  symlm27.dll,  SOURCE, WINDOWS
symutil7.dll, symutil7.dll, SOURCE, WINDOWS
symls.dll,    symls.dll,    SOURCE, WINDOWS
nautil.dll,   nautil.dll,   SOURCE, WINDOWS
symgui7.dll,  symgui7.dll,  SOURCE, WINDOWS


[DllExists]
naninst.dll,  WINDOWS
symkrnl7.dll, WINDOWS
symdb7.dll,   WINDOWS
symnet7.dll,  WINDOWS
symnw37.dll,  WINDOWS
symnw47.dll,  WINDOWS
symnds7.dll,  WINDOWS
symbv47.dll,  WINDOWS
symlm27.dll,  WINDOWS
symutil7.dll, WINDOWS
symls.dll,    WINDOWS
nautil.dll,   WINDOWS
symgui7.dll,  WINDOWS


[pix]
color = %s\nantext.rle, 1, 1
color = %s\symblue.rle, -1, 1
color = %s\anvil2.bmp, 1, -1

; custom dll functions
[NetTargetDrive]
dll = naninst.dll
function = NetTargetCustomize
targettext=NetTargetText

[NetTargetText]
"Please select the directories for the Norton Administrator"
"for Networks.  If you have an existing Norton Network Series installation,"
"you should use the same directories for this installation."
""
""
"The following security issues should be kept in mind:"
""
" -- The SUPERVISOR needs READ/WRITE access to the Console directory."
""
" -- USERS need READ access to the Agents directory."
""
" -- USERS need READ/WRITE access to the Data directory."

[NetWriteInstallData]
dll = naninst.dll
function = NetWriteInstallData

[NetWriteNailData]
dll = naninst.dll
function = NetWriteNailData

[VerifyAnyOverwrite]
dll = naninst.dll
function = VerifyAnyOverwrite

[RemoveTTSFlags]
dll = naninst.dll
function = RemoveTTSFlags

[SetLoginScriptRW]
dll = naninst.dll
function = SetLoginScriptRW

[SetLoginScriptRO]
dll = naninst.dll
function = SetLoginScriptRO

[RemoveOldLoginScriptInfo]
dll = naninst.dll
function = RemoveOldLoginScriptInfo

[FindLoginScript]
dll = naninst.dll
function = FindLoginScript

[ChangeToUNC]
dll = naninst.dll
function = ChangeToUNC

[BackupTarget2]
dll = naninst.dll
function = BackupTarget2

[RestoreTarget2]
dll = naninst.dll
function = RestoreTarget2

[LoadSymnet]
dll = naninst.dll
function = LoadSymnet

[FreeSymnet]
dll = naninst.dll
function = FreeSymnet

[ExitHookProc]
dll = naninst.dll
function = ExitHookProc

[NadminFileExists]
nadmin.ini, WINDOWS

[DllsExist]
naninst.dll,   WINDOWS
symkrnl7.dll,  WINDOWS
symdb7.dll,    WINDOWS
symnet7.dll,   WINDOWS
symnw37.dll,   WINDOWS
symbv47.dll,   WINDOWS
symlm27.dll,   WINDOWS
symutil7.dll,  WINDOWS
symls.dll,     WINDOWS
nautil.dll,    WINDOWS
symgui7.dll,   WINDOWS
;symlsm.dll,   WINDOWS
;symlsl.dll,   WINDOWS

[CheckTSR]
dll = naninst.dll
function = IsTSRPresent

[DisableTSR]
dll = naninst.dll
function = DisableDosTSR

[EnableTSR]
dll = naninst.dll
function = EnableDosTSR

[SetFilesToReadOnly]
dll = naninst.dll
function = SetFilesToReadOnly

[SetAllFilesToReadWrite]
dll = naninst.dll
function = SetAllFilesToReadWrite

[UpgradeYesNo]
caption     = "Norton Administrator for Networks"
"All existing databases need to be upgraded"
"to the current version.  After this conversion"
"only the latest version of Norton Administrator"
"for Networks will read the databases."
" "
"Do you wish to continue?"

;**************************************************************************
;* Login Script modifications                                             *
;**************************************************************************
[LoginScript]
caption    = "Modify Login Script File"
text1      = "The following line(s) need to be added to your Login Script file:"
FileSpec   =
FileType   = text
Rem1       = "Rem"
Rem2       = "Remark"
Rem3       = "*"
Rem4       = ";"
FindRems   = 1

RemItems   = LoginRemItems
DelItems   = LoginDelItems
AddItems   = LoginAddItems

[LoginRemItems]

[LoginDelItems]
*NORTON_ADMINISTRATOR*
*nainv.exe*
*nadist.exe*

[LoginAddItems]
"Rem Norton_Administrator_For_Networks" , APPEND
"#%s\nainv.exe",   TARGET2 , switch30  , APPEND
"#%s\nadist.exe",  TARGET2 , switch31  , APPEND

;**************************************************************************
;* Set Shell section                                                      *
;**************************************************************************

[SetShell]
AppIniName = hammer.ini
WinIniName = win.ini
SystemIniName = system.ini
Message = MessageBox.SetShellMessage
SysSectionName = boot
WinSectionName = windows
shell = %s\install.exe
load =
run =
SetShellIfLoaded=
Backup = Backup.SetShellSave
Restore = Backup.SetShellRestore
Active = yes
IfActiveList=LoadedList
SubProcess=SubProc

[SetShellSave]
win.ini, win.$nn, WINDOWS
system.ini, system.$nn, WINDOWS

[SetShellRestore]
system.$nn, system.ini, WINDOWS
win.$nn, win.ini, WINDOWS

; if any of this stuff is running, we restart Windows and
; take over as the shell before proceeding with install.
[LoadedList]
nadist.exe								; NAN agents
nadistw.exe
nainv.exe
nameter.exe
nameterw.exe
nanode.exe
nanodew.exe
naninst.dll							; DLLs required by install that
symkrnl7.dll							; will be temporarily copied
symdb7.dll								; to Windows directory
symnet7.dll
symnw37.dll
symnw47.dll
symnds7.dll
symbv47.dll
symlm27.dll
symutil7.dll
symls.dll
nautil.dll
symgui7.dll
compobj.dll								; Windows DLLs that we will copy
ctl3dv2.dll								; to the Windows\System directory
ole2.dll								
ole2disp.dll
ole2nls.dll
ole2prox.dll
storage.dll
typelib.dll

[SetShellMessage]
caption = "Norton Administrator for Networks -- Install"
"Welcome to the Norton Administrator for"
"Networks installation program."
" "
"Please press OK to allow Install"
"to restart Windows and continue"
"the installation.  Press Cancel to exit."

[WindowsVersion]
3.10
"Norton Administrator for Networks requires"
"Microsoft Windows version 3.1 or later."

[DataInDir]
%s\BIN.IN, TARGET3

[DataOutDir]
%s\BIN.OUT, TARGET3

[DataBinDir]
%s\BIN.DAT, TARGET3

[Registration]
caption =  "Norton Administrator for Networks -- Registration"
text1   =  regtext
text2   =  "&Name:"
text3   =  "&Company:"
Cancel  =  "Cancel"
Help    =  "&Help"
appname =  nconapi.dll
string  =  "Symantec Install for Windows"
active  =  no
serialize = 0

[regtext]
"Welcome to the Norton Administrator for Networks Installation."
" "
"Please enter your name and company below."
" "
" "

[UserReg]
nconapi.dll, TARGET

[AddConsoleToProdDesc]
dll = naninst.dll
function=AddConsoleToProdDesc

[AddMeterToProdDesc]
dll = naninst.dll
function=AddMeterToProdDesc

[AddInvToProdDesc]
dll = naninst.dll
function=AddInvToProdDesc

[AddDistToProdDesc]
dll = naninst.dll
function=AddDistToProdDesc

[RegisterOle]
"%s\regedit.exe /s ole2.reg", WINDOWS

[CheckApplicatDat]
dll=naninst.dll
function=CheckApplicatDat

[RenameApplicatDat]
dll=naninst.dll
function=RenameApplicatDat

[CheckNadminLic]
dll=naninst.dll
function=CheckNadminLic

[RenameNadminLic]
dll=naninst.dll
function=RenameNadminLic

[CheckForOpenFiles]
dll=naninst.dll
function=ProbableSuccess

[CheckDiskLock]
dll=naninst.dll
function=CheckForOldDisklock

[CheckNUA]
dll=naninst.dll
function=CheckForOldNUA

[CheckForOS2]
dll=naninst.dll
function=CheckForOS2

[StartWanInstall]
dll=naninst.dll
function=StartWanInstall

[SaveDisksInf]
dll=naninst.dll
function=SaveDisksInf
;;;disks.inf, nandisks.inf, TARGET, TARGET

[UpdateLocalinsIni]
IniName=%s\localins.ini,TARGET
SectionName=NAN20
Product="Norton Administrator for Networks"
Script=LASTSTEP.INF

[ProductName]
Directory=NAN20
FullName=Norton Administrator For Networks V2.0

