;****************************************************************************
;* Norton Commander Installation Script                                     *
;* FOR VERSION 4.0 OF SYMANTEC INSTALL FOR WINDOWS                          *
;****************************************************************************
;
; Switches:
;        2 = Whether running under Win95
;        3 = Whether Win NT version is the correct version or above
;        7 = Whether files-in-use
;       10 = Whether the specified target directory can be created
;       50 = Whether Custom installation selected.
;       60 = Whether NC basefiles selected in custom install panel
;       61 = Whether Compare Utility selected in custom install panel
;       62 = Whether Copy Utility selected in custom install panel
;       63 = Whether Net Utilities selected in custom install panel
;       64 = Whether Scheduler selected in custom install panel
;       65 = Whether Screen Savers selected in custom install panel
;       66 = Whether enough disk space on selected drive
;       70 = Whether the user wants a shortcut to NC on the desktop
;       71 = Whether the user wants to launch NC at the end of the install
;       72 = Whether the user wants DOS or Windows colours
;

[InstallVersion] ; Tell SETUP that this script is designed for SETUP Ver 4.0
4.0

[process]
SetInternalFlag( 1 )

DisableHelp()

switch40 = FALSE;
switch97 = FALSE;                      ; For "Common Finish" panel

AllowIntlChars()                       ; Allow international characters in the location name

Backup( SaveCustom )                   ; Backup the Custom DLL

CallProcEx( InitSwitches )             ; Set all the switches used in the script

switch2 = CallProcEx( CheckOSVer )     ; Check for Windows 95
;switch2 = FALSE;
#ifnot ( switch2 )                     ; If running NT
  switch3 = CallProcEx( CheckNTVer )   ; Ensure it is an appropriate NT version
  #ifnot ( switch3 )
    WizardPanel( BadOS, siwnc.dll)
    WizardProcessPanel()
    Goto( ScriptEnd )                  ; Exit
  #endif
#endif

#if ( switch40 )
  #if ( switch2 ) 
      WizardPanel ( RWelcome, siwnc.dll )  ; Get ready for the other Welcome panel
  #else
      WizardPanel ( RWelcomeNT, siwnc.dll )  ; Get ready for the other Welcome panel
  #endif
#else
  WizardPanel ( Welcome, siwnc.dll )   ; Get ready for the Welcome panel
#endif
WizardProcessPanel()                   ; Display the Welcome panel

#if ( switch40 )
  Goto( EndofQ )
#endif
WizardPanel( RequiredIntro, siwnc.dll )
WizardProcessPanel()
WizardPanel( RequiredSearch, siwnc.dll )
WizardProcessPanel()

WizardExcludePanel( RequiredIntro )
WizardExcludePanel( RequiredSearch )

WizardPanel( RequiredSuccess, siwnc.dll )
WizardProcessPanel()
WizardExcludePanel( RequiredSuccess )

:EndofQ
#if ( switch40 )
  WizardExcludePanel( RequiredIntro )
  WizardExcludePanel( RequiredSearch )
  WizardExcludePanel( RequiredSuccess )
#endif

WizardPanel( License, siwnc.dll )      ; Set up the online license agreement
WizardProcessPanel()		       ; Display online license agreement

CallProcEx( SetInstDir )               ; Set the install directory

WizardPanel( Location, siwnc.dll )     ; Set up the location request panel
WizardProcessPanel()		       ; Display location panel

SetActiveCopy( NCCopy , install.inf )  ; Used in searching DISKS.INF

WizardPanel( NCInstType, siwnc.dll )
WizardProcessPanel()

WizardPanel( CustInstPanel, siwnc.dll )

#if ( switch50 )
  WizardProcessPanel()

  #ifnot ( switch61 )
    DeselectOption ( nccompare )
  #endif
  #ifnot ( switch62 )
    DeselectOption ( nccopy )
  #endif
  #ifnot ( switch63 )
    DeselectOption ( ncnet )
  #endif
  #ifnot ( switch64 )
    DeselectOption ( ncsched )
  #endif
  #ifnot ( switch65 )
    DeselectOption ( ncscreens )
  #endif
#else
  WizardExcludePanel( CustInstPanel )
#endif

WizardPanel( NCOptions, siwnc.dll )     ; Set up the options panel
WizardProcessPanel()			; Display tech support panel

:CheckSpace
switch66 = CheckDiskSpace( TARGET )    ; Ensure there is enough space on the selected drive

#ifnot ( switch66 )
 MessageBox( NoSpace )
 WizardPanel( LocationNoSpace, siwnc.dll )  ; Set up the location request panel again
 WizardProcessPanel()                  ; Try again with Location panel
;; Further checking of disk space is done with in the LocationNoSpace panel
; switch67 = CheckDiskSpace( TARGET )   ; Check again
; #ifnot ( switch67 )
;   MessageBox( StillNoSpace )
;   Goto( ScriptEnd )                   ; Go to the end of the script and exit
; #endif
; Goto( Continue )                      ; Continue as a valid drive has been selected.
#endif

:Continue

WizardPanel( SetupReview, siwnc.dll )   ; Set up the review panel
WizardProcessPanel( SetupReview )       ; Display the review panel

:CopyTheFiles
;line below may need to be uncommented-DB
;CreateDirectory( MakeProgramDir )       ; Create the NC directory in mixed case
switch10 = CallProcEx( MakeNCDir )
#ifnot ( switch10 )
  MessageBox( BadDirectory )
  WizardPanel( LocationNoSpace, siwnc.dll )
  WizardProcessPanel()
  switch10 = CallProcEx( MakeNCDir )
  #ifnot ( switch10 )
    Goto( CopyTheFiles )
  #endif
#endif

DisableUtils()                          ; Disable Norton products that may cause problems when copying over new versions.
Copy()                                  ; Copy the files
EnableUtils()                           ; Re-enable these "problematic" Norton products

EnableWin95Shell()                      ; Groups are processed quicker this way. Uses IShellLink instead of DDE
Groups( )                               ; Create a group for installed product

MergeRegFile( NC96_OtherRegFile )       ; Merge the NC_INST.REG file so user can use "Add/Remove Programs" to uninstall
MergeRegFile( NC96_RegFile )            ; Merge the NC.REG file into the registry

SetRegistration( WriteTheNames )        ; Write the registration info to NC.EXE

CallProcEx( PromiscuousRegInfo )        ; Registration information to other files

CallProcEx( WhaDaTime )                 ; Fix time stamps (distorted by last two lines)

#if ( switch65 )                        ; Only rename/delete if screen savers installed
  Backup( RenameScrs )                  ; Give the screen savers long filenames
  Delete( DelShortScrs )                ; Delete the short name versions
#endif

#if ( switch2 )				; Windows 95
  Delete( NTFiles )
  Delete ( DelNTHelp )
#else
  Delete( 95Files )			; Windows NT
  Backup( MoveSysfiles )
  Delete( DelSysFiles )
  Delete ( Del95Help )
  Backup ( RenameNTHelp )
  Delete ( DelNTHelp )
#endif 

#if ( switch70 )
  CallProcEx( NCToDesktop )             ; Put a shortcut to NC on desktop
#endif

WizardPanel( TechSupport, siwnc.dll )   ; Set up the tech support panel
WizardProcessPanel()			; Display tech support panel

#ifnot ( switch72 )
  CallProcEx( NoBluesPlease )           ; Put in the Windows colours
#endif

CallProcEx( CheckThoseInUse )

;may need to uncomment lines below-DB
;#ifnot ( switch2 )                      ; On NT need to rename some of the
;  CallProcEx( RenameExecutables )       ; executables (e.g. SCHED_NT.EXE to NC_SCHED.EXE)
;#endif

WizardPanel( Finish, siwnc.dll )        ; Set up the final panel
WizardProcessPanel()			; Display final panel

;Commented out all of this section, to prevent problem at end with NT floppy message -DB
;WizardPanel( FloppyNotHard, siwnc.dll )
;:IsItFloppy
;WizardProcessPanel()                    ; Check whether diskette in drive.
;switch21 = CallProcEx( SeeItSoft )      ; Custom function checking for floppy in drive
;#if( switch21 )
;  Goto( IsItFloppy )                    ; Loop until diskette removed
;#endif
;WizardExcludePanel( FloppyNotHard )

