# 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

RELDIR=WINNT\install\InstallShield5
!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)
 
#CHECK which OS we are using to avoid using the wrong options
!IF	(([$(DESTDIR)\bin\util_cr.exe _ xp w2])==1) 
XCOPY= xcopy /s/e/y
!ELSE
XCOPY= xcopy /s/e
!ENDIF

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

prep: AFS_component_version_number.txt
	$(DESTDIR)\bin\util_cr.exe } "$(AFSPRODUCT_VERSION)" ".\lang\en_US\value.txt" "$(OUT)\lang\en_US\value.shl"
	$(DESTDIR)\bin\util_cr.exe } "$(AFSPRODUCT_VERSION)" "default.txt" "default.rge"
	$(DESTDIR)\bin\util_cr.exe @ "$(OUT)\lang\en_US\value.shl" "[DATA] CELLSERVDB_CONFIGNAME=$(CELLSERVDB_CONFIGNAME)"
	$(DESTDIR)\bin\util_cr.exe @ "$(OUT)\lang\en_US\value.shl" "[DATA] CELLNAME_DEFAULT=$(CELLNAME_DEFAULT)"
	$(DESTDIR)\bin\util_cr.exe @ "$(OUT)\lang\en_US\value.shl" "[DATA] CELLSERVDB_INSTALL=$(CELLSERVDB_INSTALL)"
	$(DESTDIR)\bin\util_cr.exe @ "$(OUT)\lang\en_US\value.shl" "[DATA] CELLSERVDB_WEB=$(CELLSERVDB_WEB)"
!IF "$(WELCOMEMESSAGE)" != ""
	$(DESTDIR)\bin\util_cr.exe @ "$(OUT)\lang\en_US\value.shl" "[DATA] WELCOME_MESSAGE=$(WELCOMEMESSAGE)"
!ENDIF
!     IF ((EXIST("$(ISWEB)")) &&("$(ISWEB)"!=""))
	$(DESTDIR)\bin\util_cr.exe @ "$(OUT)\packageweb.pfw" "[Options] Version=$(AFSPRODUCT_VERSION)"
	$(DESTDIR)\bin\util_cr.exe @ "$(OUT)\packageweb.pfw" "[Options] Comments=$(AFSBUILDCOMMENTS)"
	$(DESTDIR)\bin\util_cr.exe @ "$(OUT)\packageweb.pfw" "[Options] ApplicationName=AFSforWindows"
	$(DESTDIR)\bin\util_cr.exe @ "$(OUT)\packageweb.pfw" "[Options] Company=Open AFS"
	$(DESTDIR)\bin\util_cr.exe @ "$(OUT)\packageweb.pfw" "[Options] Title=Open AFS for Windows"
	$(DESTDIR)\bin\util_cr.exe @ "$(OUT)\packageweb.pfw" "[Options] OutputSpec="$(DESTDIR)\WinInstall\PackageWeb\AFSforWindows.exe"
!     ENDIF
    CreateISDirTree.bat
    ScatterFiles.bat
    CreateGeneratedFiles.bat
    CompileScript.bat
	$(COPY) $(SYSTEMROOT)\SYSTEM32\wininet.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\."
	$(COPY) $(SYSTEMROOT)\SYSTEM32\shlwapi.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\."
	$(COPY) $(DESTDIR)\WinInstall\Config\_isuser.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\."
	$(COPY) $(DESTDIR)\WinInstall\Config\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 ~ ".\Setup Files\Compressed Files\0009-English\Intel 32\$(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
!IF ((EXIST("$(ISWEB)")) &&("$(ISWEB)"!=""))
!	IF (!EXIST($(DESTDIR)\Wininstall\PackageWeb))
		$(MKDIR) $(DESTDIR)\Wininstall\PackageWeb
!	ENDIF
	$(DEL) /q $(DESTDIR)\Wininstall\PackageWeb\*.*
	$(ISWEB)\Pftwwiz.exe $(SRT)PackageWeb.pfw -s -a 
!ENDIF
	$(XCOPY) Media\OpenAFS\DiskIm~1\disk1\*.* $(DESTDIR)\WinInstall	
	copy AFS_component_version_number.txt $(DESTDIR)\WinInstall\Version.txt
	$(DEL) /q "Media\OpenAFS\Disk Images\disk1\*.*"
install: prep build

mkdir:
