nsis-do-not-install-sdk-with-client-20040101
[openafs.git] / src / WINNT / install / NSIS / OpenAFS.nsi
index 6f095af..67a7012 100644 (file)
@@ -7,10 +7,37 @@
 ;MultiLanguage Example Script
 ;Written by Joost Verburg
 
-!define MUI_PRODUCT "OpenAFS" ;Define your own software name here
-!include nsi-includes.nsi
+; Read in the environment information
+!include ${INCLUDEDIR}\nsi-includes.nsi
 ; Define DEBUG if building a DEBUG installer
-;!define DEBUG 1
+
+; This version compiles with NSIS v2.0b3 or NSIS v2.0b4
+
+!ifdef v2.0b3       ; v2.0b3
+!ifndef DEBUG        ; !DEBUG
+!define MUI_PRODUCT "OpenAFS" ;Define your own software name here
+!else                ; DEBUG on v2.0b3
+!define MUI_PRODUCT "OpenAFS Checked/Debug"
+!endif               ; End DEBUG
+!define MUI_VERSION ${AFS_VERSION}
+!else                ; v2.0b4
+!ifndef DEBUG        ; !DEBUG on v2.0b4
+Name "OpenAFS ${AFS_VERSION} ${__DATE__} ${__TIME__}"
+!else                ; DEBUG on v2.0b4
+Name "OpenAFS ${AFS_VERSION} ${__DATE__} ${__TIME__} Checked/Debug"
+!endif               ; End DEBUG/!DEBUG
+VIProductVersion "${AFS_VERSION}.00"
+VIAddVersionKey "ProductName" "OpenAFS"
+VIAddVersionKey "CompanyName" "OpenAFS.org"
+VIAddVersionKey "ProductVersion" ${AFS_VERSION}
+VIAddVersionKey "FileVersion" ${AFS_VERSION}
+VIAddVersionKey "FileDescription" "OpenAFS for Windows Installer"
+VIAddVersionKey "LegalCopyright" "(C)2003"
+!ifdef DEBUG
+VIAddVersionKey "PrivateBuild" "Checked/Debug"
+!endif               ; End DEBUG
+!endif               ; End v2.0b4
+
 
 !include "MUI.nsh"
 !include Sections.nsh
 
   ;General
 !ifndef DEBUG
-  OutFile "OpenAFSforWindows.exe"
+  OutFile "${AFS_DESTDIR}\WinInstall\OpenAFSforWindows.exe"
 !else
-  OutFile "OpenAFSforWindows-DEBUG.exe"
+  OutFile "${AFS_DESTDIR}\WinInstall\OpenAFSforWindows-DEBUG.exe"
 !endif
   SilentInstall normal
   SetCompressor bzip2
   !define MUI_ICON "..\..\client_config\afs_config.ico"
-  !define MUI_UNICON "c:\Program Files\NSIS\Contrib\Icons\normal-uninstall.ico"
+  !ifdef v2.0b3
+  !define MUI_UNICON "${NSISDIR}\Contrib\Icons\normal-uninstall.ico"
+  !else
+  !define MUI_UNICON "..\..\client_config\afs_config.ico"
+  !endif
   !define AFS_COMPANY_NAME "OpenAFS"
   !define AFS_PRODUCT_NAME "OpenAFS"
   !define AFS_REGKEY_ROOT "Software\TransarcCorporation"
   CRCCheck force
 
   ;Folder selection page
-  InstallDir "$PROGRAMFILES\OpenAFS\AFS"
+  InstallDir "$PROGRAMFILES\OpenAFS"      ; Install to shorter path
   
   ;Remember install folder
-  InstallDirRegKey HKCU "Software\TransarcCorporation" ""
+  InstallDirRegKey HKCU ${AFS_REGKEY_ROOT} ""
   
   ;Remember the installer language
   !define MUI_LANGDLL_REGISTRY_ROOT "HKCU" 
-  !define MUI_LANGDLL_REGISTRY_KEY "Software\TransarcCorporation" 
+  !define MUI_LANGDLL_REGISTRY_KEY ${AFS_REGKEY_ROOT}
   !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
   
   ;Where are the files?
   
   !define MUI_UNINSTALLER
   !define MUI_UNCONFIRMPAGE
-
   
+  
+!IFDEF v2.0b3       ; v2.0b3
   !insertmacro MUI_PAGECOMMAND_WELCOME
-  ;!insertmacro MUI_PAGECOMMAND_LICENSE
+ ;!insertmacro MUI_PAGECOMMAND_LICENSE
   !insertmacro MUI_PAGECOMMAND_COMPONENTS
   !insertmacro MUI_PAGECOMMAND_DIRECTORY
   Page custom AFSPageGetCellServDB
   Page custom AFSPageGetCellName
-  ;Page custom AFSPageGetConfigURL
   !insertmacro MUI_PAGECOMMAND_INSTFILES
   !insertmacro MUI_PAGECOMMAND_FINISH
+!ELSE                ; v2.0b4
+  !insertmacro MUI_PAGE_WELCOME
+  !insertmacro MUI_PAGE_COMPONENTS
+  !insertmacro MUI_PAGE_DIRECTORY
+  Page custom AFSPageGetCellServDB
+  Page custom AFSPageGetCellName
+  !insertmacro MUI_PAGE_INSTFILES
+  !insertmacro MUI_PAGE_FINISH
+!ENDIF
   
   ;LicenseData "Licenses.rtf"
 ;--------------------------------
   !insertmacro MUI_LANGUAGE "SimpChinese"
   !insertmacro MUI_LANGUAGE "TradChinese"    
   !insertmacro MUI_LANGUAGE "Japanese"
-  ;!insertmacro MUI_LANGUAGE "Korean"
+  !ifndef v2.0b3
+  !insertmacro MUI_LANGUAGE "Korean"
+  !endif
   ;!insertmacro MUI_LANGUAGE "Italian"
   ;!insertmacro MUI_LANGUAGE "Dutch"
   ;!insertmacro MUI_LANGUAGE "Danish"
   LangString DESC_SecCopyUI ${LANG_SIMPCHINESE} "OpenAFS for Windows: Simplified Chinese"
   LangString DESC_SecCopyUI ${LANG_TRADCHINESE} "OpenAFS for Windows: Traditional Chinese description"
   LangString DESC_SecCopyUI ${LANG_JAPANESE} "OpenAFS for Windows: Japanese description"
-  ;LangString DESC_SecCopyUI ${LANG_KOREAN} "OpenAFS for Windows: Korean description"
+!ifndef v2.0b3
+  LangString DESC_SecCopyUI ${LANG_KOREAN} "OpenAFS for Windows: Korean description"
+!endif
   ;LangString DESC_SecCopyUI ${LANG_ITALIAN} "OpenAFS for Windows: Italian description"
   ;LangString DESC_SecCopyUI ${LANG_DUTCH} "OpenAFS for Windows: Dutch description"
   ;LangString DESC_SecCopyUI ${LANG_DANISH} "OpenAFS for Windows: Danish description"
   ;LangString DESC_SecCopyUI ${LANG_MACEDONIAN} "OpenAFS for Windows: Macedonian description"
   ;LangString DESC_SecCopyUI ${LANG_TURKISH} "OpenAFS for Windows: Turkish description"
 
-  LangString DESC_SecClient ${LANG_ENGLISH} "OpenAFS Client: Allows you to access AFS from your Windows PC."
-  LangString DESC_SecClient ${LANG_GERMAN} "OpenAFS Client: Allows you to access AFS from your Windows PC."
-  LangString DESC_SecClient ${LANG_SPANISH} "OpenAFS Client: Allows you to access AFS from your Windows PC."
-  LangString DESC_SecClient ${LANG_SIMPCHINESE} "OpenAFS Client: Allows you to access AFS from your Windows PC."
-  LangString DESC_SecClient ${LANG_TRADCHINESE} "OpenAFS Client: Allows you to access AFS from your Windows PC."
-  LangString DESC_SecClient ${LANG_JAPANESE} "OpenAFS Client: Allows you to access AFS from your Windows PC."
-  ;LangString DESC_SecClient ${LANG_KOREAN} "OpenAFS Client: Allows you to access AFS from your Windows PC."
-  LangString DESC_SecClient ${LANG_PORTUGUESEBR} "OpenAFS Client: Allows you to access AFS from your Windows PC."
-  
-  LangString DESC_SecServer ${LANG_ENGLISH} "OpenAFS Server: Allows you to run an AFS file server."
-  LangString DESC_SecServer ${LANG_GERMAN} "OpenAFS Server: Allows you to run an AFS file server."
-  LangString DESC_SecServer ${LANG_SPANISH} "OpenAFS Server: Allows you to run an AFS file server."
-  LangString DESC_SecServer ${LANG_SIMPCHINESE} "OpenAFS Server: Allows you to run an AFS file server."
-  LangString DESC_SecServer ${LANG_TRADCHINESE} "OpenAFS Server: Allows you to run an AFS file server."
-  LangString DESC_SecServer ${LANG_JAPANESE} "OpenAFS Server: Allows you to run an AFS file server."
-  ;LangString DESC_SecServer ${LANG_KOREAN} "OpenAFS Server: Allows you to run an AFS file server."
-  LangString DESC_SecServer ${LANG_PORTUGUESEBR} "OpenAFS Server: Allows you to run an AFS file server."
-  
-  LangString DESC_SecControl ${LANG_ENGLISH} "OpenAFS Control Center: GUI utilities for managing and configuring AFS."
-  LangString DESC_SecControl ${LANG_GERMAN} "OpenAFS Control Center: GUI utilities for managing and configuring AFS."
-  LangString DESC_SecControl ${LANG_SPANISH} "OpenAFS Control Center: GUI utilities for managing and configuring AFS."
-  LangString DESC_SecControl ${LANG_SIMPCHINESE} "OpenAFS Control Center: GUI utilities for managing and configuring AFS."
-  LangString DESC_SecControl ${LANG_TRADCHINESE} "OpenAFS Control Center: GUI utilities for managing and configuring AFS."
-  LangString DESC_SecControl ${LANG_JAPANESE} "OpenAFS Control Center: GUI utilities for managing and configuring AFS."
-  ;LangString DESC_SecControl ${LANG_KOREAN} "OpenAFS Control Center: GUI utilities for managing and configuring AFS."
-  LangString DESC_SecControl ${LANG_PORTUGUESEBR} "OpenAFS Control Center: GUI utilities for managing and configuring AFS."
-  
-  LangString DESC_SecDocs ${LANG_ENGLISH} "Supplemental Documentation: Additional documentation for using OpenAFS."
-  LangString DESC_SecDocs ${LANG_GERMAN} "OpenAFS Supplemental Documentation: Additional documentation for using OpenAFS."
-  LangString DESC_SecDocs ${LANG_SPANISH} "OpenAFS Supplemental Documentation: Additional documentation for using OpenAFS."
-  LangString DESC_SecDocs ${LANG_SIMPCHINESE} "OpenAFS Supplemental Documentation: Additional documentation for using OpenAFS."
-  LangString DESC_SecDocs ${LANG_TRADCHINESE} "OpenAFS Supplemental Documentation: Additional documentation for using OpenAFS."
-  LangString DESC_SecDocs ${LANG_JAPANESE} "OpenAFS Supplemental Documentation: Additional documentation for using OpenAFS."
-  ;LangString DESC_SecDocs ${LANG_KOREAN} "OpenAFS Supplemental Documentation: Additional documentation for using OpenAFS."
-  LangString DESC_SecDocs ${LANG_PORTUGUESEBR} "OpenAFS Supplemental Documentation: Additional documentation for using OpenAFS."
+  LangString DESC_secClient ${LANG_ENGLISH} "OpenAFS Client: Allows you to access AFS from your Windows PC."
+  LangString DESC_secClient ${LANG_GERMAN} "OpenAFS Client: Allows you to access AFS from your Windows PC."
+  LangString DESC_secClient ${LANG_SPANISH} "OpenAFS Client: Allows you to access AFS from your Windows PC."
+  LangString DESC_secClient ${LANG_SIMPCHINESE} "OpenAFS Client: Allows you to access AFS from your Windows PC."
+  LangString DESC_secClient ${LANG_TRADCHINESE} "OpenAFS Client: Allows you to access AFS from your Windows PC."
+  LangString DESC_secClient ${LANG_JAPANESE} "OpenAFS Client: Allows you to access AFS from your Windows PC."
+!ifndef v2.0b3  
+  LangString DESC_secClient ${LANG_KOREAN} "OpenAFS Client: Allows you to access AFS from your Windows PC."
+!endif
+  LangString DESC_secClient ${LANG_PORTUGUESEBR} "OpenAFS Client: Allows you to access AFS from your Windows PC."
+  
+  LangString DESC_secServer ${LANG_ENGLISH} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client."
+  LangString DESC_secServer ${LANG_GERMAN} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client."
+  LangString DESC_secServer ${LANG_SPANISH} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client."
+  LangString DESC_secServer ${LANG_SIMPCHINESE} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client."
+  LangString DESC_secServer ${LANG_TRADCHINESE} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client."
+  LangString DESC_secServer ${LANG_JAPANESE} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client."
+!ifndef v2.0b3 
+  LangString DESC_secServer ${LANG_KOREAN} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client."
+!endif
+  LangString DESC_secServer ${LANG_PORTUGUESEBR} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client."
+  
+  LangString DESC_secControl ${LANG_ENGLISH} "Control Center: GUI utilities for managing and configuring AFS servers.  This option requires the AFS Client."
+  LangString DESC_secControl ${LANG_GERMAN} "Control Center: GUI utilities for managing and configuring AFS servers.  This option requires the AFS Client."
+  LangString DESC_secControl ${LANG_SPANISH} "Control Center: GUI utilities for managing and configuring AFS servers.  This option requires the AFS Client."
+  LangString DESC_secControl ${LANG_SIMPCHINESE} "Control Center: GUI utilities for managing and configuring AFS servers.  This option requires the AFS Client."
+  LangString DESC_secControl ${LANG_TRADCHINESE} "Control Center: GUI utilities for managing and configuring AFS servers.  This option requires the AFS Client."
+  LangString DESC_secControl ${LANG_JAPANESE} "Control Center: GUI utilities for managing and configuring AFS servers.  This option requires the AFS Client."
+!ifndef v2.0b3  
+  LangString DESC_secControl ${LANG_KOREAN} "Control Center: GUI utilities for managing and configuring AFS servers.  This option requires the AFS Client."
+!endif
+  LangString DESC_secControl ${LANG_PORTUGUESEBR} "Control Center: GUI utilities for managing and configuring AFS servers.  This option requires the AFS Client."
+  
+  LangString DESC_secDocs ${LANG_ENGLISH} "Supplemental Documentation: Additional documentation for using OpenAFS."
+  LangString DESC_secDocs ${LANG_GERMAN} "Supplemental Documentation: Additional documentation for using OpenAFS."
+  LangString DESC_secDocs ${LANG_SPANISH} "Supplemental Documentation: Additional documentation for using OpenAFS."
+  LangString DESC_secDocs ${LANG_SIMPCHINESE} "Supplemental Documentation: Additional documentation for using OpenAFS."
+  LangString DESC_secDocs ${LANG_TRADCHINESE} "Supplemental Documentation: Additional documentation for using OpenAFS."
+  LangString DESC_secDocs ${LANG_JAPANESE} "Supplemental Documentation: Additional documentation for using OpenAFS."
+!ifndef v2.0b3  
+  LangString DESC_secDocs ${LANG_KOREAN} "Supplemental Documentation: Additional documentation for using OpenAFS."
+!endif
+  LangString DESC_secDocs ${LANG_PORTUGUESEBR} "Supplemental Documentation: Additional documentation for using OpenAFS."
+  
+  LangString DESC_secSDK ${LANG_ENGLISH} "SDK: Header files and libraries for developing software with OpenAFS."
+  LangString DESC_secSDK ${LANG_GERMAN} "SDK: Header files and libraries for developing software with OpenAFS."
+  LangString DESC_secSDK ${LANG_SPANISH} "SDK: Header files and libraries for developing software with OpenAFS."
+  LangString DESC_secSDK ${LANG_SIMPCHINESE} "SDK: Header files and libraries for developing software with OpenAFS."
+  LangString DESC_secSDK ${LANG_TRADCHINESE} "SDK: Header files and libraries for developing software with OpenAFS."
+  LangString DESC_secSDK ${LANG_JAPANESE} "SDK: Header files and libraries for developing software with OpenAFS."
+!ifndef v2.0b3
+  LangString DESC_secSDK ${LANG_KOREAN} "SDK: Header files and libraries for developing software with OpenAFS."
+!endif
+  LangString DESC_secSDK ${LANG_PORTUGUESEBR} "SDK: Header files and libraries for developing software with OpenAFS."
   
 ; Popup error messages
   LangString CellError ${LANG_ENGLISH} "You must specify a valid CellServDB file to copy during install"
   LangString CellError ${LANG_SIMPCHINESE} "You must specify a valid CellServDB file to copy during the install"
   LangString CellError ${LANG_TRADCHINESE} "You must specify a valid CellServDB file to copy during the install"
   LangString CellError ${LANG_JAPANESE} "You must specify a valid CellServDB file to copy during the install"
-  ;LangString CellError ${LANG_KOREAN} "You must specify a valid CellServDB file to copy during the install"
+!ifndef v2.0b3  
+  LangString CellError ${LANG_KOREAN} "You must specify a valid CellServDB file to copy during the install"
+!endif
   LangString CellError ${LANG_PORTUGUESEBR} "You must specify a valid CellServDB file to copy during the install"
   
+  LangString CellNameError ${LANG_ENGLISH} "You must specify a cell name for your client to use."
+  LangString CellNameError ${LANG_GERMAN} "You must specify a cell name for your client to use."
+  LangString CellNameError ${LANG_SPANISH} "You must specify a cell name for your client to use."
+  LangString CellNameError ${LANG_SIMPCHINESE} "You must specify a cell name for your client to use."
+  LangString CellNameError ${LANG_TRADCHINESE} "You must specify a cell name for your client to use."
+  LangString CellNameError ${LANG_JAPANESE} "You must specify a cell name for your client to use."
+!ifndef v2.0b3
+  LangString CellNameError ${LANG_KOREAN} "You must specify a cell name for your client to use."
+!endif
+  LangString CellNameError ${LANG_PORTUGUESEBR} "You must specify a cell name for your client to use."
+  
+  LangString URLError ${LANG_ENGLISH} "You must specify a URL if you choose the option to download the CellServDB."
+  LangString URLError ${LANG_GERMAN} "You must specify a URL if you choose the option to download the CellServDB."
+  LangString URLError ${LANG_SPANISH} "You must specify a URL if you choose the option to download the CellServDB."
+  LangString URLError ${LANG_SIMPCHINESE} "You must specify a URL if you choose the option to download the CellServDB."
+  LangString URLError ${LANG_TRADCHINESE} "You must specify a URL if you choose the option to download the CellServDB."
+  LangString URLError ${LANG_JAPANESE} "You must specify a URL if you choose the option to download the CellServDB."
+!ifndef v2.0b3
+  LangString URLError ${LANG_KOREAN} "You must specify a URL if you choose the option to download the CellServDB."
+!endif
+  LangString URLError ${LANG_PORTUGUESEBR} "You must specify a URL if you choose the option to download the CellServDB."
+
   
 ; Upgrade/re-install strings
    LangString UPGRADE_CLIENT ${LANG_ENGLISH} "Upgrade AFS Client"
    LangString UPGRADE_CLIENT ${LANG_SIMPCHINESE} "Upgrade AFS Client"
    LangString UPGRADE_CLIENT ${LANG_TRADCHINESE} "Upgrade AFS Client"
    LangString UPGRADE_CLIENT ${LANG_JAPANESE} "Upgrade AFS Client"
-   ;LangString UPGRADE_CLIENT ${LANG_KOREAN} "Upgrade AFS Client"
+!ifndef v2.0b3
+   LangString UPGRADE_CLIENT ${LANG_KOREAN} "Upgrade AFS Client"
+!endif
    LangString UPGRADE_CLIENT ${LANG_PORTUGUESEBR} "Upgrade AFS Client"
-   
-   
+   LangString REINSTALL_CLIENT ${LANG_ENGLISH} "Re-install AFS Client"
+   LangString REINSTALL_CLIENT ${LANG_GERMAN} "Re-install AFS Client"
+   LangString REINSTALL_CLIENT ${LANG_SPANISH} "Re-install AFS Client"
+   LangString REINSTALL_CLIENT ${LANG_SIMPCHINESE} "Re-install AFS Client"
+   LangString REINSTALL_CLIENT ${LANG_TRADCHINESE} "Re-install AFS Client"
+   LangString REINSTALL_CLIENT ${LANG_JAPANESE} "Re-install AFS Client"
+!ifndef v2.0b3
+   LangString REINSTALL_CLIENT ${LANG_KOREAN} "Re-install AFS Client"
+!endif
+   LangString REINSTALL_CLIENT ${LANG_PORTUGUESEBR} "Re-install AFS Client"
+  
+   LangString UPGRADE_SERVER ${LANG_ENGLISH} "Upgrade AFS Server"
+   LangString UPGRADE_SERVER ${LANG_GERMAN} "Upgrade AFS Server"
+   LangString UPGRADE_SERVER ${LANG_SPANISH} "Upgrade AFS Server"
+   LangString UPGRADE_SERVER ${LANG_SIMPCHINESE} "Upgrade AFS Server"
+   LangString UPGRADE_SERVER ${LANG_TRADCHINESE} "Upgrade AFS Server"
+   LangString UPGRADE_SERVER ${LANG_JAPANESE} "Upgrade AFS Server"
+!ifndef v2.0b3
+   LangString UPGRADE_SERVER ${LANG_KOREAN} "Upgrade AFS Server"
+!endif
+   LangString UPGRADE_SERVER ${LANG_PORTUGUESEBR} "Upgrade AFS Server"
+    
    LangString REINSTALL_SERVER ${LANG_ENGLISH} "Re-install AFS Server"
    LangString REINSTALL_SERVER ${LANG_GERMAN} "Re-install AFS Server"
    LangString REINSTALL_SERVER ${LANG_SPANISH} "Re-install AFS Server"
    LangString REINSTALL_SERVER ${LANG_SIMPCHINESE} "Re-install AFS Server"
    LangString REINSTALL_SERVER ${LANG_TRADCHINESE} "Re-install AFS Server"
    LangString REINSTALL_SERVER ${LANG_JAPANESE} "Re-install AFS Server"
-   ;LangString REINSTALL_SERVER ${LANG_KOREAN} "Re-install AFS Server"
+!ifndef v2.0b3   
+   LangString REINSTALL_SERVER ${LANG_KOREAN} "Re-install AFS Server"
+!endif
    LangString REINSTALL_SERVER ${LANG_PORTUGUESEBR} "Re-install AFS Server"
   
+  ReserveFile "CellServPage.ini"
+  ReserveFile "AFSCell.ini"
+  !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions plug-in
+  !insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog
 ;--------------------------------
 ; Macros
 ; Macro - Upgrade DLL File
   ;Only useful for BZIP2 compression
   !insertmacro MUI_RESERVEFILE_LANGDLL
   
+
 ;--------------------------------
 ;Installer Sections
 
 ;----------------------
 ; OpenAFS CLIENT
-Section "AFS Client" SecClient
+Section "AFS Client" secClient
 
   SetShellVarContext all
+  ; Stop any running services or we can't replace the files
+  ; Stop the running processes
+  ;GetTempFileName $R0
+  ;File /oname=$R0 "${AFS_WININSTALL_DIR}\Killer.exe"   ; Might not have the MSVCR71.DLL file to run
+  ;nsExec::Exec '$R0 afscreds.exe'
+!IFDEF INSTALL_KFW
+  ;nsExec::Exec '$R0 krbcc32s.exe'
+!ENDIF
+
+  nsExec::Exec "net stop TransarcAFSDaemon"
+  nsExec::Exec "net stop TransarcAFSServer"
+  
    ; Do client components
   SetOutPath "$INSTDIR\Client\Program"
   File "${AFS_CLIENT_BUILDDIR}\afsshare.exe"
-  File "${AFS_BUILD_INCDIR}\afs\cm_config.h"
   File "${AFS_CLIENT_BUILDDIR}\libosi.dll"
-  File "${AFS_BUILD_INCDIR}\afs\kautils.h"
   File "${AFS_CLIENT_BUILDDIR}\libafsconf.dll"
   File "${AFS_CLIENT_BUILDDIR}\klog.exe"
   File "${AFS_CLIENT_BUILDDIR}\tokens.exe"
   File "${AFS_CLIENT_BUILDDIR}\unlog.exe"
   File "${AFS_CLIENT_BUILDDIR}\fs.exe"
-  File "${AFS_CLIENT_LIBDIR}\libafsconf.lib"
-  File "${AFS_CLIENT_LIBDIR}\afsauthent.lib"
   File "${AFS_CLIENT_BUILDDIR}\afscreds.exe"
   File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext.dll"
   File "${AFS_BUILD_INCDIR}\afs\auth.h"
@@ -393,212 +518,33 @@ Section "AFS Client" SecClient
   File "${AFS_DESTDIR}\etc\backup.pdb"
 !endif
 