#ifnot ( switch2 )			; Nt Version
  MessageBox ( RebootNT) ;
  switch7 = FALSE ;
#else
  #if ( switch71 )
    #if ( switch7 )                       ; If files-in-use cannot launch
      MessageBox( IWillNotLaunch )
    #else
      CallProcEx( SIWNC_RunNC )           ; Run NC.EXE from Custom DLL
    #endif
  #endif
#endif
:ScriptEnd

Delete( DeleteCustom )                  ; Delete the Custom DLL.

#if  (switch2 )
 #if ( switch7 )
  ExitReboot()                          ; If so, must reboot to complete installation
 #else
  Exit()                                ; Exit the installation program
 #endif
#else
 Exit()                                ; Exit the installation program
#endif

End()                                   ; Goodbye

;***************************************************************************
;* Wizard Panel section                                                    *
;***************************************************************************
[BadOS]
Caption = "Norton Commander for Windows 95/NT"
Title = "Incorrect Version"
ResourceId = 2001
DlgProc = WizardNCPanelProc
Bitmap16 = 600
PanelDataProc = _DefaultDataProc@0
PanelFlags = First + Last + Finish

[Welcome]
Caption = "Norton Commander for Windows 95/NT"
Title = "Welcome"
DlgProc = _WelcomeDlgProc@16
ResourceID = 501
Bitmap16 = 600
PanelDataProc = _WelcomeDataProc@0
PanelFlags = First

[RWelcome]
Caption = "Norton Commander for Windows 95/NT"
Title = "Welcome"
DlgProc = _WelcomeDlgProc@16
ResourceID = 2006
Bitmap16 = 600
PanelDataProc = _WelcomeDataProc@0
PanelFlags = First

[RWelcomeNT]
Caption = "Norton Commander for Windows 95/NT"
Title = "Welcome"
DlgProc = _WelcomeDlgProc@16
ResourceID = 2009
Bitmap16 = 600
PanelDataProc = _WelcomeDataProc@0
PanelFlags = First

[RequiredIntro]
Caption = "Norton Commander for Windows 95/NT"
Title = "Files Required for Upgrade"
ResourceId = 509
DlgProc = _RequiredDlgProc@16
Bitmap16 = 600
PanelDataProc = _RequiredDataProc@0
PanelFlags = First

[RequiredSearch]
Caption = "Norton Commander for Windows 95/NT"
Title = "Files Required for Upgrade"
DlgProc = _RequiredDlgProc@16
ResourceId = 508
Bitmap16 = 600
Data = _EnumQPD@4
PanelDataProc = _RequiredDataProc@0

[RequiredSuccess]
Caption = "Norton Commander for Windows 95/NT"
Title = "Required File Found"
ResourceId = 552
Bitmap16 = 600
PanelFlags = First

[License]
Caption = "Online License Agreement"
DlgProc = _LicenseDlgProc@16
ResourceId = 502
PanelDataProc = _LicenseDataProc@0
PanelFlags = First

[Location]
Caption = "Norton Commander for Windows 95/NT"
Title = "Program Location"
ResourceId = 2007
DlgProc = WizardNCPanelProc
Bitmap16 = 600
PanelDataProc = _DefaultDataProc@0

[LocationNoSpace]
Caption = "Norton Commander for Windows 95/NT"
Title = "Choose Another Location"
ResourceId = 2007
DlgProc = WizardNCPanelProc
Bitmap16 = 600
PanelDataProc = _DefaultDataProc@0

[TechSupport]
Caption = "Norton Commander for Windows 95/NT"
ResourceId = 507
DlgProc = _TechSupDlgProc@16
Bitmap16 = 207
PanelFlags = First

[NCInstType]
Caption = "Norton Commander for Windows 95/NT"
Title = "Select the installation type"
ResourceId = 2003
DlgProc = WizardNCPanelProc
Bitmap16 = 600
PanelDataProc = _DefaultDataProc@0
PanelFlags = First

[CustInstPanel]  ; No bitmap or title in order to use full panel width
Caption = "Norton Commander for Windows 95/NT"
ResourceId = 2004
DlgProc = WizardNCPanelProc
PanelDataProc = _DefaultDataProc@0

[NCOptions]  ; No title in order to use full panel height
Caption = "Norton Commander for Windows 95/NT - Installation Options"
ResourceId = 2005
DlgProc = WizardNCPanelProc
Bitmap16 = 600
PanelDataProc = _DefaultDataProc@0
PanelFlags = First

[Finish]
Caption = "Norton Commander for Windows 95/NT"
Title = "Installation Complete"
ResourceId = 563
DlgProc = _FinishDlgProc@16
Bitmap16 = 600
PanelDataProc = _FinishDataProc@0
PanelFlags = Last + Finish

[FinishData]                           ; For the "Common Finish" panel
RebootSwitch = switch7                 ; Depends on file-in-use
RestartSwitch = switch97               ; Always FALSE
ContinueSwitch = switch8               ; Always the opposite of switch7
SuccessText = "Norton Commander for Windows 95/NT has been successfully installed to your computer."
AddInfoText = "For the latest information on Norton Commander for Windows 95/NT, see the README.TXT file in the installation directory."
RebootOnlyText = "Setup may restart Windows to complete the necessary changes."
RebootOnlyNTText = "Please reboot this NT system to complete the necessary changes."
RestartOnlyText = "Setup may restart Windows to complete the necessary changes."
ContinueOnlyText = "Norton Commander for Windows 95/NT installation is complete."

[FloppyNotHard]
Caption = "Norton Commander for Windows 95/NT"
Title = "Remove Floppy Diskette"
ResourceId = 562
DlgProc = _FloppyInDrvDlgProc@16
Bitmap16 = 600
PanelFlags = Last + Finish

[SetupReview]
Caption = "Norton Commander for Windows 95/NT"
Title = "Setup Review"
ResourceId = 2008
DlgProc = WizardNCPanelProc
Bitmap16 = 600
PanelDataProc = _DefaultDataProc@0
PanelFlags = First

[MakeProgramDir]
%s, TARGET

;***************************************************************************
;* Custom DLL section                                                      *
;***************************************************************************
[SaveCustom]
siwnc.dll, siwnc.dll, SOURCE, TEMPDIR

[DeleteCustom]
siwnc.dll, TEMPDIR

[CheckOSVer]
dll = siwnc.dll
function = IsPlatformWin95

[CheckNTVer]
dll = siwnc.dll
function = IsWinVerNTGTE
osversionMajor = 03
osversionMinor = 51

[SetInstDir]
dll = siwnc.dll
function = SetNCInstDir

[InitSwitches]
dll = siwnc.dll
function = InitScriptSwitches

[NCToDesktop]
dll = siwnc.dll
function = CreateNCShortCut

[WhaDaTime]
dll = siwnc.dll
function = CorrectTime

[NoBluesPlease]
dll = siwnc.dll
function = MyWindowsColours

[PromiscuousRegInfo]
dll = siwnc.dll
function = SpreadingTheSeed

[SeeItSoft]
dll = siwnc.dll
function = IsFloppyInDrive

[SIWNC_RunNC]
dll = siwnc.dll
function = RunTheCoolProduct

[CheckThoseInUse]
dll = siwnc.dll
function = AreFilesInUse

[RenameExecutables]
dll = siwnc.dll
function = RenameNTExecutables

[MakeNCDir]
dll = siwnc.dll
function = CreateNCDirectory
;***************************************************************************
;* Groups                                                                  *
;***************************************************************************

[groups]
"Norton Commander",  nc96.grp           ; Name of the Norton Commander Group

[Norton Commander]                      ; This text in [] must match that under [NC96Groups]
"Norton Commander",                     nc.exe,         basefiles,,,,,
"Norton Commander Network Utilities",   nc_net.exe,     ncnet,,,,,
"Norton Commander Scheduler",           nc_sched.exe,   ncsched,,,,,

;***************************************************************************
;* Quitting Setup                                                          *
;***************************************************************************

[Cancel]                                ; When the user chooses to exit Setup
caption = "Norton Commander Setup"
text    = "Are you sure you want to exit?"

;***************************************************************************
;* Registration                                                            *
;***************************************************************************
[Registration]
appname =  nc.exe                         ; Destination file for registration info.
string  =  "Symantec Install for Windows" ; Search string in destination DLL
active = no
serialize = 0

[WriteTheNames]
nc.exe, TARGET

[NC96_RegFile]                          ; Windows Registry information
file = %s\nc.reg, TARGET                ; Merge NC.REG into the Windows Registry

[NC96_OtherRegFile]
file = %s\nc_inst.reg, TARGET           ; Merge NC_INST.REG into Windows Registry

;***************************************************************************
;* Copying Files                                                           *
;***************************************************************************

[NCCopy:Primary]
caption = "Norton Commander - Application Selection"
text = PrimaryText

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

[NCCopy:CopyDialog]
caption = "Copying Files"
posx = -5
posy = -5

[FileCopy]
copycaption   =  "Installing Norton Commander"
errorcaption  =  "Error Copying Files"
insertcaption =  "Insert Diskette"

[NCCopy]                                                          ;Size,  Required, Files Button, Show Item
CopyMain.BaseFiles,    "Norton Commander Files - %ldK",            0,     Y,        N,            Y
CopyMain.nccompare,    "Norton Commander Compare Utility - %ldK",  0,     N,        N,            Y
CopyMain.nccopy,       "Norton Commander Copy Utility - %ldK",     0,     N,        N,            Y
CopyMain.ncnet,        "Norton Commander Network Utilites - %ldK", 0,     N,        N,            Y
CopyMain.ncsched,      "Norton Commander Scheduler - %ldK",        0,     N,        N,            Y
CopyMain.ncscreens,    "Norton Commander Screen Savers - %ldK",    0,     N,        N,            Y

[RenameScrs]          ; Gives LFN to the screen savers
nc_name.scr, "Norton Commander Name Bounce.Scr", SYSTEM, SYSTEM
nc_stars.scr, "Norton Commander Starry Night.Scr", SYSTEM, SYSTEM


[DelShortScrs]        ; Delete the original files
nc_name.scr, SYSTEM
nc_stars.scr, SYSTEM

[MoveSysFiles]
serial.sys,  drivers\serial.sys, SYSTEM, SYSTEM
parport.sys, drivers\parport.sys, SYSTEM, SYSTEM

[DelSysFiles]
serial.sys,  SYSTEM
parport.sys, SYSTEM

[NTFiles]
ecdc32nt.dll, TARGET

[95Files]
ecdc32.dll, TARGET
ecdc32.vxd, TARGET
symkrnl8.vxd, TARGET

[DelNTHelp]
ncnt.hlp,TARGET

[Del95Help]
nc.hlp,TARGET

[RenameNTHelp]
ncnt.hlp,nc.hlp,TARGET
;***************************************************************************
;* "Advotorial" dialogs                                                    *
;***************************************************************************
[NCCopy:Advo]
posx = 1
posy = 1
location = siwnc.dll
count = 2
BitmapsOnly=0

;***************************************************************************
;* Messages                                                                *
;***************************************************************************
[NoSpace]
caption = "Norton Commander"
" "
"There is not enough space to install Norton"
"Commander to the selected drive."
" "
"Please select another drive."
" "

[StillNoSpace]
caption = "Norton Commander"
" "
"You have not selected a drive with sufficient"
"space to install Norton Commander."
" "
"The installation program will now exit."
" "

[IWillNotLaunch]
caption = "Norton Commander"
" "
"The system will restart to complete the installation,"
"and Norton Commander will not be launched."
" "

[RebootNT]
caption = "Norton Commander"
" "
"Please reboot this NT system"
"to complete the necessary changes."
" "

[BadDirectory]
caption = "Norton Commander"
" "
"Unable to create the specified installation directory."
"You may not have write access to the specified drive/directory"
"or the drive may not support long filenames."
" "
"Please change the specified directory."
" "
