# Copyright 2000, International Business Machines Corporation and others.
# All Rights Reserved.
# 
# This software has been released under the terms of the IBM Public
# License.  For details, see the LICENSE file in the top-level source
# directory or online at http://www.openafs.org/dl/license10.html

!INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME)
!INCLUDE ..\..\..\config\NTMakefile.version

#  Install comments
#             Don't use '=' in the following strings!
#             WELCOMEMESSAGE=Display during installation process
#             AFSBUILDCOMMENTS=Displayed in properity page for install file
#             CELLSERVDB_CONFIGNAME = name of configuration file (ThisCell)

CELLSERVDB_CONFIGNAME=afsdcell.ini
WELCOMEMESSAGE=Default Configuration Information:\nBuild:*DatE* *TimE* Ver:$(AFSPRODUCT_VERSION)\nCellname:$(CELLNAME_DEFAULT)\nCellSrvDB:$(CELLSERVDB_INSTALL)
AFSBUILDCOMMENTS=Build:*DatE* *TimE* CellServDB:$(CELLSERVDB_INSTALL)

############################################################################

prep: AFS_component_version_number.txt
    $(DESTDIR)\bin\util_cr.exe } "$(AFSPRODUCT_VERSION)" ".\lang\en_US\valuee.shl"
    $(DESTDIR)\bin\util_cr.exe } "$(AFSPRODUCT_VERSION)" "default.txt" "default.rge"
    $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\lang\en_US\value.shl" "[DATA] CELLSERVDB_CONFIGNAME=$(CELLSERVDB_CONFIGNAME)"
    $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\lang\en_US\value.shl" "[DATA] CELLNAME_DEFAULT=$(CELLNAME_DEFAULT)"
    $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\lang\en_US\value.shl" "[DATA] CELLSERVDB_INSTALL=$(CELLSERVDB_INSTALL)"
    $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\lang\en_US\value.shl" "[DATA] CELLSERVDB_WEB=$(CELLSERVDB_WEB)"
!IF "$(WELCOMEMESSAGE)" != ""
      $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\lang\en_US\value.shl" "[DATA] WELCOME_MESSAGE=$(WELCOMEMESSAGE)"
!ENDIF
!     IF ((EXIST("$(ISWEB)")) &&("$(ISWEB)"!=""))
      $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\packageweb.pfw" "[Options] Version=$(AFSPRODUCT_VERSION)"
      $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\packageweb.pfw" "[Options] Comments=$(AFSBUILDCOMMENTS)"
      $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\packageweb.pfw" "[Options] ApplicationName=AFSforWindows"
      $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\packageweb.pfw" "[Options] Company=Open AFS"
      
!     ENDIF
    CreateISDirTree.bat
    ScatterFiles.bat
    CreateGeneratedFiles.bat
    CompileScript.bat
    $(COPY) $(DESTDIR)\WinInstall\Config\wininet.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\."
    $(COPY) $(DESTDIR)\WinInstall\Config\shlwapi.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\."
    $(COPY) ..\..\afs_setup_utils\_isuser\_isuser.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\."
    $(COPY) ..\..\afs_setup_utils\getwebdll\getwebdll.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\."
    $(COPY) $(DESTDIR)\WinInstall\Config\$(CELLSERVDB_INSTALL) ".\Setup Files\Compressed Files\0009-English\Intel 32\$(CELLSERVDB_CONFIGNAME)"
    $(DESTDIR)\bin\util_cr.exe ~ "$(DESTDIR)\root.client\usr\vice\etc\$(CELLSERVDB_CONFIGNAME)"
    $(DESTDIR)\bin\util_cr.exe ~ ".\Setup Files\Compressed Files\0009-English\Intel 32\_ISUSER.DLL"
    $(DESTDIR)\bin\util_cr.exe ~ ".\Setup Files\Compressed Files\0009-English\Intel 32\shlwapi.DLL"
    $(DESTDIR)\bin\util_cr.exe ~ ".\Setup Files\Compressed Files\0009-English\Intel 32\wininet.DLL"
    $(DESTDIR)\bin\util_cr.exe ~ ".\Setup Files\Compressed Files\0009-English\Intel 32\GETWEBDLL.DLL"

build:
    BuildSetup.bat
    xcopy/s/e/y "Media\Transarc AFS\Disk Images\disk1\*.*" $(DESTDIR)\WinInstall
    copy AFS_component_version_number.txt $(DESTDIR)\WinInstall\Version.txt
    $(DEL) /q "Media\Transarc AFS\Disk Images\disk1\*.*"
!IF ((EXIST("$(ISWEB)")) &&("$(ISWEB)"!=""))
!	IF (!EXIST($(DESTDIR)\Wininstall\PackageWeb))
		$(MKDIR) $(DESTDIR)\Wininstall\PackageWeb
!	ENDIF
	$(DEL) /q $(DESTDIR)\Wininstall\PackageWeb\*.*
	$(ISWEB)\Pftwwiz.exe $(AFSROOT)\src\winnt\install\InstallShield5\PackageWeb.pfw -s -a 
!ENDIF

install: prep build
