-;OpenAFS Install Script for NSIS
-; This version compiles with NSIS v2.0
+; OpenAFS Install Script for NSIS
+; This version compiles with NSIS v2.07
;
; Originally written by Rob Murawski <rsm4@ieee.org>
;
VIAddVersionKey "ProductVersion" ${AFS_VERSION}
VIAddVersionKey "FileVersion" ${AFS_VERSION}
VIAddVersionKey "FileDescription" "OpenAFS for Windows Installer"
-VIAddVersionKey "LegalCopyright" "(C)2000-2004"
+VIAddVersionKey "LegalCopyright" "(C)2000-2005"
!ifdef DEBUG
VIAddVersionKey "PrivateBuild" "Checked/Debug"
!endif ; End DEBUG
!define REPLACEDLL_NOREGISTER
;General
+!ifndef AFSIFS
!ifndef DEBUG
OutFile "${AFS_DESTDIR}\WinInstall\OpenAFSforWindows.exe"
!else
OutFile "${AFS_DESTDIR}\WinInstall\OpenAFSforWindows-DEBUG.exe"
!endif
+!else
+!ifndef DEBUG
+ OutFile "${AFS_DESTDIR}\WinInstall\OpenAFSforWindows-IFS.exe"
+!else
+ OutFile "${AFS_DESTDIR}\WinInstall\OpenAFSforWindows-IFS-DEBUG.exe"
+!endif
+!endif
SilentInstall normal
- SetCompressor lzma
+ SetCompressor /solid lzma
!define MUI_ICON "..\..\client_config\afs_config.ico"
!define MUI_UNICON "..\..\client_config\afs_config.ico"
!define AFS_COMPANY_NAME "OpenAFS"
var REG_DATA_1
var REG_DATA_2
var REG_DATA_3
+var REG_DATA_4
;--------------------------------
;----------------------
; OpenAFS CLIENT
-Section "AFS Client" secClient
+Section "!AFS Client" secClient
SetShellVarContext all
File "${AFS_CLIENT_BUILDDIR}\tokens.exe"
File "${AFS_CLIENT_BUILDDIR}\unlog.exe"
File "${AFS_CLIENT_BUILDDIR}\fs.exe"
+ File "${AFS_CLIENT_BUILDDIR}\afsdacl.exe"
+ File "${AFS_CLIENT_BUILDDIR}\cmdebug.exe"
File "${AFS_CLIENT_BUILDDIR}\aklog.exe"
File "${AFS_CLIENT_BUILDDIR}\afscreds.exe"
!insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext.dll" "$INSTDIR\Client\Program\afs_shl_ext.dll" "$INSTDIR"
SetOutPath "$SYSDIR"
!insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afslogon.dll" "$SYSDIR\afslogon.dll" "$INSTDIR"
+ File "${AFS_CLIENT_BUILDDIR}\afscpcc.exe"
+!ifdef AFSIFS
+!ifndef DEBUG
+ !insertmacro ReplaceDLL "..\..\afsrdr\objfre_w2K_x86\i386\afsrdr.sys" "$SYSDIR\DRIVERS\afsrdr.sys" "$INSTDIR"
+!else
+ !insertmacro ReplaceDLL "..\..\afsrdr\objchk_w2K_x86\i386\afsrdr.sys" "$SYSDIR\DRIVERS\afsrdr.sys" "$INSTDIR"
+!endif
+!endif
Call AFSLangFiles
SetOutPath "$INSTDIR\Common"
File "${AFS_WININSTALL_DIR}\Service.exe"
nsExec::Exec "net stop TransarcAFSDaemon"
+ nsExec::Exec "net stop AfsRdr"
;IMPORTANT! If we are not refreshing the config files, do NOT remove the service
;Don't re-install because it must be present or we wouldn't have passed the Reg check
StrCmp $R2 "" +1 skipremove
nsExec::Exec '$INSTDIR\Common\Service.exe u TransarcAFSDaemon'
nsExec::Exec '$INSTDIR\Common\Service.exe TransarcAFSDaemon "$INSTDIR\Client\Program\afsd_service.exe" "OpenAFS Client Service"'
+ nsExec::Exec '$INSTDIR\Common\Service.exe u AfsRdr'
+!ifdef AFSIFS
+ nsExec::Exec '$INSTDIR\Common\Service.exe AfsRdr "$SYSDIR\DRIVERS\afsrdr.sys" "AFS Redirector"'
+!endif
skipremove:
Delete "$INSTDIR\Common\service.exe"
strcpy $REG_DATA_1 "PNP_TDI"
strcpy $REG_DATA_2 ""
strcpy $REG_DATA_3 ""
+ strcpy $REG_DATA_4 ""
Call RegWriteMultiStr
strcpy $REG_SUB_KEY "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon"
strcpy $REG_VALUE "DependOnService"
strcpy $REG_DATA_1 "Tcpip"
strcpy $REG_DATA_2 "NETBIOS"
strcpy $REG_DATA_3 "RpcSs"
+!ifdef AFSIFS
+ strcpy $REG_DATA_4 "AfsRdr"
+!else
+ strcpy $REG_DATA_4 ""
+!endif
+ Call RegWriteMultiStr
+!ifdef AFSIFS
+ strcpy $REG_SUB_KEY "SYSTEM\CurrentControlSet\Services\AfsRdr"
+ strcpy $REG_VALUE "DependOnService"
+ strcpy $REG_DATA_1 "Tcpip"
+ strcpy $REG_DATA_2 ""
+ strcpy $REG_DATA_3 ""
+ strcpy $REG_DATA_4 ""
Call RegWriteMultiStr
+!endif
; WinLogon Event Notification
WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "Asynchronous" 0
WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "Impersonate" 1
WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "DLLName" "afslogon.dll"
+ WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "Logon" "AFS_Logon_Event"
WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "Logoff" "AFS_Logoff_Event"
WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "Startup" "AFS_Startup_Event"
+ WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\KFWLogon" "Asynchronous" 0
+ WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\KFWLogon" "Impersonate" 0
+ WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\KFWLogon" "DLLName" "afslogon.dll"
+ WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\KFWLogon" "Logon" "KFW_Logon_Event"
+
SetRebootFlag true
WriteUninstaller "$INSTDIR\Uninstall.exe"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayIcon" "$INSTDIR\Uninstall.exe,0"
+ Call CreateDesktopIni
SectionEnd
; MS Loopback adapter
-Section "MS Loopback Adapter" secLoopback
+Section "!MS Loopback Adapter" secLoopback
Call afs.InstallMSLoopback
;------------------------
; OpenAFS SERVER
-Section "AFS Server" secServer
+Section /o "AFS Server" secServer
SetShellVarContext all
SetOutPath "$INSTDIR\Server\usr\afs\bin"
File "${AFS_SERVER_BUILDDIR}\afskill.exe"
File "${AFS_SERVER_BUILDDIR}\afssvrcfg.exe"
+ File "${AFS_SERVER_BUILDDIR}\asetkey.exe"
File "${AFS_SERVER_BUILDDIR}\bosctlsvc.exe"
File "${AFS_SERVER_BUILDDIR}\bosserver.exe"
File "${AFS_SERVER_BUILDDIR}\buserver.exe"
WriteUninstaller "$INSTDIR\Uninstall.exe"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayIcon" "$INSTDIR\Uninstall.exe,0"
SectionEnd
;----------------------------
; OpenAFS Control Center
-Section "AFS Control Center" secControl
+Section /o "AFS Control Center" secControl
SetShellVarContext all
CreateShortCut "$SMPROGRAMS\OpenAFS\Control Center\Server Manager.lnk" "$INSTDIR\Control Center\TaAfsServerManager.exe"
WriteUninstaller "$INSTDIR\Uninstall.exe"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayIcon" "$INSTDIR\Uninstall.exe,0"
SectionEnd
;----------------------------
; OpenAFS Supplemental Documentation
-Section "Supplemental Documentation" secDocs
+Section /o "Supplemental Documentation" secDocs
SetShellVarContext all
StrCmp $LANGUAGE ${LANG_ENGLISH} DoEnglish
WriteUninstaller "$INSTDIR\Uninstall.exe"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayIcon" "$INSTDIR\Uninstall.exe,0"
CreateShortCut "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk" "$INSTDIR\Uninstall.exe"
Call AFSCommon.Install
SectionEnd
-Section "Software Development Kit (SDK)" secSDK
+Section /o "Software Development Kit (SDK)" secSDK
SetOutPath "$INSTDIR\Client\Program\lib"
File /r "${AFS_CLIENT_LIBDIR}\*.*"
WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL}
WriteUninstaller "$INSTDIR\Uninstall.exe"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayIcon" "$INSTDIR\Uninstall.exe,0"
+
SetOutPath "$SMPROGRAMS\OpenAFS"
CreateShortCut "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk" "$INSTDIR\Uninstall.exe"
- Call AFSCommon.Install
+ Call AFSCommon.Install
SectionEnd
-Section "Debug symbols" secDebug
- SectionGetFlags ${secClient} $R0
+Section /o "Debug symbols" secDebug
+ SectionGetFlags ${secClient} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} +1 DoServer
File "${AFS_CLIENT_BUILDDIR}\tokens.pdb"
File "${AFS_CLIENT_BUILDDIR}\unlog.pdb"
File "${AFS_CLIENT_BUILDDIR}\fs.pdb"
+ File "${AFS_CLIENT_BUILDDIR}\afsdacl.pdb"
+ File "${AFS_CLIENT_BUILDDIR}\cmdebug.pdb"
File "${AFS_CLIENT_BUILDDIR}\aklog.pdb"
File "${AFS_CLIENT_BUILDDIR}\afscreds.pdb"
File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext.pdb"
File "${AFS_CLIENT_BUILDDIR}\afslogon.pdb"
DoServer:
- SectionGetFlags ${secServer} $R0
+ SectionGetFlags ${secServer} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} +1 DoControl
SetOutPath "$INSTDIR\Server\usr\afs\bin"
File "${AFS_SERVER_BUILDDIR}\afskill.pdb"
File "${AFS_SERVER_BUILDDIR}\afssvrcfg.pdb"
+ File "${AFS_SERVER_BUILDDIR}\asetkey.pdb"
File "${AFS_SERVER_BUILDDIR}\bosctlsvc.pdb"
File "${AFS_SERVER_BUILDDIR}\bosserver.pdb"
File "${AFS_SERVER_BUILDDIR}\buserver.pdb"
; Do control center components
DoControl:
- SectionGetFlags ${secControl} $R0
+ SectionGetFlags ${secControl} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} +1 DoCommon
contInstall:
+ ; Set Install Type text
+ InstTypeSetText 0 "AFS Client"
+ InstTypeSetText 1 "AFS Administrator"
+ InstTypeSetText 2 "AFS Server"
+ InstTypeSetText 3 "AFS Developer Tools"
+
+ ; Set sections in each install type
+ SectionSetInstTypes 0 15 ; AFS Client
+ SectionSetInstTypes 1 15 ; Loopback adapter
+ SectionSetInstTypes 2 4 ; AFS Server
+ SectionSetInstTypes 3 6 ; AFS Control Center
+ SectionSetInstTypes 4 14 ; Documentation
+ SectionSetInstTypes 5 8 ; SDK
+!ifndef DEBUG
+ SectionSetInstTypes 6 8 ; Debug symbols
+!else
+ SectionSetInstTypes 6 15 ; Debug symbols
+!endif
+
; Check that RPC functions are installed (I believe any one of these can be present for
; OpenAFS to work)
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncacn_np"
contInstall2:
-DoLoop:
; If the Loopback is already installed, we mark the option OFF and Read Only
; so the user can not select it.
Call afs.isLoopbackInstalled
IntOp $0 $0 & ${SECTION_OFF}
IntOp $0 $0 | ${SF_RO}
SectionSetFlags ${secLoopback} $0
+ ; And disable the loopback in the types
+ SectionSetInstTypes 1 0 ; Loopback adapter
SkipLoop:
; Never install debug symbols unless explicitly selected, except in DEBUG mode
StrCmp $R2 "2" UpgradeServer
StrCmp $R2 "3" DowngradeServer
- SectionGetFlags ${secServer} $0
- IntOp $0 $0 | ${SF_SELECTED}
- SectionSetFlags ${secServer} $0
- ;# !insertmacro UnselectSection ${secServer}
+ SectionGetFlags ${secServer} $0
+ IntOp $0 $0 | ${SF_SELECTED}
+ SectionSetFlags ${secServer} $0
+ ;# !insertmacro UnselectSection ${secServer}
goto skipServer
UpgradeServer:
goto skipServer
NoServer:
- SectionGetFlags ${secServer} $0
- IntOp $0 $0 & ${SECTION_OFF}
- SectionSetFlags ${secServer} $0
- ;# !insertmacro UnselectSection ${secServer}
+ SectionGetFlags ${secServer} $0
+ IntOp $0 $0 & ${SECTION_OFF}
+ SectionSetFlags ${secServer} $0
+ ;# !insertmacro UnselectSection ${secServer}
goto skipServer
skipServer:
Pop $R2
StrCmp $R2 "0" NoControl
- SectionGetFlags ${secControl} $0
- IntOp $0 $0 | ${SF_SELECTED}
- SectionSetFlags ${secControl} $0
+ SectionGetFlags ${secControl} $0
+ IntOp $0 $0 | ${SF_SELECTED}
+ SectionSetFlags ${secControl} $0
goto CheckDocs
NoControl:
- SectionGetFlags ${secControl} $0
- IntOp $0 $0 & ${SECTION_OFF}
- SectionSetFlags ${secControl} $0
- ;# !insertmacro UnselectSection ${secControl}
+ SectionGetFlags ${secControl} $0
+ IntOp $0 $0 & ${SECTION_OFF}
+ SectionSetFlags ${secControl} $0
+ ;# !insertmacro UnselectSection ${secControl}
CheckDocs:
; Check Documentation
Call IsDocumentationInstalled
Pop $R2
StrCmp $R2 "0" NoDocs
- SectionGetFlags ${secDocs} $0
- IntOp $0 $0 | ${SF_SELECTED}
- SectionSetFlags ${secDocs} $0
+ SectionGetFlags ${secDocs} $0
+ IntOp $0 $0 | ${SF_SELECTED}
+ SectionSetFlags ${secDocs} $0
goto CheckSDK
NoDocs:
- SectionGetFlags ${secDocs} $0
- IntOp $0 $0 & ${SECTION_OFF}
- SectionSetFlags ${secDocs} $0
+ SectionGetFlags ${secDocs} $0
+ IntOp $0 $0 & ${SECTION_OFF}
+ SectionSetFlags ${secDocs} $0
goto CheckSDK
; To check the SDK, we simply look to see if the files exist. If they do,
DefaultOptions:
; Client Selected
- SectionGetFlags ${secClient} $0
- IntOp $0 $0 | ${SF_SELECTED}
- SectionSetFlags ${secClient} $0
+ SectionGetFlags ${secClient} $0
+ IntOp $0 $0 | ${SF_SELECTED}
+ SectionSetFlags ${secClient} $0
; Server NOT selected
- SectionGetFlags ${secServer} $0
- IntOp $0 $0 & ${SECTION_OFF}
- SectionSetFlags ${secServer} $0
+ SectionGetFlags ${secServer} $0
+ IntOp $0 $0 & ${SECTION_OFF}
+ SectionSetFlags ${secServer} $0
; Control Center NOT selected
- SectionGetFlags ${secControl} $0
- IntOp $0 $0 & ${SECTION_OFF}
- SectionSetFlags ${secControl} $0
- ;# !insertmacro UnselectSection ${secControl}
+ SectionGetFlags ${secControl} $0
+ IntOp $0 $0 & ${SECTION_OFF}
+ SectionSetFlags ${secControl} $0
+ ;# !insertmacro UnselectSection ${secControl}
- ; Documentation selected
- SectionGetFlags ${secDocs} $0
- IntOp $0 $0 | ${SF_SELECTED}
- SectionSetFlags ${secDocs} $0
- ;# !insertmacro UnselectSection ${secDocs}
+ ; Documentation NOT selected
+ SectionGetFlags ${secDocs} $0
+ IntOp $0 $0 & ${SECTION_OFF}
+ SectionSetFlags ${secDocs} $0
+ ;# !insertmacro UnselectSection ${secDocs}
; SDK not selected
SectionGetFlags ${secSDK} $0
goto end
end:
- Pop $0
+ Pop $0
Push $R0
FunctionEnd
-
-
-
;--------------------------------
; These are our cleanup functions
Function .onInstFailed
IfSilent SkipDel
; IfFileExists "$INSTDIR\Client\CellServDB" CellExists SkipDelAsk
; CellExists:
- MessageBox MB_YESNO "Would you like to keep your configuration files?" IDYES SkipDel
+ MessageBox MB_YESNO "Would you like to keep your configuration information?" IDYES SkipDel
Delete "$INSTDIR\Client\CellServDB"
; Only remove krb5.ini if KfW was installed
Delete /REBOOTOK "$SYSDIR\afsserver.cpl"
Delete /REBOOTOK "$SYSDIR\afs_cpa.cpl"
Delete /REBOOTOK "$SYSDIR\afslogon.dll"
+ Delete /REBOOTOK "$SYSDIR\afscpcc.exe"
Delete /REBOOTOK "$SYSDIR\afsserver.pdb"
Delete /REBOOTOK "$SYSDIR\afs_cpa.pdb"
Delete /REBOOTOK "$SYSDIR\afslogon.pdb"
+ Delete /REBOOTOK "$SYSDIR\afscpcc.pdb"
RMDir /r "$INSTDIR\Documentation\html\CmdRef"
RMDir /r "$INSTDIR\Documentation\html\InstallGd"
FunctionEnd
+!ifdef USE_GETPARAMETERS
; GetParameters
; input, none
; output, top of stack (replaces, with e.g. whatever)
Pop $R1
Exch $R0
FunctionEnd
+!endif
;Check to see if any AFS component is installed
System::Call "*$2(&t$9 '$REG_DATA_3')" ; Place the string
IntOp $2 $2 + $9 ; Advance to the next position
+ StrCmp '$REG_DATA_4' "" terminate
+ StrLen $9 '$REG_DATA_4' ; Length of third string
+ IntOp $9 $9 + 1 ; Plus null
+ System::Call "*$2(&t$9 '$REG_DATA_4')" ; Place the string
+ IntOp $2 $2 + $9 ; Advance to the next position
+
terminate:
System::Call "*$2(&t1 '')" ; Place the terminating null
IntOp $2 $2 + 1 ; Advance to the next position
Pop $2
Pop $1
Exch $R0
-FunctionEnd
\ No newline at end of file
+FunctionEnd
+
+Function CreateDesktopIni
+ WriteIniStr "$INSTDIR\Desktop.ini" ".ShellClassInfo" "IconFile" "client\program\afsd_service.exe"
+ WriteIniStr "$INSTDIR\Desktop.ini" ".ShellClassInfo" "IconIndex" "0"
+ SetFileAttributes "$INSTDIR\Desktop.ini" HIDDEN|SYSTEM
+ SetFileAttributes "$INSTDIR\" READONLY
+FunctionEnd