-  ; Client_headers
-   SetOutPath "$INSTDIR\Client\Program\Include"
-   File "${AFS_BUILD_INCDIR}\lock.h"
-   File "${AFS_BUILD_INCDIR}\lwp.h"
-   File "${AFS_BUILD_INCDIR}\preempt.h"
-   File "${AFS_BUILD_INCDIR}\timer.h"
-   File "${AFS_BUILD_INCDIR}\des.h"
-   File "${AFS_BUILD_INCDIR}\des_conf.h"
-   File "${AFS_BUILD_INCDIR}\mit-cpyright.h"
-   ;File "${AFS_BUILD_INCDIR}\des-odd.h"
-   File "${AFS_BUILD_INCDIR}\crypt.h"
-   File "${AFS_BUILD_INCDIR}\pthread.h"
-   File "${AFS_BUILD_INCDIR}\dbrpc.h"
-   File "${AFS_BUILD_INCDIR}\basic.h"
-   File "${AFS_BUILD_INCDIR}\osidebug.h"
-   File "${AFS_BUILD_INCDIR}\osiltype.h"
-   File "${AFS_BUILD_INCDIR}\osistatl.h"
-   File "${AFS_BUILD_INCDIR}\trylock.h"
-   File "${AFS_BUILD_INCDIR}\main.h"
-   File "${AFS_BUILD_INCDIR}\osibasel.h"
-   File "${AFS_BUILD_INCDIR}\osifd.h"
-   File "${AFS_BUILD_INCDIR}\osiqueue.h"
-   File "${AFS_BUILD_INCDIR}\osiutils.h"
-   File "${AFS_BUILD_INCDIR}\osi.h"
-   File "${AFS_BUILD_INCDIR}\osidb.h"
-   File "${AFS_BUILD_INCDIR}\osilog.h"
-   File "${AFS_BUILD_INCDIR}\osisleep.h"
-   File "${AFS_BUILD_INCDIR}\perf.h"
-   File "${AFS_BUILD_INCDIR}\ubik.h"
-   File "${AFS_BUILD_INCDIR}\ubik_int.h"
-   
-   
-   
-   SetOutPath "$INSTDIR\Client\Program\Include\afs"
-   File "${AFS_BUILD_INCDIR}\afs\afs_args.h"
-   File "${AFS_BUILD_INCDIR}\afs\debug.h"
-   File "${AFS_BUILD_INCDIR}\afs\param.h"
-   File "${AFS_BUILD_INCDIR}\afs\afs_sysnames.h"
-   ;File "${AFS_BUILD_INCDIR}\afs\permit_xprt.h"
-   File "${AFS_BUILD_INCDIR}\afs\stds.h"
-   File "${AFS_BUILD_INCDIR}\afs\icl.h"
-   File "${AFS_BUILD_INCDIR}\afs\procmgmt.h"
-   File "${AFS_BUILD_INCDIR}\afs\afsutil.h"
-   File "${AFS_BUILD_INCDIR}\afs\assert.h"
-   File "${AFS_BUILD_INCDIR}\afs\dirent.h"
-   File "${AFS_BUILD_INCDIR}\afs\errors.h"
-   File "${AFS_BUILD_INCDIR}\afs\itc.h"
-   File "${AFS_BUILD_INCDIR}\afs\vice.h"
-   File "${AFS_BUILD_INCDIR}\afs\pthread_glock.h"
-   File "${AFS_BUILD_INCDIR}\afs\errmap_nt.h"
-   File "${AFS_BUILD_INCDIR}\afs\dirpath.h"
-   File "${AFS_BUILD_INCDIR}\afs\ktime.h"
-   File "${AFS_BUILD_INCDIR}\afs\fileutil.h"
-   File "${AFS_BUILD_INCDIR}\afs\secutil_nt.h"
-   File "${AFS_BUILD_INCDIR}\afs\com_err.h"
-   File "${AFS_BUILD_INCDIR}\afs\error_table.h"
-   ;File "${AFS_BUILD_INCDIR}\afs\mit_sipb-cr.h"
-   File "${AFS_BUILD_INCDIR}\afs\cmd.h"
-   File "${AFS_BUILD_INCDIR}\afs\rxgen_consts.h"
-   File "${AFS_BUILD_INCDIR}\afs\afsint.h"
-   File "${AFS_BUILD_INCDIR}\afs\afscbint.h"
-   File "${AFS_BUILD_INCDIR}\afs\audit.h"
-   File "${AFS_BUILD_INCDIR}\afs\acl.h"
-   File "${AFS_BUILD_INCDIR}\afs\prs_fs.h"
-   File "${AFS_BUILD_INCDIR}\afs\afsd.h"
-   File "${AFS_BUILD_INCDIR}\afs\cm.h"
-   File "${AFS_BUILD_INCDIR}\afs\cm_buf.h"
-   File "${AFS_BUILD_INCDIR}\afs\cm_cell.h"
-   File "${AFS_BUILD_INCDIR}\afs\cm_config.h"
-   File "${AFS_BUILD_INCDIR}\afs\cm_conn.h"
-   File "${AFS_BUILD_INCDIR}\afs\cm_ioctl.h"
-   File "${AFS_BUILD_INCDIR}\afs\cm_scache.h"
-   File "${AFS_BUILD_INCDIR}\afs\cm_server.h"
-   File "${AFS_BUILD_INCDIR}\afs\cm_user.h"
-   File "${AFS_BUILD_INCDIR}\afs\cm_utils.h"
-   File "${AFS_BUILD_INCDIR}\afs\fs_utils.h"
-   File "${AFS_BUILD_INCDIR}\afs\krb.h"
-   File "${AFS_BUILD_INCDIR}\afs\krb_prot.h"
-   File "${AFS_BUILD_INCDIR}\afs\smb.h"
-   File "${AFS_BUILD_INCDIR}\afs\smb3.h"
-   File "${AFS_BUILD_INCDIR}\afs\smb_iocons.h"
-   File "${AFS_BUILD_INCDIR}\afs\smb_ioctl.h"
-   File "${AFS_BUILD_INCDIR}\afs\afsrpc.h"
-   File "${AFS_BUILD_INCDIR}\afs\afssyscalls.h"
-   File "${AFS_BUILD_INCDIR}\afs\pioctl_nt.h"
-   File "${AFS_BUILD_INCDIR}\afs\auth.h"
-   File "${AFS_BUILD_INCDIR}\afs\cellconfig.h"
-   File "${AFS_BUILD_INCDIR}\afs\keys.h"
-   File "${AFS_BUILD_INCDIR}\afs\ptserver.h"
-   File "${AFS_BUILD_INCDIR}\afs\ptint.h"
-   File "${AFS_BUILD_INCDIR}\afs\pterror.h"
-   File "${AFS_BUILD_INCDIR}\afs\ptint.h"
-   File "${AFS_BUILD_INCDIR}\afs\pterror.h"
-   File "${AFS_BUILD_INCDIR}\afs\ptclient.h"
-   File "${AFS_BUILD_INCDIR}\afs\prserver.h"
-   File "${AFS_BUILD_INCDIR}\afs\print.h"
-   File "${AFS_BUILD_INCDIR}\afs\prerror.h"
-   File "${AFS_BUILD_INCDIR}\afs\prclient.h"
-   File "${AFS_BUILD_INCDIR}\afs\kautils.h"
-   File "${AFS_BUILD_INCDIR}\afs\kauth.h"
-   File "${AFS_BUILD_INCDIR}\afs\kaport.h"
-   File "${AFS_BUILD_INCDIR}\afs\vl_opcodes.h"
-   File "${AFS_BUILD_INCDIR}\afs\vlserver.h"
-   File "${AFS_BUILD_INCDIR}\afs\vldbint.h"
-   File "${AFS_BUILD_INCDIR}\afs\usd.h"
-   File "${AFS_BUILD_INCDIR}\afs\bubasics.h"
-   File "${AFS_BUILD_INCDIR}\afs\butc.h"
-   File "${AFS_BUILD_INCDIR}\afs\bumon.h"
-   File "${AFS_BUILD_INCDIR}\afs\butm.h"
-   File "${AFS_BUILD_INCDIR}\afs\tcdata.h"
-   File "${AFS_BUILD_INCDIR}\afs\budb.h"
-   ;File "${AFS_BUILD_INCDIR}\afs\budb_errors.h"
-   File "${AFS_BUILD_INCDIR}\afs\budb_client.h"
-   File "${AFS_BUILD_INCDIR}\afs\dir.h"
-   File "${AFS_BUILD_INCDIR}\afs\fssync.h"
-   File "${AFS_BUILD_INCDIR}\afs\ihandle.h"
-   File "${AFS_BUILD_INCDIR}\afs\nfs.h"
-   File "${AFS_BUILD_INCDIR}\afs\ntops.h"
-   File "${AFS_BUILD_INCDIR}\afs\partition.h"
-   File "${AFS_BUILD_INCDIR}\afs\viceinode.h"
-   File "${AFS_BUILD_INCDIR}\afs\vnode.h"
-   File "${AFS_BUILD_INCDIR}\afs\volume.h"
-   File "${AFS_BUILD_INCDIR}\afs\voldefs.h"
-   File "${AFS_BUILD_INCDIR}\afs\volser.h"
-   File "${AFS_BUILD_INCDIR}\afs\volint.h"
-   File "${AFS_BUILD_INCDIR}\afs\fs_stats.h"
-   File "${AFS_BUILD_INCDIR}\afs\bosint.h"
-   File "${AFS_BUILD_INCDIR}\afs\bnode.h"
-   
-   
-   SetOutPath "$INSTDIR\Client\Program\Include\rx"
-   File "${AFS_BUILD_INCDIR}\rx\rx.h"
-   File "${AFS_BUILD_INCDIR}\rx\rx_packet.h"
-   File "${AFS_BUILD_INCDIR}\rx\rx_user.h"
-   File "${AFS_BUILD_INCDIR}\rx\rx_event.h"
-   File "${AFS_BUILD_INCDIR}\rx\rx_queue.h"
-   File "${AFS_BUILD_INCDIR}\rx\rx_globals.h"
-   File "${AFS_BUILD_INCDIR}\rx\rx_clock.h"
-   File "${AFS_BUILD_INCDIR}\rx\rx_misc.h"
-   File "${AFS_BUILD_INCDIR}\rx\rx_multi.h"
-   File "${AFS_BUILD_INCDIR}\rx\rx_null.h"
-   File "${AFS_BUILD_INCDIR}\rx\rx_lwp.h"
-   File "${AFS_BUILD_INCDIR}\rx\rx_pthread.h"
-   File "${AFS_BUILD_INCDIR}\rx\rx_xmit_nt.h"
-   File "${AFS_BUILD_INCDIR}\rx\xdr.h"
-   File "${AFS_BUILD_INCDIR}\rx\rxkad.h"
-   
-   
 
-   ; Client Sample
-   SetOutPath "$INSTDIR\Client\Program\Sample"
-   File "..\..\afsd\sample\token.c"
-   
    Call AFSLangFiles
    
-   ; Do SYSTEM32 DIR
-   SetOutPath "$SYSDIR"
-   File "${AFS_CLIENT_BUILDDIR}\afs_cpa.cpl"
-!IFDEF DEBUG
-   ;File "${SDK_DIR}\REDIST\msvcrtd.dll"
-   ;File "${SDK_DIR}\REDIST\msvcrtd.pdb"
-!IFDEF CL_1310
-   !insertmacro UpgradeDLL "${AFS_WININSTALL_DIR}\mfc71d.dll" "$SYSDIR\mfc71d.dll"
-!ELSE
-!IFDEF CL_1300
-   !insertmacro UpgradeDLL "${AFS_WININSTALL_DIR}\mfc70d.dll" "$SYSDIR\mfc70d.dll"
-!ELSE
-   !insertmacro UpgradeDLL "${AFS_WININSTALL_DIR}\mfc42d.dll" "$SYSDIR\mfc42d.dll"
-!ENDIF
-!ENDIF
-!ELSE
-   ;File "${SDK_DIR}\REDIST\msvcrt.dll"
-!IFDEF CL_1310
-   !insertmacro UpgradeDLL "${AFS_WININSTALL_DIR}\mfc71.dll" "$SYSDIR\mfc71.dll"
-!ELSE
-!IFDEF CL_1300
-   !insertmacro UpgradeDLL "${AFS_WININSTALL_DIR}\mfc70.dll" "$SYSDIR\mfc70.dll"
-!ELSE
-   !insertmacro UpgradeDLL "${AFS_WININSTALL_DIR}\mfc42.dll" "$SYSDIR\mfc42.dll"
-!ENDIF
-!ENDIF
-!ENDIF
+
    
   ; Do WINDOWSDIR components
+  
+  ; Do Windows SYSDIR (Control panel)
+  SetOutPath "$SYSDIR"
+  File "${AFS_CLIENT_BUILDDIR}\afs_cpa.cpl"
+!ifdef DEBUG
+  File "${AFS_CLIENT_BUILDDIR}\afs_cpa.pdb"
+!endif
+  
   ; Get AFS CellServDB file
   Call afs.GetCellServDB
-  ;Call afs.InstallMSLoopback
-  
+!ifdef INSTALL_LOOPBACK
+  Call afs.InstallMSLoopback
+!endif
+
+!ifdef INSTALL_KFW
   ; Include Kerberos for Windows files in the installer...
-  ;SetOutPath "$INSTDIR\kfw\bin\"
-  ;File "${KFW_SOURCE}\bin\*"
-  ;SetOutPath "$INSTDIR\kfw\doc"
-  ;File "${KFW_SOURCE}\doc\*"
-  
-  ReadINIStr $R0 $0 "Field 2" "State"
-  StrCmp $R0 "1" UsePkg DontUsePkg
- UsePkg:
-   SetOutPath "$WINDIR"
-   File "afsdcell.ini"
-DontUsePkg:
-   ReadINIStr $R0 $0 "Field 6" "State"
-   StrCmp $R0 "1" UseFile DontUseFile
-UseFile:
-   ReadINIStr $R0 $0 "Field 7" "State"
-   CopyFiles $R0 "$WINDIR\afsdcell.ini"
-DontUseFile:
+  SetOutPath "$INSTDIR\kfw\bin\"
+  File "${KFW_SOURCE}\bin\*"
+  SetOutPath "$INSTDIR\kfw\doc"
+  File "${KFW_SOURCE}\doc\*"
+!endif
    
   ;Store install folder
   WriteRegStr HKCU "${AFS_REGKEY_ROOT}\Client" "" $INSTDIR
@@ -614,23 +560,30 @@ DontUseFile:
   
   ; AFS Reg entries
   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion"
-  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "VersionString" ${MUI_VERSION}
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "VersionString" ${AFS_VERSION}
   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "Title" "AFS Client"
   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "Description" "AFS Client"
   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "PathName" "$INSTDIR\Client\Program"
   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "Software Type" "File System"
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "MajorVersion" ${MUI_MAJORVERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "MinorVersion" ${MUI_MINORVERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "PatchLevel" ${MUI_PATCHLEVEL}
-  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${MUI_VERSION}" "VersionString" ${MUI_VERSION}
-  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${MUI_VERSION}" "Title" "AFS Client"
-  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${MUI_VERSION}" "Description" "AFS Client"
-  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${MUI_VERSION}" "Software Type" "File System"
-  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${MUI_VERSION}" "PathName" "$INSTDIR\Client\Program"
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${MUI_VERSION}" "MajorVersion" ${MUI_MAJORVERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${MUI_VERSION}" "MinorVersion" ${MUI_MINORVERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${MUI_VERSION}" "PatchLevel" ${MUI_PATCHLEVEL}
-
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "MajorVersion" ${AFS_MAJORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "MinorVersion" ${AFS_MINORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "PatchLevel" ${AFS_PATCHLEVEL}
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "VersionString" ${AFS_VERSION}
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "Title" "AFS Client"
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "Description" "AFS Client"
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "Software Type" "File System"
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "PathName" "$INSTDIR\Client\Program"
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "MajorVersion" ${AFS_MAJORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "MinorVersion" ${AFS_MINORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL}
+!ifdef DEBUG
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "Debug" 1
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "Debug" 1
+!else
+   ; Delete the DEBUG string
+   DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "Debug"
+   DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "Debug"
+!endif
    ; Set network settings
   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\NetBT\Parameters" "SmbDeviceEnabled" 0
   
@@ -645,9 +598,11 @@ DontUseFile:
   Push "$INSTDIR\Common"
   Call AddToPath
   
+!ifdef INSTALL_KFW
   ; Add kfw to path too
   Push "$INSTDIR\kfw\bin"
   Call AddToPath
+!endif
    
   ; Create the AFS service
   SetOutPath "$INSTDIR\Common"
@@ -655,9 +610,9 @@ DontUseFile:
   nsExec::Exec "net stop TransarcAFSDaemon"
   ;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
-  ReadINIStr $R2 $1 "Field 2" "State"
-
-  StrCmp $R2 "" skipremove
+  ReadRegStr $R2 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon" "Cell"
+  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"'
 skipremove:
@@ -667,7 +622,12 @@ skipremove:
   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon" "(Default)" ""
   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "AuthentProviderPath" "$INSTDIR\Client\Program\afslogon.dll"
   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "Class" 2
-  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "LogonOptions" 2
+  ReadINIStr $R0 $1 "Field 7" "State"
+  ReadINIStr $R1 $1 "Field 9" "State"
+  ; Complicated way to do $R1 = ($R1 *2) + $R0
+  IntOp $R2 $R1 * 2
+  IntOp $R1 $R2 + $R0
+  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "LogonOptions" $R1
   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "LogonScript" "$INSTDIR\Client\Program\afscreds.exe -:%s -x"
   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "Name" "OpenAFSDaemon"
   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "ProviderPath" "$INSTDIR\Client\Program\afslogon.dll"
@@ -675,8 +635,12 @@ skipremove:
   ;Write cell name
   ReadINIStr $R0 $1 "Field 2" "State"
   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "Cell" $R0
+  ReadINIStr $R0 $1 "Field 3" "State"
   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "ShowTrayIcon" 1
-  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "SecurityLevel" 1  
+  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "SecurityLevel" $R0
+  ReadINIStr $R0 $1 "Field 5" "State"  
+  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "FreelanceClient" $R0
+  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "UseDNS" 0
   SetRebootFlag true
   
   WriteUninstaller "$INSTDIR\Uninstall.exe"
@@ -685,13 +649,24 @@ SectionEnd
 
 ;------------------------
 ; OpenAFS SERVER  
-Section "AFS Server" SecServer
+Section "AFS Server" secServer
 
   SetShellVarContext all
+  ; Stop any running services or we can't replace the files
+  ; Stop the running processes
+  ;GetTempFileName $R0
+  ;File /oname=$R0 "${AFS_WININSTALL_DIR}\Killer.exe"   ; Might not have the MSVCR71.DLL file to run
+  ;nsExec::Exec '$R0 afscreds.exe'
+!IFDEF INSTALL_KFW
+  ;nsExec::Exec '$R0 krbcc32s.exe'
+!ENDIF
+
+  nsExec::Exec "net stop TransarcAFSDaemon"
+  nsExec::Exec "net stop TransarcAFSServer"
 
   CreateDirectory "$INSTDIR\Server\usr\afs\etc"
   CreateDirectory "$INSTDIR\Server\usr\afs\local"
-  CreateDirectory "$INSTDIR\Server\usr\afs\logs"
+  CreateDirectory "$INSTDIR\Server\usr\afs\etc\logs"
   
   SetOutPath "$INSTDIR\Server\usr\afs\bin"  
   File "${AFS_SERVER_BUILDDIR}\afskill.exe"
@@ -710,6 +685,25 @@ Section "AFS Server" SecServer
   File "${AFS_SERVER_BUILDDIR}\vlserver.exe"
   File "${AFS_SERVER_BUILDDIR}\volinfo.exe"
   File "${AFS_SERVER_BUILDDIR}\volserver.exe"
+
+!ifdef DEBUG
+  File "${AFS_SERVER_BUILDDIR}\afskill.pdb"
+  File "${AFS_SERVER_BUILDDIR}\afssvrcfg.pdb"
+  File "${AFS_SERVER_BUILDDIR}\bosctlsvc.pdb"
+  File "${AFS_SERVER_BUILDDIR}\bosserver.pdb"
+  File "${AFS_SERVER_BUILDDIR}\buserver.pdb"
+  File "${AFS_ETC_BUILDDIR}\butc.pdb"
+  File "${AFS_SERVER_BUILDDIR}\fileserver.pdb"
+  File "${AFS_ETC_BUILDDIR}\fms.pdb"
+  File "${AFS_SERVER_BUILDDIR}\kaserver.pdb"
+  File "${AFS_SERVER_BUILDDIR}\ptserver.pdb"
+  File "${AFS_SERVER_BUILDDIR}\salvager.pdb"
+  File "${AFS_SERVER_BUILDDIR}\upclient.pdb"
+  File "${AFS_SERVER_BUILDDIR}\upserver.pdb"
+  File "${AFS_SERVER_BUILDDIR}\vlserver.pdb"
+  File "${AFS_SERVER_BUILDDIR}\volinfo.pdb"
+  File "${AFS_SERVER_BUILDDIR}\volserver.pdb"
+!endif
  
  ;AFS Server common files
  SetOutPath "$INSTDIR\Common"
@@ -718,43 +712,68 @@ Section "AFS Server" SecServer
  File "${AFS_SERVER_BUILDDIR}\afscfgadmin.dll"
  File "${AFS_SERVER_BUILDDIR}\afskasadmin.dll"
  File "${AFS_SERVER_BUILDDIR}\afsptsadmin.dll"
+
+!ifdef DEBUG
+ File "${AFS_SERVER_BUILDDIR}\afsvosadmin.pdb"
+ File "${AFS_SERVER_BUILDDIR}\afsbosadmin.pdb"
+ File "${AFS_SERVER_BUILDDIR}\afscfgadmin.pdb"
+ File "${AFS_SERVER_BUILDDIR}\afskasadmin.pdb"
+ File "${AFS_SERVER_BUILDDIR}\afsptsadmin.pdb"
+!endif
  SetOutPath "$INSTDIR\Common"
    Call AFSLangFiles
    
-   SetOutPath "$WINDIR"
+   SetOutPath "$SYSDIR"
    File "${AFS_SERVER_BUILDDIR}\afsserver.cpl"
+
+!ifdef DEBUG
+   File "${AFS_SERVER_BUILDDIR}\afsserver.pdb"
+!endif
    
   ;Store install folder
   WriteRegStr HKCU "${AFS_REGKEY_ROOT}\AFS Server" "" $INSTDIR
   
   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion"
-  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "VersionString" ${MUI_VERSION}
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "VersionString" ${AFS_VERSION}
   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "Title" "AFS Server"
   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "Description" "AFS Server for Windows"
   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "PathName" "$INSTDIR\Server"
   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "Software Type" "File System"
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "MajorVersion" ${MUI_MAJORVERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "MinorVersion" ${MUI_MINORVERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "PatchLevel" ${MUI_PATCHLEVEL}
-  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${MUI_VERSION}" "VersionString" ${MUI_VERSION}
-  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${MUI_VERSION}" "Title" "AFS Server"
-  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${MUI_VERSION}" "Description" "AFS Server for Windows"
-  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${MUI_VERSION}" "Software Type" "File System"
-  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${MUI_VERSION}" "PathName" "$INSTDIR\Server"
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\${MUI_VERSION}" "MajorVersion" ${MUI_MAJORVERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\${MUI_VERSION}" "MinorVersion" ${MUI_MINORVERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\${MUI_VERSION}" "PatchLevel" ${MUI_PATCHLEVEL}
-
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "MajorVersion" ${AFS_MAJORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "MinorVersion" ${AFS_MINORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "PatchLevel" ${AFS_PATCHLEVEL}
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "VersionString" ${AFS_VERSION}
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "Title" "AFS Server"
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "Description" "AFS Server for Windows"
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "Software Type" "File System"
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "PathName" "$INSTDIR\Server"
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "MajorVersion" ${AFS_MAJORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "MinorVersion" ${AFS_MINORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL}
+!ifdef DEBUG
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "Debug" 1
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "Debug" 1
+!else
+   ; Delete the DEBUG string
+   DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "Debug"
+   DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "Debug"
+!endif
   ; Install the service
   SetOutPath "$INSTDIR\Common"
   File "${AFS_WININSTALL_DIR}\Service.exe"
-  nsExec::Exec "net stop TransarcAFSServer"
-  nsExec::Exec '$INSTDIR\Common\service.exe u TransarcAFSServer'
+!ifdef DEBUG
+  File "${AFS_WININSTALL_DIR}\Service.pdb"
+!endif
+  ;Don't want to whack existing settings... Make users un-install and then re-install if they want that
+  ;nsExec::Exec '$INSTDIR\Common\service.exe u TransarcAFSServer'
   nsExec::Exec '$INSTDIR\Common\service.exe TransarcAFSServer "$INSTDIR\Server\usr\afs\bin\bosctlsvc.exe" "OpenAFS AFS Server"'
   Delete "$INSTDIR\Common\service.exe"
   
   CreateDirectory "$SMPROGRAMS\OpenAFS\Server"
-  CreateShortCut "$SMPROGRAMS\OpenAFS\Server\Configuration Wizard.lnk" "$INSTDIR\Server\usr\afs\bin\afssvrcfg.exe" "/wizard"
+  CreateShortCut "$SMPROGRAMS\OpenAFS\Server\Server Configuration.lnk" "$INSTDIR\Server\usr\afs\bin\afssvrcfg.exe"
+  
+  ; Make the server config wizard auto-start on bootup
+  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" "AFS Server Wizard" '"$INSTDIR\Server\usr\afs\bin\afssvrcfg.exe" /wizard"'
   
   WriteUninstaller "$INSTDIR\Uninstall.exe"
 
@@ -763,7 +782,7 @@ SectionEnd
 
 ;----------------------------
 ; OpenAFS Control Center
-Section "AFS Control Center" SecControl
+Section "AFS Control Center" secControl
 
   SetShellVarContext all
 
@@ -772,6 +791,12 @@ Section "AFS Control Center" SecControl
   File "${AFS_SERVER_BUILDDIR}\TaAfsAdmSvr.exe"
   File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager.exe"
    
+!ifdef DEBUG
+  File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager.pdb"
+  File "${AFS_SERVER_BUILDDIR}\TaAfsAdmSvr.pdb"
+  File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager.pdb"
+!endif
+
  ;AFS Server common files
  Call AFSCommon.Install
  Call AFSLangFiles
@@ -779,32 +804,48 @@ Section "AFS Control Center" SecControl
 
   SetOutPath "$INSTDIR\Common"
 !IFDEF DEBUG
-!IFDEF CL1310
+!IFDEF CL_1310
   File "${AFS_WININSTALL_DIR}\msvcr71d.dll"
   File "${AFS_WININSTALL_DIR}\msvcr71d.pdb"
 !ELSE
+!IFDEF CL_1300
+  File "${AFS_WININSTALL_DIR}\msvcrtd.dll"
+  File "${AFS_WININSTALL_DIR}\msvcrtd.pdb"
+!ELSE
   File "${AFS_WININSTALL_DIR}\msvcrtd.dll"
   File "${AFS_WININSTALL_DIR}\msvcrtd.pdb"
 !ENDIF
+!ENDIF
 !ELSE
-!IFDEF CL1310
+!IFDEF CL_1310
   File "${AFS_WININSTALL_DIR}\msvcr71.dll"
 !ELSE
+!IFDEF CL_1300
   File "${AFS_WININSTALL_DIR}\msvcrt.dll"
+!ELSE
+  File "${AFS_WININSTALL_DIR}\msvcrt.dll"
+!ENDIF
 !ENDIF
 !ENDIF
    
    ;Store install folder
   WriteRegStr HKCU "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "PathName" $INSTDIR
-  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "VersionString" ${MUI_VERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "MajorVersion" ${MUI_MAJORVERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "MinorVersion" ${MUI_MINORVERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "PatchLevel" ${MUI_PATCHLEVEL}
-  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${MUI_VERSION}" "VersionString" ${MUI_VERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${MUI_VERSION}" "MajorVersion" ${MUI_MAJORVERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${MUI_VERSION}" "MinorVersion" ${MUI_MINORVERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${MUI_VERSION}" "PatchLevel" ${MUI_PATCHLEVEL}
-  
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "VersionString" ${AFS_VERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "MajorVersion" ${AFS_MAJORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "MinorVersion" ${AFS_MINORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "PatchLevel" ${AFS_PATCHLEVEL}
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "VersionString" ${AFS_VERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "MajorVersion" ${AFS_MAJORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "MinorVersion" ${AFS_MINORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL}
+!ifdef DEBUG
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "Debug" 1
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "Debug" 1
+!else
+   ; Delete the DEBUG string
+   DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "Debug"
+   DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "Debug"
+!endif
 
   ;Write start menu entries
   CreateDirectory "$SMPROGRAMS\OpenAFS\Control Center"
@@ -818,14 +859,16 @@ SectionEnd
 
 ;----------------------------
 ; OpenAFS Supplemental Documentation
-Section "Supplemental Documentation" SecDocs
+Section "Supplemental Documentation" secDocs
   SetShellVarContext all
 
    StrCmp $LANGUAGE ${LANG_ENGLISH} DoEnglish
    StrCmp $LANGUAGE ${LANG_GERMAN} DoGerman
    StrCmp $LANGUAGE ${LANG_SPANISH} DoSpanish
    StrCmp $LANGUAGE ${LANG_JAPANESE} DoJapanese
-   ;StrCmp $LANGUAGE ${LANG_KOREAN} DoKorean
+!ifndef v2.0b3
+   StrCmp $LANGUAGE ${LANG_KOREAN} DoKorean
+!endif
    StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} DoPortugueseBR
    StrCmp $LANGUAGE ${LANG_SIMPCHINESE} DoSimpChinese
    StrCmp $LANGUAGE ${LANG_TRADCHINESE} DoTradChinese
@@ -953,14 +996,14 @@ DoTradChinese:
 DoneLanguage:
    ;Store install folder
   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation" "" $INSTDIR
-  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "VersionString" ${MUI_VERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "MajorVersion" ${MUI_MAJORVERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "MinorVersion" ${MUI_MINORVERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "PatchLevel" ${MUI_PATCHLEVEL}
-  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${MUI_VERSION}" "VersionString" ${MUI_VERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${MUI_VERSION}" "MajorVersion" ${MUI_MAJORVERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${MUI_VERSION}" "MinorVersion" ${MUI_MINORVERSION}
-  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${MUI_VERSION}" "PatchLevel" ${MUI_PATCHLEVEL}
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "VersionString" ${AFS_VERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "MajorVersion" ${AFS_MAJORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "MinorVersion" ${AFS_MINORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "PatchLevel" ${AFS_PATCHLEVEL}
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${AFS_VERSION}" "VersionString" ${AFS_VERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${AFS_VERSION}" "MajorVersion" ${AFS_MAJORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${AFS_VERSION}" "MinorVersion" ${AFS_MINORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL}
 
   ; Write start menu shortcut
   SetOutPath "$SMPROGRAMS\OpenAFS"
@@ -969,8 +1012,190 @@ DoneLanguage:
   
   WriteUninstaller "$INSTDIR\Uninstall.exe"
   CreateShortCut "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk" "$INSTDIR\Uninstall.exe"
+  Call AFSCommon.Install
 SectionEnd  
   
+
+Section "Software Development Kit (SDK)" secSDK
+
+  SetOutPath "$INSTDIR\Client\Program"
+
+  File "${AFS_BUILD_INCDIR}\afs\cm_config.h"
+  File "${AFS_BUILD_INCDIR}\afs\kautils.h"
+  File "${AFS_CLIENT_LIBDIR}\libafsconf.lib"
+  File "${AFS_CLIENT_LIBDIR}\afsauthent.lib"
+
+  ; Client_headers
+   SetOutPath "$INSTDIR\Client\Program\Include"
+   File "${AFS_BUILD_INCDIR}\lock.h"
+   File "${AFS_BUILD_INCDIR}\lwp.h"
+   File "${AFS_BUILD_INCDIR}\preempt.h"
+   File "${AFS_BUILD_INCDIR}\timer.h"
+   File "${AFS_BUILD_INCDIR}\des.h"
+   File "${AFS_BUILD_INCDIR}\des_conf.h"
+   File "${AFS_BUILD_INCDIR}\mit-cpyright.h"
+   ;File "${AFS_BUILD_INCDIR}\des-odd.h"
+   File "${AFS_BUILD_INCDIR}\crypt.h"
+   File "${AFS_BUILD_INCDIR}\pthread.h"
+   File "${AFS_BUILD_INCDIR}\dbrpc.h"
+   File "${AFS_BUILD_INCDIR}\basic.h"
+   File "${AFS_BUILD_INCDIR}\osidebug.h"
+   File "${AFS_BUILD_INCDIR}\osiltype.h"
+   File "${AFS_BUILD_INCDIR}\osistatl.h"
+   File "${AFS_BUILD_INCDIR}\trylock.h"
+   File "${AFS_BUILD_INCDIR}\main.h"
+   File "${AFS_BUILD_INCDIR}\osibasel.h"
+   File "${AFS_BUILD_INCDIR}\osifd.h"
+   File "${AFS_BUILD_INCDIR}\osiqueue.h"
+   File "${AFS_BUILD_INCDIR}\osiutils.h"
+   File "${AFS_BUILD_INCDIR}\osi.h"
+   File "${AFS_BUILD_INCDIR}\osidb.h"
+   File "${AFS_BUILD_INCDIR}\osilog.h"
+   File "${AFS_BUILD_INCDIR}\osisleep.h"
+   File "${AFS_BUILD_INCDIR}\perf.h"
+   File "${AFS_BUILD_INCDIR}\ubik.h"
+   File "${AFS_BUILD_INCDIR}\ubik_int.h"
+   
+   
+   
+   SetOutPath "$INSTDIR\Client\Program\Include\afs"
+   File "${AFS_BUILD_INCDIR}\afs\afs_args.h"
+   File "${AFS_BUILD_INCDIR}\afs\debug.h"
+   File "${AFS_BUILD_INCDIR}\afs\param.h"
+   File "${AFS_BUILD_INCDIR}\afs\afs_sysnames.h"
+   ;File "${AFS_BUILD_INCDIR}\afs\permit_xprt.h"
+   File "${AFS_BUILD_INCDIR}\afs\stds.h"
+   File "${AFS_BUILD_INCDIR}\afs\icl.h"
+   File "${AFS_BUILD_INCDIR}\afs\procmgmt.h"
+   File "${AFS_BUILD_INCDIR}\afs\afsutil.h"
+   File "${AFS_BUILD_INCDIR}\afs\assert.h"
+   File "${AFS_BUILD_INCDIR}\afs\dirent.h"
+   File "${AFS_BUILD_INCDIR}\afs\errors.h"
+   File "${AFS_BUILD_INCDIR}\afs\itc.h"
+   File "${AFS_BUILD_INCDIR}\afs\vice.h"
+   File "${AFS_BUILD_INCDIR}\afs\pthread_glock.h"
+   File "${AFS_BUILD_INCDIR}\afs\errmap_nt.h"
+   File "${AFS_BUILD_INCDIR}\afs\dirpath.h"
+   File "${AFS_BUILD_INCDIR}\afs\ktime.h"
+   File "${AFS_BUILD_INCDIR}\afs\fileutil.h"
+   File "${AFS_BUILD_INCDIR}\afs\secutil_nt.h"
+   File "${AFS_BUILD_INCDIR}\afs\com_err.h"
+   File "${AFS_BUILD_INCDIR}\afs\error_table.h"
+   ;File "${AFS_BUILD_INCDIR}\afs\mit_sipb-cr.h"
+   File "${AFS_BUILD_INCDIR}\afs\cmd.h"
+   File "${AFS_BUILD_INCDIR}\afs\rxgen_consts.h"
+   File "${AFS_BUILD_INCDIR}\afs\afsint.h"
+   File "${AFS_BUILD_INCDIR}\afs\afscbint.h"
+   File "${AFS_BUILD_INCDIR}\afs\audit.h"
+   File "${AFS_BUILD_INCDIR}\afs\acl.h"
+   File "${AFS_BUILD_INCDIR}\afs\prs_fs.h"
+   File "${AFS_BUILD_INCDIR}\afs\afsd.h"
+   File "${AFS_BUILD_INCDIR}\afs\cm.h"
+   File "${AFS_BUILD_INCDIR}\afs\cm_buf.h"
+   File "${AFS_BUILD_INCDIR}\afs\cm_cell.h"
+   File "${AFS_BUILD_INCDIR}\afs\cm_config.h"
+   File "${AFS_BUILD_INCDIR}\afs\cm_conn.h"
+   File "${AFS_BUILD_INCDIR}\afs\cm_ioctl.h"
+   File "${AFS_BUILD_INCDIR}\afs\cm_scache.h"
+   File "${AFS_BUILD_INCDIR}\afs\cm_server.h"
+   File "${AFS_BUILD_INCDIR}\afs\cm_user.h"
+   File "${AFS_BUILD_INCDIR}\afs\cm_utils.h"
+   File "${AFS_BUILD_INCDIR}\afs\fs_utils.h"
+   File "${AFS_BUILD_INCDIR}\afs\krb.h"
+   File "${AFS_BUILD_INCDIR}\afs\krb_prot.h"
+   File "${AFS_BUILD_INCDIR}\afs\smb.h"
+   File "${AFS_BUILD_INCDIR}\afs\smb3.h"
+   File "${AFS_BUILD_INCDIR}\afs\smb_iocons.h"
+   File "${AFS_BUILD_INCDIR}\afs\smb_ioctl.h"
+   File "${AFS_BUILD_INCDIR}\afs\afsrpc.h"
+   File "${AFS_BUILD_INCDIR}\afs\afssyscalls.h"
+   File "${AFS_BUILD_INCDIR}\afs\pioctl_nt.h"
+   File "${AFS_BUILD_INCDIR}\afs\auth.h"
+   File "${AFS_BUILD_INCDIR}\afs\cellconfig.h"
+   File "${AFS_BUILD_INCDIR}\afs\keys.h"
+   File "${AFS_BUILD_INCDIR}\afs\ptserver.h"
+   File "${AFS_BUILD_INCDIR}\afs\ptint.h"
+   File "${AFS_BUILD_INCDIR}\afs\pterror.h"
+   File "${AFS_BUILD_INCDIR}\afs\ptint.h"
+   File "${AFS_BUILD_INCDIR}\afs\pterror.h"
+   File "${AFS_BUILD_INCDIR}\afs\ptclient.h"
+   File "${AFS_BUILD_INCDIR}\afs\prserver.h"
+   File "${AFS_BUILD_INCDIR}\afs\print.h"
+   File "${AFS_BUILD_INCDIR}\afs\prerror.h"
+   File "${AFS_BUILD_INCDIR}\afs\prclient.h"
+   File "${AFS_BUILD_INCDIR}\afs\kautils.h"
+   File "${AFS_BUILD_INCDIR}\afs\kauth.h"
+   File "${AFS_BUILD_INCDIR}\afs\kaport.h"
+   File "${AFS_BUILD_INCDIR}\afs\vl_opcodes.h"
+   File "${AFS_BUILD_INCDIR}\afs\vlserver.h"
+   File "${AFS_BUILD_INCDIR}\afs\vldbint.h"
+   File "${AFS_BUILD_INCDIR}\afs\usd.h"
+   File "${AFS_BUILD_INCDIR}\afs\bubasics.h"
+   File "${AFS_BUILD_INCDIR}\afs\butc.h"
+   File "${AFS_BUILD_INCDIR}\afs\bumon.h"
+   File "${AFS_BUILD_INCDIR}\afs\butm.h"
+   File "${AFS_BUILD_INCDIR}\afs\tcdata.h"
+   File "${AFS_BUILD_INCDIR}\afs\budb.h"
+   ;File "${AFS_BUILD_INCDIR}\afs\budb_errors.h"
+   File "${AFS_BUILD_INCDIR}\afs\budb_client.h"
+   File "${AFS_BUILD_INCDIR}\afs\dir.h"
+   File "${AFS_BUILD_INCDIR}\afs\fssync.h"
+   File "${AFS_BUILD_INCDIR}\afs\ihandle.h"
+   File "${AFS_BUILD_INCDIR}\afs\nfs.h"
+   File "${AFS_BUILD_INCDIR}\afs\ntops.h"
+   File "${AFS_BUILD_INCDIR}\afs\partition.h"
+   File "${AFS_BUILD_INCDIR}\afs\viceinode.h"
+   File "${AFS_BUILD_INCDIR}\afs\vnode.h"
+   File "${AFS_BUILD_INCDIR}\afs\volume.h"
+   File "${AFS_BUILD_INCDIR}\afs\voldefs.h"
+   File "${AFS_BUILD_INCDIR}\afs\volser.h"
+   File "${AFS_BUILD_INCDIR}\afs\volint.h"
+   File "${AFS_BUILD_INCDIR}\afs\fs_stats.h"
+   File "${AFS_BUILD_INCDIR}\afs\bosint.h"
+   File "${AFS_BUILD_INCDIR}\afs\bnode.h"
+   
+   
+   SetOutPath "$INSTDIR\Client\Program\Include\rx"
+   File "${AFS_BUILD_INCDIR}\rx\rx.h"
+   File "${AFS_BUILD_INCDIR}\rx\rx_packet.h"
+   File "${AFS_BUILD_INCDIR}\rx\rx_user.h"
+   File "${AFS_BUILD_INCDIR}\rx\rx_event.h"
+   File "${AFS_BUILD_INCDIR}\rx\rx_queue.h"
+   File "${AFS_BUILD_INCDIR}\rx\rx_globals.h"
+   File "${AFS_BUILD_INCDIR}\rx\rx_clock.h"
+   File "${AFS_BUILD_INCDIR}\rx\rx_misc.h"
+   File "${AFS_BUILD_INCDIR}\rx\rx_multi.h"
+   File "${AFS_BUILD_INCDIR}\rx\rx_null.h"
+   File "${AFS_BUILD_INCDIR}\rx\rx_lwp.h"
+   File "${AFS_BUILD_INCDIR}\rx\rx_pthread.h"
+   File "${AFS_BUILD_INCDIR}\rx\rx_xmit_nt.h"
+   File "${AFS_BUILD_INCDIR}\rx\xdr.h"
+   File "${AFS_BUILD_INCDIR}\rx\rxkad.h"
+   
+   
+
+   ; Client Sample
+   SetOutPath "$INSTDIR\Client\Program\Sample"
+   File "..\..\afsd\sample\token.c"
+
+   ;Store install folder
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS SDK" "" $INSTDIR
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS SDK\CurrentVersion" "VersionString" ${AFS_VERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\CurrentVersion" "MajorVersion" ${AFS_MAJORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\CurrentVersion" "MinorVersion" ${AFS_MINORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\CurrentVersion" "PatchLevel" ${AFS_PATCHLEVEL}
+  WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS SDK\${AFS_VERSION}" "VersionString" ${AFS_VERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\${AFS_VERSION}" "MajorVersion" ${AFS_MAJORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\${AFS_VERSION}" "MinorVersion" ${AFS_MINORVERSION}
+  WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL}
+
+  WriteUninstaller "$INSTDIR\Uninstall.exe"
+  SetOutPath "$SMPROGRAMS\OpenAFS"
+  CreateShortCut "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk" "$INSTDIR\Uninstall.exe"
+
+   Call AFSCommon.Install
+SectionEnd
+
 ;Display the Finish header
 ;Insert this macro after the sections if you are not using a finish page
 ;!insertmacro MUI_SECTIONS_FINISHHEADER
@@ -993,65 +1218,208 @@ Function .onInit
    Abort
    
 contInstall:
+   ; Our logic should be like this.
+   ;     1) If no AFS components are installed, we do a clean install with default options. (Client/Docs)
+   ;     2) If existing modules are installed, we keep them selected
+   ;     3) If it is an upgrade, we set the text accordingly, else we mark it as a re-install
+   ;  TODO: Downgrade?
+   Call IsAnyAFSInstalled
+   Pop $R0
+   StrCmp $R0 "0" DefaultOptions
+   
    Call ShouldClientInstall
    Pop $R2
    
    StrCmp $R2 "0" NoClient
+   StrCmp $R2 "1" ReinstallClient
    StrCmp $R2 "2" UpgradeClient
+   StrCmp $R2 "3" DowngradeClient
    
-       StrCpy $1 ${secClient} ; Gotta remember which section we are at now...
        SectionGetFlags ${secClient} $0
        IntOp $0 $0 | ${SF_SELECTED}
        SectionSetFlags ${secClient} $0
     ;# !insertmacro SelectSection ${secClient}
    goto skipClient
 NoClient:
-       StrCpy $1 ${secClient} ; Gotta remember which section we are at now...
+       ;StrCpy $1 ${secClient} ; Gotta remember which section we are at now...
        SectionGetFlags ${secClient} $0
-       IntOp $0 $0 | ${SECTION_OFF}
+       IntOp $0 $0 & ${SECTION_OFF}
        SectionSetFlags ${secClient} $0
    goto skipClient
 UpgradeClient:
        SectionGetFlags ${secClient} $0
        IntOp $0 $0 | ${SF_SELECTED}
-       SectionSetFlags ${secClient} $0
-   SectionSetText ${secClient} $(UPGRADE_CLIENT)
-   goto skipClient
+       SectionSetFlags ${secClient} $0
+   SectionSetText ${secClient} $(UPGRADE_CLIENT)
+   goto skipClient
+ReinstallClient:
+       SectionGetFlags ${secClient} $0
+       IntOp $0 $0 | ${SF_SELECTED}
+       SectionSetFlags ${secClient} $0
+   SectionSetText ${secClient} $(REINSTALL_CLIENT)
+   goto skipClient
+DowngradeClient:
+       SectionGetFlags ${secClient} $0
+       IntOp $0 $0 | ${SF_SELECTED}
+       SectionSetFlags ${secClient} $0
+   SectionSetText ${secClient} $(REINSTALL_CLIENT)
+   goto skipClient
+
+   
+skipClient:   
+   
+   Call ShouldServerInstall
+   Pop $R2
+   StrCmp $R2 "0" NoServer
+   StrCmp $R2 "1" ReinstallServer
+   StrCmp $R2 "2" UpgradeServer
+   StrCmp $R2 "3" DowngradeServer
+   
+       SectionGetFlags ${secServer} $0
+       IntOp $0 $0 | ${SF_SELECTED}
+       SectionSetFlags ${secServer} $0
+       ;# !insertmacro UnselectSection ${secServer}
+   goto skipServer
+
+UpgradeServer:
+   SectionGetFlags ${secServer} $0
+   IntOp $0 $0 | ${SF_SELECTED}
+   SectionSetFlags ${secServer} $0
+   SectionSetText ${secServer} $(UPGRADE_SERVER)
+   goto skipServer
+
+ReinstallServer:
+   SectionGetFlags ${secServer} $0
+   IntOp $0 $0 | ${SF_SELECTED}
+   SectionSetFlags ${secServer} $0
+   SectionSetText ${secServer} $(REINSTALL_SERVER)
+   goto skipServer
+
+DowngradeServer:
+   SectionGetFlags ${secServer} $0
+   IntOp $0 $0 | ${SF_SELECTED}
+   SectionSetFlags ${secServer} $0
+   SectionSetText ${secServer} $(REINSTALL_SERVER)
+   goto skipServer
+   
+NoServer:
+       SectionGetFlags ${secServer} $0
+       IntOp $0 $0 & ${SECTION_OFF}
+       SectionSetFlags ${secServer} $0
+       ;# !insertmacro UnselectSection ${secServer}
+   goto skipServer
+   
+skipServer:
+   ; Check control center
+   Call IsControlInstalled
+   Pop $R2
+   StrCmp $R2 "0" NoControl
+
+       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}
 
+CheckDocs:
+   ; Check Documentation
+   Call IsDocumentationInstalled
+   Pop $R2
+   StrCmp $R2 "0" NoDocs
+       SectionGetFlags ${secDocs} $0
+       IntOp $0 $0 | ${SF_SELECTED}
+       SectionSetFlags ${secDocs} $0
+   goto end
    
-skipClient:   
+NoDocs:
+       SectionGetFlags ${secDocs} $0
+       IntOp $0 $0 & ${SECTION_OFF}
+       SectionSetFlags ${secDocs} $0
+   goto end
    
+; To check the SDK, we simply look to see if the files exist.  If they do,
+; the SDK is installed.  If not, we don't need to push it on the user.
+; If they are there, we want to make sure they match the installed version.
+CheckSDK:
+   IfFileExists "$INSTDIR\Client\Program\Include\main.h" +1 NoSDK
+   SectionGetFlags ${secSDK} $0
+   IntOp $0 $0 | ${SF_SELECTED}
+   SectionSetFlags ${secSDK} $0
+   goto end
    
-   Call IsServerInstalled
-   Pop $R2
-   StrCmp $R2 "0" NoServer
+NoSDK:
+   SectionGetFlags ${secSDK} $0
+   IntOp $0 $0 & ${SECTION_OFF}
+   SectionSetFlags ${secSDK} $0
+   goto end
    
-       SectionGetFlags ${secServer} $0
-       IntOp $0 $0 & ${SF_SELECTED}
-       SectionSetFlags ${secServer} $0
-       ;# !insertmacro UnselectSection ${secServer}
-   goto skipServer
+DefaultOptions:
+   ; Client Selected
+       SectionGetFlags ${secClient} $0
+       IntOp $0 $0 | ${SF_SELECTED}
+       SectionSetFlags ${secClient} $0
 
-NoServer:
+   ; Server NOT selected
        SectionGetFlags ${secServer} $0
        IntOp $0 $0 & ${SECTION_OFF}
        SectionSetFlags ${secServer} $0
-       ;# !insertmacro UnselectSection ${secServer}
    
-skipServer:   
+   ; Control Center NOT selected
        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}
+   
+   ; SDK not selected
+   SectionGetFlags ${secSDK} $0
+   IntOp $0 $0 & ${SECTION_OFF}
+   SectionSetFlags ${secSDK} $0
+   ;# !insertmacro UnselectSection ${secSDK}
+   
+   goto end
 
+end:
        Pop $0
   
+   Push $R0
+  
+  ; See if we can set a default installation path...
+  ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "PathName"
+  StrCmp $R0 "" TryServer
+  Push $R0
+  Call GetParent
+  Call GetParent
+  Pop $R0
+  StrCpy $INSTDIR $R0
+  goto Nope
+  
+TryServer:
+  ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "PathName"
+  StrCmp $R0 "" TryControl
+  Push $R0
+  Call GetParent
+  Pop $R0
+  StrCpy $INSTDIR $R0
+  goto Nope
+   
+TryControl:
+  ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "PathName"
+  StrCmp $R0 "" Nope
+  StrCpy $INSTDIR $R0
   
+Nope:
+  Pop $R0
   
   GetTempFilename $0
   File /oname=$0 CellServPage.ini
@@ -1069,36 +1437,55 @@ FunctionEnd
 ; These are our cleanup functions
 Function .onInstFailed
 Delete $0
-
+Delete $1
 FunctionEnd
 
 Function .onInstSuccess
 Delete $0
-
+Delete $1
 FunctionEnd
 
 
 ;--------------------------------
 ;Descriptions
 
+!ifdef v2.0b3
 !insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN
-  !insertmacro MUI_DESCRIPTION_TEXT ${SecServer} $(DESC_SecServer)
-  !insertmacro MUI_DESCRIPTION_TEXT ${SecClient} $(DESC_SecClient)
-  !insertmacro MUI_DESCRIPTION_TEXT ${SecControl} $(DESC_SecControl)
-  !insertmacro MUI_DESCRIPTION_TEXT ${SecDocs} $(DESC_SecDocs)
-!insertmacro MUI_FUNCTIONS_DESCRIPTION_END
+!else
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+!endif
+  !insertmacro MUI_DESCRIPTION_TEXT ${secServer} $(DESC_secServer)
+  !insertmacro MUI_DESCRIPTION_TEXT ${secClient} $(DESC_secClient)
+  !insertmacro MUI_DESCRIPTION_TEXT ${secControl} $(DESC_secControl)
+  !insertmacro MUI_DESCRIPTION_TEXT ${secDocs} $(DESC_secDocs)
+  !insertmacro MUI_DESCRIPTION_TEXT ${secSDK} $(DESC_secSDK)
+!ifdef v2.0b3
+  !insertmacro MUI_FUNCTIONS_DESCRIPTION_END
+!else
+  !insertmacro MUI_FUNCTION_DESCRIPTION_END
+!endif
  
 ;--------------------------------
 ;Uninstaller Section
 
 Section "Uninstall"
+  ; Make sure the user REALLY wants to do this, unless they did a silent uninstall, in which case...let them!
+#ifdef v2.0b4
+  IfSilent StartRemove     ; New in v2.0b4
+#endif
+  MessageBox MB_YESNO "Are you sure you want to remove OpenAFS from this machine?" IDYES StartRemove
+  abort
+  
+StartRemove:
   
   SetShellVarContext all
   ; Stop the running processes
   GetTempFileName $R0
   File /oname=$R0 "${AFS_WININSTALL_DIR}\Killer.exe"
   nsExec::Exec '$R0 afscreds.exe'
+!IFDEF INSTALL_KFW
   nsExec::Exec '$R0 krbcc32s.exe'
+!ENDIF
 
   ; Delete the AFS service
   GetTempFileName $R0
@@ -1106,6 +1493,9 @@ Section "Uninstall"
   nsExec::Exec "net stop TransarcAFSDaemon"
   nsExec::Exec "net stop TransarcAFSServer"
   nsExec::Exec '$R0 u TransarcAFSDaemon'
+  ; After we stop the service, but before we delete it, we have to remove the volume data
+  ; This is because the storage locations are in the registry under the service key.
+  ; Call un.RemoveAFSVolumes
   nsExec::Exec '$R0 u TransarcAFSServer'
   Delete $R0
   
@@ -1113,8 +1503,10 @@ Section "Uninstall"
   Call un.RemoveFromPath
   Push "$INSTDIR\Common"
   Call un.RemoveFromPath
+!ifdef INSTALL_KFW
   Push "$INSTDIR\kfw\bin"
   Call un.RemoveFromPath
+!endif
   
   ; Delete documentation
   Delete "$INSTDIR\Documentation\README.TXT"
@@ -1139,8 +1531,25 @@ Section "Uninstall"
    Delete /REBOOTOK "$INSTDIR\Common\afscfgadmin.dll"
    Delete /REBOOTOK "$INSTDIR\Common\afskasadmin.dll"
    Delete /REBOOTOK "$INSTDIR\Common\afsptsadmin.dll"
+
 !IFDEF DEBUG
-!IFDEF CL1310
+   Delete /REBOOTOK "$INSTDIR\Common\afs_config.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\afs_shl_ext.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\afsadminutil.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\lib\afsauthent.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\lib\afspthread.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\lib\afsrpc.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\afsclientadmin.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\afsprocmgmt.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\afsvosadmin.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\TaAfsAppLib.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\afsvosadmin.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\afsbosadmin.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\afscfgadmin.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\afskasadmin.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\afsptsadmin.pdb"
+
+!IFDEF CL_1310
    Delete /REBOOTOK "$INSTDIR\Common\msvcr71d.dll"
    Delete /REBOOTOK "$INSTDIR\Common\msvcr71d.pdb"
 !ELSE
@@ -1148,16 +1557,20 @@ Section "Uninstall"
    Delete /REBOOTOK "$INSTDIR\Common\msvcrtd.pdb"
 !ENDIF
 !ELSE
-!IFDEF CL1310
+!IFDEF CL_1310
    Delete /REBOOTOK "$INSTDIR\Common\msvcr71.dll"
 !ELSE
    Delete /REBOOTOK "$INSTDIR\Common\msvcrt.dll"
 !ENDIF
 !ENDIF
   
+!ifdef v2.0b3
    Call un.IsSilent
    Pop $R1
    StrCmp $R1 "/S" SkipAsk
+!else
+   IfSilent SkipAsk
+!endif
 ;  IfFileExists "$WINDIR\afsdcell.ini" CellExists SkipDelAsk
 ;  CellExists:
   MessageBox MB_YESNO "Would you like to keep your configuration files?" IDYES SkipDel
@@ -1165,7 +1578,10 @@ Section "Uninstall"
   Delete "$WINDIR\afsdcell.ini"
 
   Delete "$WINDIR\afsdsbmt.ini"
+; Only remove krb5.ini if KfW was installed
+!IFDEF INSTALL_KFW
   Delete "$WINDIR\krb5.ini"
+!ENDIF
   Delete "$WINDIR\afsdns.ini"
   Delete "$WINDIR\afs_freelance.ini"
   
@@ -1184,20 +1600,47 @@ Section "Uninstall"
   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\fms.exe"
   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\kaserver.exe"
   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\ptserver.exe"
-  Delete "$INSTDIR\Server\usr\afs\bin\salvager.exe"
+  Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\salvager.exe"
   Delete "$INSTDIR\Server\usr\afs\bin\ServerUninst.dll"
-  Delete "$INSTDIR\Server\usr\afs\bin\upclient.exe"
-  Delete "$INSTDIR\Server\usr\afs\bin\upserver.exe"
-  Delete "$INSTDIR\Server\usr\afs\bin\vlserver.exe"
-  Delete "$INSTDIR\Server\usr\afs\bin\volinfo.exe"
-  Delete "$INSTDIR\Server\usr\afs\bin\volserver.exe"
+  Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\upclient.exe"
+  Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\upserver.exe"
+  Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\vlserver.exe"
+  Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\volinfo.exe"
+  Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\volserver.exe"
+
+!ifdef DEBUG
+  Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\afskill.pdb"
+  Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\afssvrcfg.pdb"
+  Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\bosctlsvc.pdb"
+  Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\bosserver.pdb"
+  Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\buserver.pdb"
+  Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\butc.pdb"
+  Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\fileserver.pdb"
+  Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\fms.pdb"
+  Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\kaserver.pdb"
+  Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\ptserver.pdb"
+  Delete "$INSTDIR\Server\usr\afs\bin\salvager.pdb"
+  Delete "$INSTDIR\Server\usr\afs\bin\ServerUninst.pdb"
+  Delete "$INSTDIR\Server\usr\afs\bin\upclient.pdb"
+  Delete "$INSTDIR\Server\usr\afs\bin\upserver.pdb"
+  Delete "$INSTDIR\Server\usr\afs\bin\vlserver.pdb"
+  Delete "$INSTDIR\Server\usr\afs\bin\volinfo.pdb"
+  Delete "$INSTDIR\Server\usr\afs\bin\volserver.pdb"
+!endif
+
   RMDir /r "$INSTDIR\Server\usr\afs\bin"
+  RmDir /r "$INSTDIR\Server\usr\afs\etc\logs"
   RmDir /r "$INSTDIR\Server\usr\afs\etc"
   RmDir /r "$INSTDIR\Server\usr\afs\local"
   RMDIR /r "$INSTDIR\Server\usr\afs\logs"
   
-  Delete /REBOOTOK "$WINDIR\afsserver.cpl"
-  Delete /REBOOTOK "$WINDIR\afs_cpa.cpl"
+  Delete /REBOOTOK "$SYSDIR\afsserver.cpl"
+  Delete /REBOOTOK "$SYSDIR\afs_cpa.cpl"
+
+!ifdef DEBUG
+  Delete /REBOOTOK "$SYSDIR\afsserver.pdb"
+  Delete /REBOOTOK "$SYSDIR\afs_cpa.pdb"
+!endif
   
   RMDir /r "$INSTDIR\Documentation\html\CmdRef"
   RMDir /r "$INSTDIR\Documentation\html\InstallGd"
@@ -1208,6 +1651,11 @@ Section "Uninstall"
   RMDir "$INSTDIR\Documentation"
   ; Delete DOC short cut
   Delete /REBOOTOK "$INSTDIR\Client\Program\afscreds.exe"
+
+!ifdef DEBUG
+  Delete /REBOOTOK "$INSTDIR\Client\Program\afscreds.pdb"
+!endif
+
   Delete /REBOOTOK "$INSTDIR\Client\Program\*"
   Delete /REBOOTOK "$INSTDIR\Client\Program\Include\*"
   Delete /REBOOTOK "$INSTDIR\Client\Program\Include\afs\*"
@@ -1221,7 +1669,7 @@ Section "Uninstall"
   RMDir  "$INSTDIR\Client"
   
 !IFDEF DEBUG
-!IFDEF CL1310
+!IFDEF CL_1310
   Delete /REBOOTOK "$INSTDIR\Common\msvcr71d.dll"
   Delete /REBOOTOK "$INSTDIR\Common\msvcr71d.pdb"
 !ELSE
@@ -1229,7 +1677,7 @@ Section "Uninstall"
   Delete /REBOOTOK "$INSTDIR\Common\msvcrtd.pdb"
 !ENDIF
 !ELSE
-!IFDEF CL1310
+!IFDEF CL_1310
   Delete /REBOOTOK "$INSTDIR\Common\msvcr71.dll"
 !ELSE
   Delete /REBOOTOK "$INSTDIR\Common\msvcrt.dll"
@@ -1238,12 +1686,14 @@ Section "Uninstall"
   Delete /REBOOTOK "$INSTDIR\Common\*"
   RMDir "$INSTDIR\Common"
 
+!ifdef INSTALL_KFW
   ;Remove KfW files
   Delete /REBOOTOK "$INSTDIR\kfw\bin\*"
   RMDIR  /r "$INSTDIR\kfw\bin"
   Delete /REBOOTOK "$INSTDIR\kfw\doc\*"
   RMDIR  /r "$INSTDIR\kfw\doc"
   RMDIR  /r "$INSTDIR\kfw"
+!endif
 
   Delete "$SMPROGRAMS\OpenAFS\Documentation.lnk"
 
@@ -1252,6 +1702,11 @@ Section "Uninstall"
   Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsAdmSvr.exe"
   Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsServerManager.exe"
   Delete /REBOOTOK "$INSTDIR\Control Center\CCUninst.dll"
+!ifdef DEBUG
+  Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsAccountManager.pdb"
+  Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsAdmSvr.pdb"
+  Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsServerManager.pdb"
+!endif
   RMDir  "$INSTDIR\Control Center"
   
   Delete "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk"
@@ -1288,8 +1743,10 @@ Section "Uninstall"
  
   RMDir  "$INSTDIR"
 
+!ifdef v2.0b3
   ;Display the Finish header
   !insertmacro MUI_UNFINISHHEADER
+!endif
 
 SectionEnd
 
@@ -1315,24 +1772,35 @@ FunctionEnd
 Function afs.GetCellServDB
 
 ;Check if we should download CellServDB
-;ReadINIStr $R0 $0 "Field 4" "State"
-;StrCmp $R0 "0" CheckIncl
+ReadINIStr $R0 $0 "Field 4" "State"
+StrCmp $R0 "1" DoDownload
+
+;Do nothing if we're keeping the existing file
+ReadINIStr $R0 $0 "Field 2" "State"
+StrCmp $R0 "1" done
 
+ReadINIStr $R0 $0 "Field 3" "State"
+StrCmp $R0 "1" UsePackaged
+
+; If none of these, grab file from other location
+goto CheckOther
+
+DoDownload:
    ReadINIStr $R0 $0 "Field 5" "State"
    NSISdl::download $R0 "$WINDIR\afsdcell.ini"
    Pop $R0 ;Get the return value
    StrCmp $R0 "success" +2
       MessageBox MB_OK|MB_ICONSTOP "Download failed: $R0"
    goto done
-CheckIncl:
-   ReadINIStr $R0 $0 "Field 3" "State"
-   StrCmp $R0 "0" CheckOther
+
+UsePackaged:
    SetOutPath "$WINDIR"
    File "afsdcell.ini"
    goto done
    
 CheckOther:
    ReadINIStr $R0 $0 "Field 7" "State"
+   StrCmp $R0 "1" +1 done
    CopyFiles $R0 "$WINDIR\afsdcell.ini"
    
 done:
@@ -1345,11 +1813,26 @@ FunctionEnd
 ;Do the page to get the CellServDB
 
 Function AFSPageGetCellServDB
+  ; Skip this page if we are not installing the client
+  SectionGetFlags ${secClient} $R0
+  IntOp $R0 $R0 & ${SF_SELECTED}
+  StrCmp $R0 "0" Skip
+  
   ; Set the install options here
   
 startOver:
   WriteINIStr $0 "Field 2" "Flags" "DISABLED"
   WriteINIStr $0 "Field 3" "State" "1"
+  WriteINISTR $0 "Field 4" "State" "0"
+  WriteINIStr $0 "Field 6" "State" "0"
+  
+  ; If there is an existing afsdcell.ini file, allow the user to choose it and make it default
+  IfFileExists "$WINDIR\afsdcell.ini" +1 notpresent
+  WriteINIStr $0 "Field 2" "Flags" "ENABLED"
+  WriteINIStr $0 "Field 2" "State" "1"
+  WriteINIStr $0 "Field 3" "State" "0"
+  
+  notpresent:
   
   !insertmacro MUI_HEADER_TEXT "CellServDB Configuration" "Please choose a method for installing the CellServDB file:" 
   InstallOptions::dialog $0
@@ -1360,10 +1843,22 @@ startOver:
 exit: Quit
 done:
 
-   ; Check that if a file is set, a filename is entered...
+   ; Check that if a file is set, a valid filename is entered...
    ReadINIStr $R0 $0 "Field 6" "State"
-   StrCmp $R0 "1" CheckFileName Skip
-CheckFileName:
+   StrCmp $R0 "1" CheckFileName
+   
+   ;Check if a URL is specified, one *IS* specified
+   ReadINIStr $R0 $0 "Field 4" "State"
+   StrCmp $R0 "1" CheckURL Skip
+   
+   CheckURL:
+   ReadINIStr $R0 $0 "Field 5" "State"
+   StrCmp $R0 "" +1 Skip
+   MessageBox MB_OK|MB_ICONSTOP $(URLError)
+   WriteINIStr $0 "Field 4" "State" "0"
+   goto startOver
+   
+   CheckFileName:
    ReadINIStr $R0 $0 "Field 7" "State"
    IfFileExists $R0 Skip
 
@@ -1377,10 +1872,40 @@ FunctionEnd
 
 
 Function AFSPageGetCellName
+!ifdef v2.0b3
    Call IsSilent
    Pop $R1
    StrCmp $R1 "/S" exit
-  !insertmacro MUI_HEADER_TEXT "Cell Name Configuration" "Please enter the name for your default cell:" 
+!else
+   IfSilent good
+!endif
+  ; Skip this page if we are not installing the client
+  SectionGetFlags ${secClient} $R0
+  IntOp $R0 $R0 & ${SF_SELECTED}
+  StrCmp $R0 "0" good
+  
+startOver:
+   ; If this is a server install, we do NOT want to recommend the Freelance client
+   ; And we do not need to ask for the cell name.
+   SectionGetFlags ${secServer} $R1
+   IntOp $R1 $R1 & ${SF_SELECTED}
+   StrCmp $R1 "1" +1 NotServer
+   WriteINIStr $1 "Field 6" "Text" "Enable AFS Freelance client (Not Recommended for servers)"
+   WriteINIStr $1 "Field 5" "State" "0"
+   WriteINIStr $1 "Field 1" "Flags" "DISABLED"
+   WriteINIStr $1 "Field 2" "Flags" "DISABLED"
+   goto SkipServerTest
+NotServer:
+   WriteINIStr $1 "Field 6" "Text" "Enable AFS Freelance client (Recommended)"
+   WriteINIStr $1 "Field 5" "State" "1"
+   WriteINIStr $1 "Field 1" "Flags" ""
+   WriteINIStr $1 "Field 2" "Flags" ""
+SkipServerTest:
+   ; Get the current cell name, if any
+   ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "Cell"
+   StrCmp $R1 "" +2
+   WriteINIStr $1 "Field 2" "State" $R1
+  !insertmacro MUI_HEADER_TEXT "Client Cell Name Configuration" "Please enter the name for your default cell:" 
   InstallOptions::dialog $1
   Pop $R1
   StrCmp $R1 "cancel" exit
@@ -1388,6 +1913,12 @@ Function AFSPageGetCellName
   StrCmp $R1 "success" done
 exit: Quit
 done:
+   ReadINIStr $R0 $1 "Field 2" "State"
+   StrCmp $R0 "" +1 good
+   
+   MessageBox MB_OK|MB_ICONSTOP $(CellNameError)
+   goto startOver
+good:
 FunctionEnd
 
 ;-------------
@@ -1396,12 +1927,17 @@ Function AFSCommon.Install
 
 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayName" "OpenAFS for Windows"
 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "UninstallString" "$INSTDIR\uninstall.exe"
-WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayVersion" "${MUI_VERSION}"
+!ifndef DEBUG
+WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayVersion" "${AFS_VERSION}"
+!else
+WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayVersion" "${AFS_VERSION} Checked/Debug"
+!endif
 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "URLInfoAbout" "http://www.openafs.org/"
 
 FunctionEnd
 
-
+; This code is all needed in v2.0b3 to handle the /S switch...
+!ifdef v2.0b3
 ; Check if install should be silent
 Function IsSilent
   Push $0
@@ -1419,7 +1955,6 @@ Function IsSilent
 FunctionEnd
 
 
-
 ; Check if uninstall should be silent
 Function un.IsSilent
   Push $0
@@ -1467,6 +2002,9 @@ Function StrStr
   Pop $R2
   Exch $R1
 FunctionEnd
+!endif
+; End of specific v2.0b3 code...
+
 
 ;-------------------
 ; Get the currently installed version and place it on the stack
@@ -1476,12 +2014,70 @@ Function GetInstalledVersion
    Push $R1
    Push $R4
    
-   ReadRegDWORD $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "VersionString"
-   StrCmp $R0 "" NotTransarc
+   ReadRegStr $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "VersionString"
+   StrCmp $R0 "" NotTransarc done
+   
+   
+NotTransarc:
+   ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "VersionString"
+   StrCmp $R0 "" done
+   
+done:
+   Pop $R4
+   Pop $R1
+   Exch $R0
+FunctionEnd
+
+; Functions to get each component of the version number
+Function GetInstalledVersionMajor
+   Push $R0
+   Push $R1
+   Push $R4
+   
+   ReadRegDWORD $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "MajorVersion"
+   StrCmp $R0 "" NotTransarc done
+   
+   
+NotTransarc:
+   ReadRegDWORD $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "MajorVersion"
+   StrCmp $R0 "" done
+   
+done:
+   Pop $R4
+   Pop $R1
+   Exch $R0
+FunctionEnd
+
+Function GetInstalledVersionMinor
+   Push $R0
+   Push $R1
+   Push $R4
+   
+   ReadRegDWORD $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "MinorVersion"
+   StrCmp $R0 "" NotTransarc done
+   
+   
+NotTransarc:
+   ReadRegDWORD $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "MinorVersion"
+   StrCmp $R0 "" done
+   
+done:
+   Pop $R4
+   Pop $R1
+   Exch $R0
+FunctionEnd
+
+Function GetInstalledVersionPatch
+   Push $R0
+   Push $R1
+   Push $R4
+   
+   ReadRegDWORD $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "PatchLevel"
+   StrCmp $R0 "" NotTransarc done
    
    
 NotTransarc:
-   ReadRegDWORD $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "VersionString"
+   ReadRegDWORD $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "PatchLevel"
    StrCmp $R0 "" done
    
 done:
@@ -1491,28 +2087,100 @@ done:
 FunctionEnd
 
 
+
 ;-------------------------------
 ; Check if the client should be checked for default install
 Function ShouldClientInstall
    Push $R0
-   StrCpy $R2 "Client"
+   StrCpy $R2 "AFS Client"
    Call GetInstalledVersion
    Pop $R0
    
    StrCmp $R0 "" NotInstalled
+   ; Now we see if it's an older or newer version
+
+   Call GetInstalledVersionMajor
+   Pop $R0
+   IntCmpU $R0 ${AFS_MAJORVERSION} +1 Upgrade Downgrade
+
+   Call GetInstalledVersionMinor
+   Pop $R0
+   IntCmpU $R0 ${AFS_MINORVERSION} +1 Upgrade Downgrade
    
-   StrCpy $R0 "0"
+   Call GetInstalledVersionPatch
+   Pop $R0
+   IntCmpU $R0 ${AFS_PATCHLEVEL} Reinstall Upgrade Downgrade
+   
+Reinstall:
+   StrCpy $R0 "1"
+   Exch $R0
+   goto end
+   
+Upgrade:
+   StrCpy $R0 "2"
+   Exch $R0
+   goto end
+   
+Downgrade:
+   StrCpy $R0 "3"
    Exch $R0
    goto end
    
+   
 NotInstalled:
+   StrCpy $R0 "0"
+   Exch $R0
+end:   
+FunctionEnd
+
+;-------------------------------
+; Check how the server options should be set
+Function ShouldServerInstall
+   Push $R0
+   StrCpy $R2 "AFS Server"
+   Call GetInstalledVersion
+   Pop $R0
+   
+   StrCmp $R0 "" NotInstalled
+   ; Now we see if it's an older or newer version
+
+   Call GetInstalledVersionMajor
+   Pop $R0
+   IntCmpU $R0 ${AFS_MAJORVERSION} +1 Upgrade Downgrade
+
+   Call GetInstalledVersionMinor
+   Pop $R0
+   IntCmpU $R0 ${AFS_MINORVERSION} +1 Upgrade Downgrade
+   
+   Call GetInstalledVersionPatch
+   Pop $R0
+   IntCmpU $R0 ${AFS_PATCHLEVEL} Reinstall Upgrade Downgrade
+   
+Reinstall:
    StrCpy $R0 "1"
    Exch $R0
+   goto end
+   
+Upgrade:
+   StrCpy $R0 "2"
+   Exch $R0
+   goto end
+   
+Downgrade:
+   StrCpy $R0 "3"
+   Exch $R0
+   goto end
+   
+   
+NotInstalled:
+   StrCpy $R0 "0"
+   Exch $R0
 end:   
 FunctionEnd
 
 
-; See if AFS Client is installed
+; See if AFS Server is installed
+; Returns: "1" if it is, 0 if it is not (on the stack)
 Function IsServerInstalled
    Push $R0
    StrCpy $R2 "AFS Server"
@@ -1532,7 +2200,8 @@ end:
 FunctionEnd
 
 
-; See if AFS Server is installed
+; See if AFS Client is installed
+; Returns: "1" if it is, 0 if it is not (on the stack)
 Function IsClientInstalled
    Push $R0
    StrCpy $R2 "AFS Client"
@@ -1554,6 +2223,7 @@ FunctionEnd
 
 
 ; See if AFS Documentation is installed
+; Returns: "1" if it is, 0 if it is not (on the stack)
 Function IsDocumentationInstalled
    Push $R0
    StrCpy $R2 "AFS Supplemental Documentation"
@@ -1573,10 +2243,11 @@ end:
 FunctionEnd
 
 
-; See if COntrol Center is installed
+; See if Control Center is installed
+; Returns: "1" if it is, 0 if it is not (on the stack)
 Function IsControlInstalled
    Push $R0
-   StrCpy $R2 "Control_Center"
+   StrCpy $R2 "AFS Control Center"
    Call GetInstalledVersion
    Pop $R0
    
@@ -1625,8 +2296,35 @@ FunctionEnd
 
 
 ;Check to see if any AFS component is installed
+;Returns: Value on stack: "1" if it is, "0" if it is not
 Function IsAnyAFSInstalled
-
+   Push $R0
+   Push $R1
+   Push $R2
+   Push $R3
+   Call IsClientInstalled
+   Pop $R0
+   Call IsServerInstalled
+   Pop $R1
+   Call IsControlInstalled
+   Pop $R2
+   Call IsDocumentationInstalled
+   Pop $R3
+   ; Now we must see if ANY of the $Rn values are 1
+   StrCmp $R0 "1" SomethingInstalled
+   StrCmp $R1 "1" SomethingInstalled
+   StrCmp $R2 "1" SomethingInstalled
+   StrCmp $R3 "1" SomethingInstalled
+   ;Nothing installed
+   StrCpy $R0 "0"
+   goto end
+SomethingInstalled:
+   StrCpy $R0 "1"
+end:
+   Pop $R3
+   Pop $R2
+   Pop $R1
+   Exch $R0
 FunctionEnd
 
 
@@ -1650,7 +2348,7 @@ Function AFSLangFiles
    File "${AFS_SERVER_BUILDDIR}\afskasadmin.dll"
    File "${AFS_SERVER_BUILDDIR}\afsptsadmin.dll"
 !IFDEF DEBUG
-!IFDEF CL1310
+!IFDEF CL_1310
    File "${AFS_WININSTALL_DIR}\msvcr71d.dll"
    File "${AFS_WININSTALL_DIR}\msvcr71d.pdb"
 !ELSE
@@ -1658,7 +2356,7 @@ Function AFSLangFiles
    File "${AFS_WININSTALL_DIR}\msvcrtd.pdb"
 !ENDIF
 !ELSE
-!IFDEF CL1310
+!IFDEF CL_1310
    File "${AFS_WININSTALL_DIR}\msvcr71.dll"
 !ELSE
    File "${AFS_WININSTALL_DIR}\msvcrt.dll"
@@ -1687,7 +2385,9 @@ Function AFSLangFiles
    StrCmp $LANGUAGE ${LANG_GERMAN} DoGerman
    StrCmp $LANGUAGE ${LANG_SPANISH} DoSpanish
    StrCmp $LANGUAGE ${LANG_JAPANESE} DoJapanese
-   ;StrCmp $LANGUAGE ${LANG_KOREAN} DoKorean
+!ifdef v2.0b4
+   StrCmp $LANGUAGE ${LANG_KOREAN} DoKorean
+!endif
    StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} DoPortugueseBR
    StrCmp $LANGUAGE ${LANG_SIMPCHINESE} DoSimpChinese
    StrCmp $LANGUAGE ${LANG_TRADCHINESE} DoTradChinese
@@ -1764,7 +2464,7 @@ DoGerman:
    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1033.pdb"
    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1033.pdb"
    ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1033.pdb"
-!IFDEF CL1310
+!IFDEF CL_1310
    File "${AFS_WININSTALL_DIR}\msvcr71d.dll"
    File "${AFS_WININSTALL_DIR}\msvcr71d.pdb"
 !ELSE
@@ -2159,6 +2859,7 @@ Function un.IsNT
     Push 1
 FunctionEnd
 
+!ifdef ADDSHAREDDLLUSED
 ; AddSharedDLL
  ;
  ; Increments a shared DLLs reference count.
@@ -2211,18 +2912,20 @@ FunctionEnd
    Pop $R0
    Pop $R1
  FunctionEnd
+!endif
 
- Function afs.InstallMSLoopback
-   ;GetTempFileName $R0
-   ;File /oname=$R0 "loopback_install.dll"
-   ;nsExec::Exec "rundll32.exe $R0 doLoopBackEntry quiet"
-   ;Call GetWindowsVersion
-   ;Pop $R1
-   ;StrCmp $R1 "2000" +1 +2
-   ;nsExec::Exec "rundll32.exe $R0 disableLoopBackEntry"
-   ;Delete $R0
+!ifdef INSTALL_LOOPBACK
+Function afs.InstallMSLoopback
+   GetTempFileName $R0
+   File /oname=$R0 "loopback_install.dll"
+   nsExec::Exec "rundll32.exe $R0 doLoopBackEntry quiet"
+   Call GetWindowsVersion
+   Pop $R1
+   StrCmp $R1 "2000" +1 +2
+   nsExec::Exec "rundll32.exe $R0 disableLoopBackEntry"
+   Delete $R0
 FunctionEnd
-
+!endif
 
 
 ; GetWindowsVersion
@@ -2368,3 +3071,66 @@ Pop $R2
 Pop $R1
 Exch $R0
 FunctionEnd
+
+; GetParent
+ ; input, top of stack  (e.g. C:\Program Files\Poop)
+ ; output, top of stack (replaces, with e.g. C:\Program Files)
+ ; modifies no other variables.
+ ;
+ ; Usage:
+ ;   Push "C:\Program Files\Directory\Whatever"
+ ;   Call GetParent
+ ;   Pop $R0
+ ;   ; at this point $R0 will equal "C:\Program Files\Directory"
+
+Function GetParent
+
+  Exch $R0
+  Push $R1
+  Push $R2
+  Push $R3
+  
+  StrCpy $R1 0
+  StrLen $R2 $R0
+  
+  loop:
+    IntOp $R1 $R1 + 1
+    IntCmp $R1 $R2 get 0 get
+    StrCpy $R3 $R0 1 -$R1
+    StrCmp $R3 "\" get
+  Goto loop
+  
+  get:
+    StrCpy $R0 $R0 -$R1
+    
+    Pop $R3
+    Pop $R2
+    Pop $R1
+    Exch $R0
+    
+FunctionEnd
+
+
+;--------------------------------
+;Handle what must and what must not be installed
+Function .onSelChange
+   ; If they install the server, they MUST install the client
+   SectionGetFlags ${secServer} $R0
+   IntOp $R0 $R0 & ${SF_SELECTED}
+   StrCmp $R0 "1" MakeClientSelected
+   
+   ; If they install the control center, we'll give them the client.
+   ; It may not be required, but it's a bit more useful
+   SectionGetFlags ${secControl} $R0
+   IntOp $R0 $R0 & ${SF_SELECTED}
+   StrCmp $R0 "1" MakeClientSelected
+   goto end
+   
+MakeClientSelected:
+   SectionGetFlags ${secClient} $R0
+   IntOp $R0 $R0 | ${SF_SELECTED}
+   SectionSetFlags ${secClient} $R0
+   
+end:
+FunctionEnd
+