windows-install-20090527
[openafs.git] / src / WINNT / install / NSIS / OpenAFS.nsi
index 691f7ea..aea4201 100644 (file)
@@ -1,5 +1,6 @@
-;OpenAFS Install Script for NSIS
-;                             This version compiles with NSIS v2.0
+!define RELEASE 1
+; OpenAFS Install Script for NSIS
+; This version compiles with NSIS v2.07
 ;
 ; Originally written by Rob Murawski <rsm4@ieee.org>
 ;
@@ -49,7 +50,7 @@ VIAddVersionKey "CompanyName" "OpenAFS.org"
 VIAddVersionKey "ProductVersion" ${AFS_VERSION}
 VIAddVersionKey "FileVersion" ${AFS_VERSION}
 VIAddVersionKey "FileDescription" "OpenAFS for Windows Installer"
-VIAddVersionKey "LegalCopyright" "(C)2000-2004"
+VIAddVersionKey "LegalCopyright" "(C)2000-2008"
 !ifdef DEBUG
 VIAddVersionKey "PrivateBuild" "Checked/Debug"
 !endif               ; End DEBUG
@@ -64,18 +65,27 @@ VIAddVersionKey "PrivateBuild" "Checked/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
-  !define MUI_ICON "..\..\client_config\afs_config.ico"
-  !define MUI_UNICON "..\..\client_config\afs_config.ico"
+  SetCompressor /solid lzma
+  !define MUI_ICON "..\..\client_config\OpenAFS.ico"
+  !define MUI_UNICON "..\..\client_config\OpenAFS.ico"
   !define AFS_COMPANY_NAME "OpenAFS"
   !define AFS_PRODUCT_NAME "OpenAFS"
   !define AFS_REGKEY_ROOT "Software\TransarcCorporation"
+  !define NID_PLUGIN_MGR  "Software\MIT\NetIDMgr\PluginManager"
   CRCCheck force
 
   ;Folder selection page
@@ -101,7 +111,7 @@ VIAddVersionKey "PrivateBuild" "Checked/Debug"
 ;--------------------------------
 ;Modern UI Configuration
 
-  ;!define MUI_LICENSEPAGE
+  !define MUI_LICENSEPAGE
   !define MUI_CUSTOMPAGECOMMANDS
   !define MUI_WELCOMEPAGE
   !define MUI_COMPONENTSPAGE
@@ -116,6 +126,7 @@ VIAddVersionKey "PrivateBuild" "Checked/Debug"
   
   
   !insertmacro MUI_PAGE_WELCOME
+  !insertmacro MUI_PAGE_LICENSE "Licenses.rtf"
   !insertmacro MUI_PAGE_COMPONENTS
   !insertmacro MUI_PAGE_DIRECTORY
   Page custom AFSPageGetCellServDB
@@ -124,7 +135,6 @@ VIAddVersionKey "PrivateBuild" "Checked/Debug"
   !insertmacro MUI_PAGE_INSTFILES
   !insertmacro MUI_PAGE_FINISH
   
-  ;LicenseData "Licenses.rtf"
 ;--------------------------------
 ;Languages
 
@@ -317,6 +327,9 @@ VIAddVersionKey "PrivateBuild" "Checked/Debug"
   ReserveFile "AFSCell.ini"
   !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions plug-in
   !insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog
+
+  RequestExecutionLevel admin
+
 ;--------------------------------
 ; Macros
 ; Macro - Upgrade DLL File
@@ -483,6 +496,7 @@ var REG_VALUE
 var REG_DATA_1
 var REG_DATA_2
 var REG_DATA_3
+var REG_DATA_4
 
 
 ;--------------------------------
@@ -490,7 +504,7 @@ var REG_DATA_3
 
 ;----------------------
 ; OpenAFS CLIENT
-Section "AFS Client" secClient
+Section "!AFS Client" secClient
 
   SetShellVarContext all
 
@@ -517,22 +531,34 @@ Section "AFS Client" secClient
   nsExec::Exec "net stop TransarcAFSDaemon"
   nsExec::Exec "net stop TransarcAFSServer"
   
+  ; Install the Microsoft IDNM Redistributable
+  Call GetWindowsVersion
+  Pop $R1
+  StrCmp $R1 "XP" installIDN +1
+  StrCmp $R1 "2003" installIDN skipIDN
+  installIDN:
+  GetTempFileName $R0
+  File /oname=$R0 "${IDNMREDIST}"
+  nsExec::Exec '$R0 /quiet /norestart'
+  skipIDN:  
+
    ; Do client components
   SetOutPath "$INSTDIR\Client\Program"
   File "${AFS_CLIENT_BUILDDIR}\afsshare.exe"
   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\libosi.dll" "$INSTDIR\Client\Program\libosi.dll" "$INSTDIR"
-  !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\libafsconf.dll" "$INSTDIR\Client\Program\libafsconf.dll" "$INSTDIR"
   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_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}\afscreds.exe"           "$INSTDIR\Client\Program\afscreds.exe"    "$INSTDIR"
   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext.dll" "$INSTDIR\Client\Program\afs_shl_ext.dll" "$INSTDIR"
-  File "${AFS_CLIENT_BUILDDIR}\afsd_service.exe"
+  !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afsd_service.exe" "$INSTDIR\Client\Program\afsd_service.exe" "$INSTDIR"
   File "${AFS_CLIENT_BUILDDIR}\symlink.exe"
   File "${AFS_DESTDIR}\bin\kpasswd.exe"
-  File "${AFS_SERVER_BUILDDIR}\pts.exe"
+  File "${AFS_DESTDIR}\bin\pts.exe"
   File "${AFS_SERVER_BUILDDIR}\bos.exe"
   File "${AFS_SERVER_BUILDDIR}\kas.exe"
   File "${AFS_SERVER_BUILDDIR}\vos.exe"
@@ -541,15 +567,30 @@ Section "AFS Client" secClient
   File "${AFS_DESTDIR}\etc\rxdebug.exe"
   File "${AFS_DESTDIR}\etc\backup.exe"
   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa.cpl" "$INSTDIR\Client\Program\afs_cpa.cpl" "$INSTDIR"
+  !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscred.dll" "$INSTDIR\Client\Program\afscred.dll" "$INSTDIR"
+  !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscred_en_us.dll" "$INSTDIR\Client\Program\afscred_en_us.dll" "$INSTDIR"
+  File "${AFS_CLIENT_BUILDDIR}\afsplhlp.chm"
   
-  SetOutPath "$SYSDIR"
-  !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afslogon.dll" "$SYSDIR\afslogon.dll" "$INSTDIR"
-   
+  !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afslogon.dll" "$INSTDIR\Client\Program\afslogon.dll" "$INSTDIR"
+  File "${AFS_CLIENT_BUILDDIR}\afscpcc.exe"
+
+  ; Remove the binaries from the old location if present
+  Delete /REBOOTOK "$INSTDIR\Client\Program\libafsconf.dll"
+  Delete "$INSTDIR\Client\Program\libafsconf.pdb"
+  Delete /REBOOTOK "$SYSDIR\afslogon.dll"
+  Delete "$SYSDIR\afscpcc.exe"
+  Delete "$SYSDIR\afslogon.pdb"
+  Delete "$SYSDIR\afscpcc.pdb"
+
    Call AFSLangFiles
 
   ; Get AFS CellServDB file
   Call afs.GetCellServDB
 
+  GetTempFileName $R0
+  File /oname=$R0 "${AFS_WININSTALL_DIR}\AdminGroup.exe"
+  nsExec::Exec '$R0 -create'
+
 !ifdef INSTALL_KFW
   ; Include Kerberos for Windows files in the installer...
   SetOutPath "$INSTDIR\kfw\bin\"
@@ -570,6 +611,10 @@ Section "AFS Client" secClient
   WriteRegStr HKCR "FOLDER\shellex\ContextMenuHandlers\AFS Client Shell Extension" "" "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"
   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}" "AFS Client Shell Extension"
   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cpls" "afs_cpa" "$INSTDIR\Client\Program\afs_cpa.cpl"
+
+  ; Support for apps that wrote submount data directly to afsdsbmt.ini
+  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\afsdsbmt.ini" "AFS Mappings" "USR:Software\OpenAFS\Client\mappings"
+  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\afsdsbmt.ini" "AFS Submounts" "SYS:OpenAFS\Client\Submounts"
   
   ; AFS Reg entries
   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion"
@@ -598,6 +643,18 @@ Section "AFS Client" secClient
    DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "Debug"
 !endif
 
+  ;NetIDMgr Plug-in Reg Entries
+  WriteRegStr HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS" "ImagePath" "$INSTDIR\Client\Program\afscred.dll"
+  WriteRegStr HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS" "Description" "OpenAFS Module"
+  WriteRegStr HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS" "Vendor" "Secure Endpoints Inc."
+  WriteRegStr HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS" "PluginList" "AfsCred"
+  WriteRegDWORD HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS" "NoUnload" "1"
+  
+  WriteRegStr HKLM "${NID_PLUGIN_MGR}\Plugins\AfsCred" "Module" "OpenAFS"
+  WriteRegStr HKLM "${NID_PLUGIN_MGR}\Plugins\AfsCred" "Description" "AFS Credentials Provider"
+  WriteRegStr HKLM "${NID_PLUGIN_MGR}\Plugins\AfsCred" "Dependencies" "Krb5Cred"
+  WriteRegDWORD HKLM "${NID_PLUGIN_MGR}\Plugins\AfsCred" "Type" "1"
+
    ; On Windows 2000 work around KB301673.  This is fixed in Windows XP and 2003
    Call GetWindowsVersion
    Pop $R1
@@ -625,7 +682,7 @@ Section "AFS Client" secClient
   ReadINIStr $R1 $2 "Field 13" "State"
   StrCmp $R1 "1" +1 +2
   StrCpy $R2 "$R2-S"
-  
   WriteRegStr HKLM "SOFTWARE\OpenAFS\Client" "AfscredsShortcutParams" "$R2"
   
   CreateShortCut "$SMPROGRAMS\OpenAFS\Client\Authentication.lnk" "$INSTDIR\Client\Program\afscreds.exe" "$R2"
@@ -649,6 +706,7 @@ Section "AFS Client" secClient
   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
  
@@ -656,13 +714,17 @@ Section "AFS Client" secClient
   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 "System32\DRIVERS\afsrdr.sys" "AFS Redirector"'
+!endif
 skipremove:
   Delete "$INSTDIR\Common\service.exe"
 
   ; Daemon entries
   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon" "" ""
-  WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "ProviderPath" "$SYSDIR\afslogon.dll"
-  WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "AuthentProviderPath" "$SYSDIR\afslogon.dll"
+  WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "ProviderPath" "$INSTDIR\Client\Program\afslogon.dll"
+  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" "VerboseLogging" 10
 
@@ -687,7 +749,7 @@ skipremove:
   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "UseDNS" $R0
   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "NetbiosName" "AFS"
   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "MountRoot" "/afs"
-  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "RxMaxMTU" 1260
+  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "RxMaxMTU" 0
   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "IsGateway" 0
   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "HideDotFiles" 1
 
@@ -700,31 +762,55 @@ skipremove:
   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" "DLLName" "$INSTDIR\Client\Program\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"
 
+; No longer install KFW Logon Handler - KFW 3.1 and above supports this functionality
+;  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
 
@@ -733,7 +819,7 @@ SectionEnd
 
 ;------------------------
 ; OpenAFS SERVER  
-Section "AFS Server" secServer
+Section /o "AFS Server" secServer
 
   SetShellVarContext all
 
@@ -769,6 +855,7 @@ skipCheck:
   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"
@@ -783,6 +870,8 @@ skipCheck:
   File "${AFS_SERVER_BUILDDIR}\vlserver.exe"
   File "${AFS_SERVER_BUILDDIR}\volinfo.exe"
   File "${AFS_SERVER_BUILDDIR}\volserver.exe"
+  File "${AFS_DESTDIR}\bin\ptclient.exe"
+  File "${AFS_DESTDIR}\bin\pt_util.exe"
  
  ;AFS Server common files
  SetOutPath "$INSTDIR\Common"
@@ -841,7 +930,7 @@ skipCheck:
   IfFileExists "$INSTDIR\Server\usr\afs\etc\ThisCell" SkipStartup
 
   ; Make the server config wizard auto-start on bootup if this is an install (not an upgrade)
-  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" "AFS Server Wizard" '"$INSTDIR\Server\usr\afs\bin\afssvrcfg.exe" /wizard"'
+  ; WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" "AFS Server Wizard" '"$INSTDIR\Server\usr\afs\bin\afssvrcfg.exe" /wizard"'
   
   
 SkipStartup:
@@ -849,19 +938,34 @@ SkipStartup:
   ;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"
+
+  strcpy $REG_SUB_KEY "SYSTEM\CurrentControlSet\Services\TransarcAFSServer" 
+  strcpy $REG_VALUE   "DependOnGroup" 
+  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\TransarcAFSServer" 
+  strcpy $REG_VALUE   "DependOnService" 
+  strcpy $REG_DATA_1  "Tcpip"
+  strcpy $REG_DATA_2  ""
+  strcpy $REG_DATA_3  ""
+  strcpy $REG_DATA_4  ""
+  Call RegWriteMultiStr
   
-  CreateDirectory "$SMPROGRAMS\OpenAFS\Server"
-  CreateShortCut "$SMPROGRAMS\OpenAFS\Server\Server Configuration.lnk" "$INSTDIR\Server\usr\afs\bin\afssvrcfg.exe"
-  
+  ;CreateDirectory "$SMPROGRAMS\OpenAFS\Server"
+  ;CreateShortCut "$SMPROGRAMS\OpenAFS\Server\Server Configuration.lnk" "$INSTDIR\Server\usr\afs\bin\afssvrcfg.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
 
@@ -901,13 +1005,14 @@ Section "AFS Control Center" secControl
   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
@@ -921,119 +1026,78 @@ Section "Supplemental Documentation" secDocs
    
    
 DoEnglish:
-   SetOutPath "$INSTDIR\Documentation\html"
-   File "..\..\doc\install\Documentation\en_US\html\*"
    SetOutPath "$INSTDIR\Documentation\html\CmdRef"
-   File "..\..\doc\install\Documentation\en_US\html\CmdRef\*"
-   SetOutPath "$INSTDIR\Documentation\html\InstallGd"
-   File "..\..\doc\install\Documentation\en_US\html\InstallGd\*"
-   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
-   File "..\..\doc\install\Documentation\en_US\html\ReleaseNotes\*"
-   SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
-   File "..\..\doc\install\Documentation\en_US\html\SysAdminGd\*"
+   File "..\..\..\..\doc\man-pages\html\*"
+   SetOutPath "$INSTDIR\Documentation\html\CmdRef\1"
+   File "..\..\..\..\doc\man-pages\html\1\*"
+   SetOutPath "$INSTDIR\Documentation\html\CmdRef\5"
+   File "..\..\..\..\doc\man-pages\html\5\*"
+   SetOutPath "$INSTDIR\Documentation\html\CmdRef\8"
+   File "..\..\..\..\doc\man-pages\html\8\*"
+   SetOutPath "$INSTDIR\Documentation\"
+   File /oname=AdminGuide.chm "..\..\..\..\doc\xml\AdminGuide\htmlhelp.chm"
+   File /oname=UserGuide.chm "..\..\..\..\doc\xml\AdminGuide\htmlhelp.chm"
    goto DoneLanguage
    
 DoGerman:
-   SetOutPath "$INSTDIR\Documentation"
-   File "..\..\doc\install\Documentation\de_DE\README.TXT"
    SetOutPath "$INSTDIR\Documentation\html"
    File "..\..\doc\install\Documentation\de_DE\html\*"
    SetOutPath "$INSTDIR\Documentation\html\CmdRef"
    ;File "..\..\doc\install\Documentation\de_DE\html\CmdRef\*"
-   SetOutPath "$INSTDIR\Documentation\html\InstallGd"
-   File "..\..\doc\install\Documentation\de_DE\html\InstallGd\*"
-   ;SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
-   ;File "..\..\doc\install\Documentation\de_DE\html\ReleaseNotes\*"
    ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
    ;File "..\..\doc\install\Documentation\de_DE\html\SysAdminGd\*"
    goto DoneLanguage
    
 DoSpanish:
-   SetOutPath "$INSTDIR\Documentation"
-   File "..\..\doc\install\Documentation\es_ES\README.TXT"
    SetOutPath "$INSTDIR\Documentation\html"
    File "..\..\doc\install\Documentation\es_ES\html\*"
    SetOutPath "$INSTDIR\Documentation\html\CmdRef"
    ;File "..\..\doc\install\Documentation\es_ES\html\CmdRef\*"
-   SetOutPath "$INSTDIR\Documentation\html\InstallGd"
-   ;File "..\..\doc\install\Documentation\es_ES\html\InstallGd\*"
-   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
-   ;File "..\..\doc\install\Documentation\es_ES\html\ReleaseNotes\*"
    SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
    ;File "..\..\doc\install\Documentation\es_ES\html\SysAdminGd\*"
    goto DoneLanguage
 
 DoJapanese:
-   SetOutPath "$INSTDIR\Documentation"
-   File "..\..\doc\install\Documentation\ja_JP\README.TXT"
    SetOutPath "$INSTDIR\Documentation\html"
    File "..\..\doc\install\Documentation\ja_JP\html\*"
    SetOutPath "$INSTDIR\Documentation\html\CmdRef"
    File "..\..\doc\install\Documentation\ja_JP\html\CmdRef\*"
-   SetOutPath "$INSTDIR\Documentation\html\InstallGd"
-   File "..\..\doc\install\Documentation\ja_JP\html\InstallGd\*"
-   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
-   ;File "..\..\doc\install\Documentation\ja_JP\html\ReleaseNotes\*"
    SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
    ;File "..\..\doc\install\Documentation\ja_JP\html\SysAdminGd\*"
    goto DoneLanguage
    
 DoKorean:
-   SetOutPath "$INSTDIR\Documentation"
-   File "..\..\doc\install\Documentation\ko_KR\README.TXT"
    SetOutPath "$INSTDIR\Documentation\html"
    File "..\..\doc\install\Documentation\ko_KR\html\*"
    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
    ;File "..\..\doc\install\Documentation\ko_KR\html\CmdRef\*"
-   SetOutPath "$INSTDIR\Documentation\html\InstallGd"
-   File "..\..\doc\install\Documentation\ko_KR\html\InstallGd\*"
-   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
-   File "..\..\doc\install\Documentation\ko_KR\html\ReleaseNotes\*"
    SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
    File "..\..\doc\install\Documentation\ko_KR\html\SysAdminGd\*"
    goto DoneLanguage
    
 DoPortugueseBR:
-   SetOutPath "$INSTDIR\Documentation"
-   File "..\..\doc\install\Documentation\pt_BR\README.TXT"
    SetOutPath "$INSTDIR\Documentation\html"
    File "..\..\doc\install\Documentation\pt_BR\html\*"
    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
    ;File "..\..\doc\install\Documentation\pt_BR\html\CmdRef\*"
-   SetOutPath "$INSTDIR\Documentation\html\InstallGd"
-   File "..\..\doc\install\Documentation\pt_BR\html\InstallGd\*"
-   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
-   File "..\..\doc\install\Documentation\pt_BR\html\ReleaseNotes\*"
    ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
    ;File "..\..\doc\install\Documentation\pt_BR\html\SysAdminGd\*"
    goto DoneLanguage
 
 DoSimpChinese:
-   SetOutPath "$INSTDIR\Documentation"
-   File "..\..\doc\install\Documentation\zh_CN\README.TXT"
    SetOutPath "$INSTDIR\Documentation\html"
    File "..\..\doc\install\Documentation\zh_CN\html\*"
    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
    ;File "..\..\doc\install\Documentation\zh_CN\html\CmdRef\*"
-   SetOutPath "$INSTDIR\Documentation\html\InstallGd"
-   File "..\..\doc\install\Documentation\zh_CN\html\InstallGd\*"
-   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
-   File "..\..\doc\install\Documentation\zh_CN\html\ReleaseNotes\*"
    ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
    ;File "..\..\doc\install\Documentation\zh_CN\html\SysAdminGd\*"
    goto DoneLanguage
    
 DoTradChinese:
-   SetOutPath "$INSTDIR\Documentation"
-   File "..\..\doc\install\Documentation\zh_TW\README.TXT"
    SetOutPath "$INSTDIR\Documentation\html"
    File "..\..\doc\install\Documentation\zh_TW\html\*"
    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
    ;File "..\..\doc\install\Documentation\zh_TW\html\CmdRef\*"
-   SetOutPath "$INSTDIR\Documentation\html\InstallGd"
-   File "..\..\doc\install\Documentation\zh_TW\html\InstallGd\*"
-   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
-   File "..\..\doc\install\Documentation\zh_TW\html\ReleaseNotes\*"
    ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
    ;File "..\..\doc\install\Documentation\zh_TW\html\SysAdminGd\*"
    goto DoneLanguage
@@ -1051,27 +1115,23 @@ DoneLanguage:
   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"
-  CreateShortCut "$SMPROGRAMS\OpenAFS\Documentation.lnk" "$INSTDIR\Documentation\html\index.htm"
-  
-  
   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}\*.*"
+   SetOutPath "$INSTDIR\SDK\lib"
+   File /r "${AFS_CLIENT_LIBDIR}\*.*"
 
-    SetOutPath "$INSTDIR\Client\Program\Include"
-    File /r "${AFS_BUILD_INCDIR}\*.*"    
+   SetOutPath "$INSTDIR\SDK\Include"
+   File /r "${AFS_BUILD_INCDIR}\*.*"    
 
    ; Client Sample
-   SetOutPath "$INSTDIR\Client\Program\Sample"
+   SetOutPath "$INSTDIR\SDK\Sample"
    File "..\..\afsd\sample\token.c"
 
    ;Store install folder
@@ -1086,15 +1146,17 @@ Section "Software Development Kit (SDK)" secSDK
   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
   
@@ -1102,11 +1164,14 @@ Section "Debug symbols" secDebug
   SetOutPath "$INSTDIR\Client\Program"
   File "${AFS_CLIENT_BUILDDIR}\afsshare.pdb"
   File "${AFS_CLIENT_BUILDDIR}\libosi.pdb"
-  File "${AFS_CLIENT_BUILDDIR}\libafsconf.pdb"
+  ; remove old location if present
+  Delete "$INSTDIR\Client\Program\libafsconf.pdb"
   File "${AFS_CLIENT_BUILDDIR}\klog.pdb"
   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"
@@ -1122,12 +1187,14 @@ Section "Debug symbols" secDebug
   File "${AFS_DESTDIR}\etc\rxdebug.pdb"
   File "${AFS_DESTDIR}\etc\backup.pdb"
   File "${AFS_CLIENT_BUILDDIR}\afs_cpa.pdb"
+  File "${AFS_CLIENT_BUILDDIR}\afscred.pdb"
+  File "${AFS_CLIENT_BUILDDIR}\afslogon.pdb"
+  File "${AFS_CLIENT_BUILDDIR}\afscpcc.pdb"
 
   SetOutPath "$SYSDIR"
-  File "${AFS_CLIENT_BUILDDIR}\afslogon.pdb"
   
 DoServer:
-       SectionGetFlags ${secServer} $R0
+   SectionGetFlags ${secServer} $R0
    IntOp $R0 $R0 & ${SF_SELECTED}
    IntCmp $R0 ${SF_SELECTED} +1 DoControl
 
@@ -1135,6 +1202,7 @@ DoServer:
   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"
@@ -1143,6 +1211,8 @@ DoServer:
   File "${AFS_ETC_BUILDDIR}\fms.pdb"
   File "${AFS_SERVER_BUILDDIR}\kaserver.pdb"
   File "${AFS_SERVER_BUILDDIR}\ptserver.pdb"
+  File "${AFS_DESTDIR}\bin\ptclient.pdb"
+  File "${AFS_DESTDIR}\bin\pt_util.pdb"
   File "${AFS_SERVER_BUILDDIR}\salvager.pdb"
   File "${AFS_SERVER_BUILDDIR}\upclient.pdb"
   File "${AFS_SERVER_BUILDDIR}\upserver.pdb"
@@ -1162,7 +1232,7 @@ DoServer:
 
    ; Do control center components
 DoControl:
-       SectionGetFlags ${secControl} $R0
+   SectionGetFlags ${secControl} $R0
    IntOp $R0 $R0 & ${SF_SELECTED}
    IntCmp $R0 ${SF_SELECTED} +1 DoCommon
 
@@ -1173,6 +1243,12 @@ DoControl:
 
 DoCommon:
   SetOutPath "$INSTDIR\Common"
+!IFDEF CL_1500
+  ; Do nothing
+!ELSE
+!IFDEF CL_1400
+  ; Do nothing
+!ELSE
 !IFDEF CL_1310
    File "${SYSTEMDIR}\msvcr71d.pdb"
    File "${SYSTEMDIR}\msvcp71d.pdb"
@@ -1188,6 +1264,8 @@ DoCommon:
    File "${SYSTEMDIR}\msvcrtd.pdb"
 !ENDIF
 !ENDIF
+!ENDIF
+!ENDIF
   
 ; Common Areas
    SetOutPath "$INSTDIR\Common"
@@ -1196,6 +1274,7 @@ DoCommon:
    File "${AFS_DESTDIR}\lib\afsauthent.pdb"
    File "${AFS_DESTDIR}\lib\afspthread.pdb"
    File "${AFS_DESTDIR}\lib\afsrpc.pdb"
+   File "${AFS_DESTDIR}\lib\libafsconf.pdb"
    File "${AFS_SERVER_BUILDDIR}\afsclientadmin.pdb"
    File "${AFS_SERVER_BUILDDIR}\afsprocmgmt.pdb"
    File "${AFS_SERVER_BUILDDIR}\afsvosadmin.pdb"
@@ -1232,6 +1311,25 @@ Function .onInit
    
 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"
@@ -1240,13 +1338,14 @@ contInstall:
    StrCmp $R0 "rpcrt4.dll" contInstall2
    ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncadg_ip_udp"
    StrCmp $R0 "rpcrt4.dll" contInstall2
+   ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncacn_http"
+   StrCmp $R0 "rpcrt4.dll" contInstall2
    
    MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "An error was detected with your Windows RPC installation. Please make sure Windows RPC is installed before installing OpenAFS."
    Abort
 
 
 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
@@ -1255,6 +1354,8 @@ DoLoop:
    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
@@ -1337,10 +1438,10 @@ skipClient:
    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:
@@ -1365,10 +1466,10 @@ DowngradeServer:
    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:
@@ -1377,38 +1478,38 @@ 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,
 ; 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
+   IfFileExists "$INSTDIR\SDK\Include\main.h" +1 NoSDK
    SectionGetFlags ${secSDK} $0
    IntOp $0 $0 | ${SF_SELECTED}
    SectionSetFlags ${secSDK} $0
@@ -1422,26 +1523,26 @@ NoSDK:
    
 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
@@ -1452,7 +1553,7 @@ DefaultOptions:
    goto end
 
 end:
-       Pop $0
+   Pop $0
   
    Push $R0
   
@@ -1511,9 +1612,6 @@ Nope:
 FunctionEnd
 
 
-
-
-
 ;--------------------------------
 ; These are our cleanup functions
 Function .onInstFailed
@@ -1590,10 +1688,11 @@ StartRemove:
   ; Delete documentation
   Delete "$INSTDIR\Documentation\README.TXT"
   Delete "$INSTDIR\Documentation\html\*"
+  Delete "$INSTDIR\Documentation\html\index_files\*"
+  Delete "$INSTDIR\Documentation\html\CmdRef\1\*"
+  Delete "$INSTDIR\Documentation\html\CmdRef\5\*"
+  Delete "$INSTDIR\Documentation\html\CmdRef\8\*"
   Delete "$INSTDIR\Documentation\html\CmdRef\*"
-  Delete "$INSTDIR\Documentation\html\InstallGd\*"
-  Delete "$INSTDIR\Documentation\html\ReleaseNotes\*"
-  Delete "$INSTDIR\Documentation\html\SysAdminGd\*"
 
    Delete /REBOOTOK "$INSTDIR\Common\afs_config.exe"
    Delete /REBOOTOK "$INSTDIR\Common\afs_shl_ext.dll"
@@ -1627,62 +1726,90 @@ StartRemove:
    Delete /REBOOTOK "$INSTDIR\Common\afskasadmin.pdb"
    Delete /REBOOTOK "$INSTDIR\Common\afsptsadmin.pdb"
 !IFDEF DEBUG
+!IFDEF CL_1500
+   SetOutPath "$INSTDIR\Common"
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
+!ELSE
+!IFDEF CL_1400
+   SetOutPath "$INSTDIR\Common"
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
+!ELSE
 !IFDEF CL_1310
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc71d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc71d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr71d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr71d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp71d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp71d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc71d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc71d.pdb"
 !ELSE
 !IFDEF CL_1300
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc70d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc70d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr70d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr70d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp70d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp70d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc70d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc70d.pdb"
 !ELSE
-   Delete /REBOOTOK "$INSTDIR\bin\mfc42d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc42d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc42d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc42d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp60d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp60d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcrtd.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcrtd.pdb"
+!ENDIF
+!ENDIF
 !ENDIF
 !ENDIF
 !ELSE
+!IFDEF CL_1500
+   SetOutPath "$INSTDIR\Common"
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
+!ELSE
+!IFDEF CL_1400
+   SetOutPath "$INSTDIR\Common"
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
+!ELSE
 !IFDEF CL_1310
-   Delete /REBOOTOK "$INSTDIR\bin\mfc71.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr71.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp71.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71CHS.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71CHT.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71DEU.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71ENU.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71ESP.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71FRA.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71ITA.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71JPN.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71KOR.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc71.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr71.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp71.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71CHS.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71CHT.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71DEU.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71ENU.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71ESP.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71FRA.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71ITA.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71JPN.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71KOR.DLL"
 !ELSE
 !IFDEF CL_1300
-   Delete /REBOOTOK "$INSTDIR\bin\mfc70.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr70.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp70.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70CHS.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70CHT.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70DEU.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70ENU.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70ESP.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70FRA.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70ITA.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70JPN.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70KOR.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc70.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr70.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp70.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70CHS.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70CHT.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70DEU.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70ENU.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70ESP.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70FRA.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70ITA.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70JPN.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70KOR.DLL"
 !ELSE
-   Delete /REBOOTOK "$INSTDIR\bin\mfc42.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp60.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcrt.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc42.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp60.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcrt.dll"
+!ENDIF
+!ENDIF
 !ENDIF
 !ENDIF
 !ENDIF
@@ -1690,7 +1817,7 @@ StartRemove:
    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
@@ -1699,6 +1826,10 @@ StartRemove:
 !ENDIF
   Delete "$INSTDIR\Client\afsdns.ini"
   
+  GetTempFileName $R0
+  File /oname=$R0 "${AFS_WININSTALL_DIR}\AdminGroup.exe"
+  nsExec::Exec '$R0 -remove'
+
   SkipDel:
   Delete "$WINDIR\afsd_init.log"
   Delete "$INSTDIR\Uninstall.exe"
@@ -1750,92 +1881,126 @@ StartRemove:
   ;RMDIR /r "$INSTDIR\Server\usr\afs\logs"
   
   Delete /REBOOTOK "$SYSDIR\afsserver.cpl"
-  Delete /REBOOTOK "$SYSDIR\afs_cpa.cpl"
+  Delete /REBOOTOK "$INSTDIR\Client\Program\afs_cpa.cpl"
+  Delete /REBOOTOK "$INSTDIR\Client\Program\afslogon.dll"
+  Delete /REBOOTOK "$INSTDIR\Client\Program\afscpcc.exe"
 
   Delete /REBOOTOK "$SYSDIR\afsserver.pdb"
-  Delete /REBOOTOK "$SYSDIR\afs_cpa.pdb"
-  
+  Delete /REBOOTOK "$INSTDIR\Client\Program\afs_cpa.pdb"
+  Delete /REBOOTOK "$INSTDIR\Client\Program\afslogon.pdb"
+  Delete /REBOOTOK "$INSTDIR\Client\Program\afscpcc.pdb"
+
   RMDir /r "$INSTDIR\Documentation\html\CmdRef"
-  RMDir /r "$INSTDIR\Documentation\html\InstallGd"
-  RMDir /r "$INSTDIR\Documentation\html\ReleaseNotes"
-  RMDir /r "$INSTDIR\Documentation\html\SysAdminGd"
   RMDIr /r "$INSTDIR\Documentation\html"
   
   RMDir "$INSTDIR\Documentation"
   ; Delete DOC short cut
   Delete /REBOOTOK "$INSTDIR\Client\Program\afscreds.exe"
-
   Delete /REBOOTOK "$INSTDIR\Client\Program\afscreds.pdb"
 
+  Delete /REBOOTOK "$INSTDIR\SDK\Include\*"
+  Delete /REBOOTOK "$INSTDIR\SDK\Include\afs\*"
+  Delete /REBOOTOK "$INSTDIR\SDK\Include\rx\*"
+  Delete /REBOOTOK "$INSTDIR\SDK\Sample\*"
+  Delete /REBOOTOK "$INSTDIR\SDK\*"
+
+  RMDir  "$INSTDIR\SDK\Sample"
+  RMDir  "$INSTDIR\SDK\Include\afs"
+  RMDir  "$INSTDIR\SDK\Include\rx"
+  RMDir  "$INSTDIR\SDK\Include"
+  RMDir  "$INSTDIR\SDK"
+
   Delete /REBOOTOK "$INSTDIR\Client\Program\*"
-  Delete /REBOOTOK "$INSTDIR\Client\Program\Include\*"
-  Delete /REBOOTOK "$INSTDIR\Client\Program\Include\afs\*"
-  Delete /REBOOTOK "$INSTDIR\Client\Program\Include\rx\*"
-  Delete /REBOOTOK "$INSTDIR\Client\Program\Sample\*"
-  RMDir  "$INSTDIR\Client\Program\Sample"
-  RMDir  "$INSTDIR\Client\Program\Include\afs"
-  RMDir  "$INSTDIR\Client\Program\Include\rx"
-  RMDir  "$INSTDIR\Client\Program\Include"
+  Delete /REBOOTOK "$INSTDIR\Client\*"
+
   RMDir  "$INSTDIR\Client\Program"
   RMDir  "$INSTDIR\Client"
 
 !IFDEF DEBUG  
+!IFDEF CL_1500
+   SetOutPath "$INSTDIR\Common"
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
+!ELSE
+!IFDEF CL_1400
+   SetOutPath "$INSTDIR\Common"
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
+!ELSE
 !IFDEF CL_1310
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc71d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc71d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr71d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr71d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp71d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp71d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc71d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc71d.pdb"
 !ELSE
 !IFDEF CL_1300
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc70d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc70d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr70d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr70d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp70d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp70d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc70d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc70d.pdb"
 !ELSE
-   Delete /REBOOTOK "$INSTDIR\bin\mfc42d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc42d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc42d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc42d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp60d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp60d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcrtd.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcrtd.pdb"
+!ENDIF
 !ENDIF
 !ENDIF
+!ENDIF
+!ELSE
+!IFDEF CL_1500
+   SetOutPath "$INSTDIR\Common"
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
+!ELSE
+!IFDEF CL_1400
+   SetOutPath "$INSTDIR\Common"
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
 !ELSE
 !IFDEF CL_1310
-   Delete /REBOOTOK "$INSTDIR\bin\mfc71.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr71.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp71.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71CHS.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71CHT.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71DEU.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71ENU.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71ESP.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71FRA.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71ITA.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71JPN.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71KOR.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc71.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr71.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp71.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71CHS.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71CHT.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71DEU.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71ENU.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71ESP.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71FRA.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71ITA.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71JPN.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71KOR.DLL"
 !ELSE
 !IFDEF CL_1300
-   Delete /REBOOTOK "$INSTDIR\bin\mfc70.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr70.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp70.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70CHS.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70CHT.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70DEU.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70ENU.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70ESP.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70FRA.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70ITA.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70JPN.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70KOR.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc70.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr70.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp70.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70CHS.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70CHT.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70DEU.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70ENU.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70ESP.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70FRA.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70ITA.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70JPN.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70KOR.DLL"
 !ELSE
-   Delete /REBOOTOK "$INSTDIR\bin\mfc42.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp60.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcrt.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc42.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp60.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcrt.dll"
+!ENDIF
+!ENDIF
 !ENDIF
 !ENDIF
 !ENDIF
@@ -1869,6 +2034,7 @@ StartRemove:
   Delete "$SMPROGRAMS\OpenAFS\Control Center\Account Manager.lnk"
   Delete "$SMPROGRAMS\OpenAFS\Control Center\Server Manager.lnk"
   RMDIR "$SMPROGRAMS\OpenAFS\Control Center"
+  RMDir /r "$SMPROGRAMS\OpenAFS\Documentation"
   RMDir /r "$SMPROGRAMS\OpenAFS\Client"
   RMDir /r "$SMPROGRAMS\OpenAFS"
   Delete "$SMSTARTUP\AFS Credentials.lnk"
@@ -1897,9 +2063,15 @@ StartRemove:
   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion"
   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Server"
   DeleteRegKey /ifempty HKLM "${AFS_REGKEY_ROOT}"
+  DeleteRegKey HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS"
+  DeleteRegKey HKLM "${NID_PLUGIN_MGR}\Plugins\AfsCred"
+  DeleteRegKey /ifempty HKLM "Software\MIT\NetIDMgr"
   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS"
   DeleteRegValue HKLM "SYSTEM\CurrentControlSet\Services\NetBT\Parameters" "SmbDeviceEnabled"
+
+  ; Support for apps that wrote submount data directly to afsdsbmt.ini
+  DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\afsdsbmt.ini"
+
   RMDir  "$INSTDIR"
 
 SectionEnd
@@ -2168,18 +2340,49 @@ Function AFSPageGetCellName
   StrCmp $R0 "0" good
   
 startOver:
+   ; We want to read in the existing parameters and make them the defaults
+   
+   ;AFS Crypt security
+   ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "SecurityLevel"
+   StrCmp $R1 "" +3
+   WriteINIStr $1 "Field 3" "State" $R1
+   goto +2
+   WriteINIStr $1 "Field 3" "State" "1"
+   
+   ;Use DNS
+   ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "UseDNS"
+   StrCmp $R1 "" +3
+   WriteINIStr $1 "Field 9" "State" $R1
+   goto +2
+   WriteINIStr $1 "Field 9" "State" "1"
+   
+   ; Use integrated logon
+   ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "LogonOptions"
+   StrCmp $R1 "" +3
+   WriteINIStr $1 "Field 7" "State" $R1
+   goto +2
+   WriteINIStr $1 "Field 7" "State" "0"
+   
    ; 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)"
+   ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "FreelanceClient"
+   StrCmp $R1 "" +3
+   WriteINIStr $1 "Field 5" "State" $R1
+   goto +2
    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)"
+   ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "FreelanceClient"
+   StrCmp $R1 "" +3
+   WriteINIStr $1 "Field 5" "State" $R1
+   goto +2
    WriteINIStr $1 "Field 5" "State" "1"
    WriteINIStr $1 "Field 1" "Flags" ""
    WriteINIStr $1 "Field 2" "Flags" ""
@@ -2501,6 +2704,7 @@ end:
 FunctionEnd
 
 
+!ifdef USE_GETPARAMETERS
 ; GetParameters
 ; input, none
 ; output, top of stack (replaces, with e.g. whatever)
@@ -2530,6 +2734,7 @@ Function GetParameters
   Pop $R1
   Exch $R0
 FunctionEnd
+!endif
 
 
 ;Check to see if any AFS component is installed
@@ -2572,7 +2777,8 @@ Function AFSLangFiles
    File "${AFS_CLIENT_BUILDDIR}\afs_config.exe"
   !insertmacro ReplaceDLL "${AFS_DESTDIR}\lib\afsauthent.dll" "$INSTDIR\Common\afsauthent.dll" "$INSTDIR"
   !insertmacro ReplaceDLL "${AFS_DESTDIR}\lib\afspthread.dll" "$INSTDIR\Common\afspthread.dll" "$INSTDIR"
-  !insertmacro ReplaceDLL "${AFS_DESTDIR}\lib\afsrpc.dll" "$INSTDIR\Common\afsrpc.dll" "$INSTDIR"
+  !insertmacro ReplaceDLL "${AFS_DESTDIR}\lib\afsrpc.dll"     "$INSTDIR\Common\afsrpc.dll"     "$INSTDIR"
+  !insertmacro ReplaceDLL "${AFS_DESTDIR}\lib\libafsconf.dll" "$INSTDIR\Common\libafsconf.dll" "$INSTDIR"
   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsadminutil.dll"    "$INSTDIR\Common\afsadminutil.dll"    "$INSTDIR"
   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsclientadmin.dll"  "$INSTDIR\Common\afsclientadmin.dll"  "$INSTDIR" 
   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsprocmgmt.dll"     "$INSTDIR\Common\afsprocmgmt.dll"     "$INSTDIR" 
@@ -2587,6 +2793,16 @@ Function AFSLangFiles
  SetOutPath "$INSTDIR\Common"
 
 !IFDEF DEBUG
+!IFDEF CL_1500
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /i "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
+!ELSE
+!IFDEF CL_1400
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /i "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
+!ELSE
 !IFDEF CL_1310
    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71d.dll" "$INSTDIR\Common\msvcr71d.dll" "$INSTDIR"
    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71d.dll" "$INSTDIR\Common\msvcp71d.dll" "$INSTDIR"
@@ -2620,6 +2836,18 @@ Function AFSLangFiles
    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrtd.dll" "$INSTDIR\Common\msvcrtd.dll" "$INSTDIR"
 !ENDIF
 !ENDIF
+!ENDIF
+!ENDIF
+!ELSE
+!IFDEF CL_1500
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /i "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
+!ELSE
+!IFDEF CL_1400
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /i "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
 !ELSE
 !IFDEF CL_1310
    !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71.dll" "$INSTDIR\Common\mfc71.dll" "$INSTDIR"
@@ -2655,6 +2883,12 @@ Function AFSLangFiles
 !ENDIF
 !ENDIF
 !ENDIF   
+!ENDIF
+!ENDIF
+
+   ; Cleanup old documentation as the file names may have changed
+   DELETE "$SMPROGRAMS\OpenAFS\Documentation.lnk"
+   RMDIR /R "$INSTDIR\Documentation"
 
    StrCmp $LANGUAGE ${LANG_ENGLISH} DoEnglish
    StrCmp $LANGUAGE ${LANG_GERMAN} DoGerman
@@ -2668,7 +2902,10 @@ Function AFSLangFiles
 DoEnglish:
 
    SetOutPath "$INSTDIR\Documentation"
-   File "..\..\doc\install\Documentation\en_US\README.TXT"
+   File /oname=ReleaseNotes.chm "..\..\..\..\doc\xml\ReleaseNotesWindows\htmlhelp.chm"
+
+   CreateDirectory "$SMPROGRAMS\OpenAFS\Documentation"
+   CreateShortCut "$SMPROGRAMS\OpenAFS\Documentation\Release Notes.lnk" "$INSTDIR\Documentation\ReleaseNotes.chm"
 
    SetOutPath "$INSTDIR\Client\Program"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1033.dll"    "$INSTDIR\Client\Program\afscreds_1033.dll" "$INSTDIR"
@@ -2678,6 +2915,11 @@ DoEnglish:
    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1033.pdb"
 !endif
 
+   File "..\..\doc\help\en_US\afs-light.CNT"
+   File "..\..\doc\help\en_US\afs-light.hlp"
+   File "..\..\doc\help\en_US\afs-nt.CNT"
+   File "..\..\doc\help\en_US\afs-nt.HLP"
+
    SetOutPath "$INSTDIR\Common"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1033.dll"           "$INSTDIR\Common\afs_config_1033.dll" "$INSTDIR"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1033.dll"              "$INSTDIR\Common\afs_cpa_1033.dll" "$INSTDIR"
@@ -2690,10 +2932,6 @@ DoEnglish:
    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1033.dll"   "$INSTDIR\Common\TaAfsServerManager_1033.dll" "$INSTDIR"
    File "..\..\doc\help\en_US\afs-cc.CNT"
    File "..\..\doc\help\en_US\afs-cc.hlp"
-   File "..\..\doc\help\en_US\afs-light.CNT"
-   File "..\..\doc\help\en_US\afs-light.hlp"
-   File "..\..\doc\help\en_US\afs-nt.CNT"
-   File "..\..\doc\help\en_US\afs-nt.HLP"
    File "..\..\doc\help\en_US\taafscfg.CNT"
    File "..\..\doc\help\en_US\taafscfg.hlp"
    File "..\..\doc\help\en_US\taafssvrmgr.CNT"
@@ -2717,6 +2955,18 @@ DoGerman:
 
    SetOutPath "$INSTDIR\Documentation"
    File "..\..\doc\install\Documentation\de_DE\README.TXT"
+   SetOutPath "$INSTDIR\Documentation\html"
+   File "..\..\doc\install\Documentation\de_DE\html\*"
+   SetOutPath "$INSTDIR\Documentation\html\index_files"
+   ;File "..\..\doc\install\Documentation\de_DE\html\index_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\InstallGd"
+   File "..\..\doc\install\Documentation\de_DE\html\InstallGd\*"
+   ;SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
+   ;File "..\..\doc\install\Documentation\de_DE\html\ReleaseNotes\*"
+   ;SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
+   ;File "..\..\doc\install\Documentation\de_DE\html\ReleaseNotes\logo_files\*"
+   ;SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
+   ;File "..\..\doc\install\Documentation\de_DE\html\ReleaseNotes\relnotes_files\*"
 
    SetOutPath "$INSTDIR\Client\Program"
   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1032.dll"                      "$INSTDIR\Client\Program\afscreds_1032.dll" "$INSTDIR"
@@ -2726,6 +2976,11 @@ DoGerman:
    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1032.pdb"
 !endif
 
+   File "..\..\doc\help\de_DE\afs-light.CNT"
+   File "..\..\doc\help\de_DE\afs-light.hlp"
+   File "..\..\doc\help\de_DE\afs-nt.CNT"
+   File "..\..\doc\help\de_DE\afs-nt.HLP"
+
    SetOutPath "$INSTDIR\Common"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1032.dll"           "$INSTDIR\Common\afs_config_1032.dll" "$INSTDIR"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1032.dll"              "$INSTDIR\Common\afs_cpa_1032.dll" "$INSTDIR" 
@@ -2738,10 +2993,6 @@ DoGerman:
    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1032.dll"   "$INSTDIR\Common\TaAfsServerManager_1032.dll" "$INSTDIR" 
    File "..\..\doc\help\de_DE\afs-cc.CNT"
    File "..\..\doc\help\de_DE\afs-cc.hlp"
-   File "..\..\doc\help\de_DE\afs-light.CNT"
-   File "..\..\doc\help\de_DE\afs-light.hlp"
-   File "..\..\doc\help\de_DE\afs-nt.CNT"
-   File "..\..\doc\help\de_DE\afs-nt.HLP"
    File "..\..\doc\help\de_DE\taafscfg.CNT"
    File "..\..\doc\help\de_DE\taafscfg.hlp"
    File "..\..\doc\help\de_DE\taafssvrmgr.CNT"
@@ -2765,6 +3016,18 @@ DoSpanish:
 
    SetOutPath "$INSTDIR\Documentation"
    File "..\..\doc\install\Documentation\es_ES\README.TXT"
+   SetOutPath "$INSTDIR\Documentation\html"
+   ;File "..\..\doc\install\Documentation\es_ES\html\*"
+   SetOutPath "$INSTDIR\Documentation\html\index_html"
+   ;File "..\..\doc\install\Documentation\es_ES\html\index_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\InstallGd"
+   ;File "..\..\doc\install\Documentation\es_ES\html\InstallGd\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
+   ;File "..\..\doc\install\Documentation\es_ES\html\ReleaseNotes\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
+   ;File "..\..\doc\install\Documentation\es_ES\html\ReleaseNotes\logo_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
+   ;File "..\..\doc\install\Documentation\es_ES\html\ReleaseNotes\relnotes_files\*"
 
    SetOutPath "$INSTDIR\Client\Program"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1034.dll"     "$INSTDIR\Client\Program\afscreds_1034.dll" "$INSTDIR" 
@@ -2774,6 +3037,11 @@ DoSpanish:
    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1034.pdb"
 !endif
 
+   File "..\..\doc\help\es_ES\afs-light.CNT"
+   File "..\..\doc\help\es_ES\afs-light.hlp"
+   File "..\..\doc\help\es_ES\afs-nt.CNT"
+   File "..\..\doc\help\es_ES\afs-nt.HLP"
+
    SetOutPath "$INSTDIR\Common"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1034.dll"          "$INSTDIR\Common\afs_config_1034.dll" "$INSTDIR"  
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1034.dll"             "$INSTDIR\Common\afs_cpa_1034.dll" "$INSTDIR"  
@@ -2786,10 +3054,6 @@ DoSpanish:
    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1034.dll"  "$INSTDIR\Common\TaAfsServerManager_1034.dll" "$INSTDIR"  
    File "..\..\doc\help\es_ES\afs-cc.CNT"
    File "..\..\doc\help\es_ES\afs-cc.hlp"
-   File "..\..\doc\help\es_ES\afs-light.CNT"
-   File "..\..\doc\help\es_ES\afs-light.hlp"
-   File "..\..\doc\help\es_ES\afs-nt.CNT"
-   File "..\..\doc\help\es_ES\afs-nt.HLP"
    File "..\..\doc\help\es_ES\taafscfg.CNT"
    File "..\..\doc\help\es_ES\taafscfg.hlp"
    File "..\..\doc\help\es_ES\taafssvrmgr.CNT"
@@ -2813,6 +3077,18 @@ DoJapanese:
 
    SetOutPath "$INSTDIR\Documentation"
    File "..\..\doc\install\Documentation\ja_JP\README.TXT"
+   SetOutPath "$INSTDIR\Documentation\html"
+   File "..\..\doc\install\Documentation\ja_JP\html\*"
+   SetOutPath "$INSTDIR\Documentation\html\index_files"
+   ;File "..\..\doc\install\Documentation\ja_JP\html\index_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\InstallGd"
+   File "..\..\doc\install\Documentation\ja_JP\html\InstallGd\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
+   ;File "..\..\doc\install\Documentation\ja_JP\html\ReleaseNotes\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
+   ;File "..\..\doc\install\Documentation\ja_JP\html\ReleaseNotes\logo_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
+   ;File "..\..\doc\install\Documentation\ja_JP\html\ReleaseNotes\relnotes_files\*"
 
    SetOutPath "$INSTDIR\Client\Program"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1041.dll"  "$INSTDIR\Client\Program\afscreds_1041.dll" "$INSTDIR"  
@@ -2822,6 +3098,11 @@ DoJapanese:
    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1041.pdb"
 !endif
 
+   File "..\..\doc\help\ja_JP\afs-light.CNT"
+   File "..\..\doc\help\ja_JP\afs-light.hlp"
+   File "..\..\doc\help\ja_JP\afs-nt.CNT"
+   File "..\..\doc\help\ja_JP\afs-nt.HLP"
+
    SetOutPath "$INSTDIR\Common"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1041.dll"           "$INSTDIR\Common\afs_config_1041.dll" "$INSTDIR"   
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1041.dll"              "$INSTDIR\Common\afs_cpa_1041.dll" "$INSTDIR"   
@@ -2834,10 +3115,6 @@ DoJapanese:
    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1041.dll"   "$INSTDIR\Common\TaAfsServerManager_1041.dll" "$INSTDIR"   
    File "..\..\doc\help\ja_JP\afs-cc.CNT"
    File "..\..\doc\help\ja_JP\afs-cc.hlp"
-   File "..\..\doc\help\ja_JP\afs-light.CNT"
-   File "..\..\doc\help\ja_JP\afs-light.hlp"
-   File "..\..\doc\help\ja_JP\afs-nt.CNT"
-   File "..\..\doc\help\ja_JP\afs-nt.HLP"
    File "..\..\doc\help\ja_JP\taafscfg.CNT"
    File "..\..\doc\help\ja_JP\taafscfg.hlp"
    File "..\..\doc\help\ja_JP\taafssvrmgr.CNT"
@@ -2861,6 +3138,18 @@ DoKorean:
 
    SetOutPath "$INSTDIR\Documentation"
    File "..\..\doc\install\Documentation\ko_KR\README.TXT"
+   SetOutPath "$INSTDIR\Documentation\html"
+   File "..\..\doc\install\Documentation\ko_KR\html\*"
+   SetOutPath "$INSTDIR\Documentation\html\index_files"
+   ;File "..\..\doc\install\Documentation\ko_KR\html\index_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\InstallGd"
+   File "..\..\doc\install\Documentation\ko_KR\html\InstallGd\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
+   File "..\..\doc\install\Documentation\ko_KR\html\ReleaseNotes\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
+   ;File "..\..\doc\install\Documentation\ko_KR\html\ReleaseNotes\logo_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
+   ;File "..\..\doc\install\Documentation\ko_KR\html\ReleaseNotes\relnotes_files\*"
 
    SetOutPath "$INSTDIR\Client\Program"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1042.dll"  "$INSTDIR\Client\Program\afscreds_1042.dll" "$INSTDIR"   
@@ -2870,6 +3159,11 @@ DoKorean:
    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1042.pdb"
 !endif
 
+   File "..\..\doc\help\ko_KR\afs-light.CNT"
+   File "..\..\doc\help\ko_KR\afs-light.hlp"
+   File "..\..\doc\help\ko_KR\afs-nt.CNT"
+   File "..\..\doc\help\ko_KR\afs-nt.HLP"
+
    SetOutPath "$INSTDIR\Common"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1042.dll"           "$INSTDIR\Common\afs_config_1042.dll" "$INSTDIR"    
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1042.dll"              "$INSTDIR\Common\afs_cpa_1042.dll" "$INSTDIR"    
@@ -2882,10 +3176,6 @@ DoKorean:
    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1042.dll"   "$INSTDIR\Common\TaAfsServerManager_1042.dll" "$INSTDIR"    
    File "..\..\doc\help\ko_KR\afs-cc.CNT"
    File "..\..\doc\help\ko_KR\afs-cc.hlp"
-   File "..\..\doc\help\ko_KR\afs-light.CNT"
-   File "..\..\doc\help\ko_KR\afs-light.hlp"
-   File "..\..\doc\help\ko_KR\afs-nt.CNT"
-   File "..\..\doc\help\ko_KR\afs-nt.HLP"
    File "..\..\doc\help\ko_KR\taafscfg.CNT"
    File "..\..\doc\help\ko_KR\taafscfg.hlp"
    File "..\..\doc\help\ko_KR\taafssvrmgr.CNT"
@@ -2910,6 +3200,18 @@ DoPortugueseBR:
 
    SetOutPath "$INSTDIR\Documentation"
    File "..\..\doc\install\Documentation\pt_BR\README.TXT"
+   SetOutPath "$INSTDIR\Documentation\html"
+   File "..\..\doc\install\Documentation\pt_BR\html\*"
+   SetOutPath "$INSTDIR\Documentation\html\index_files"
+   ;File "..\..\doc\install\Documentation\pt_BR\html\index_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\InstallGd"
+   File "..\..\doc\install\Documentation\pt_BR\html\InstallGd\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
+   File "..\..\doc\install\Documentation\pt_BR\html\ReleaseNotes\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
+   ;File "..\..\doc\install\Documentation\pt_BR\html\ReleaseNotes\logo_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
+   ;File "..\..\doc\install\Documentation\pt_BR\html\ReleaseNotes\relnotes_files\*"
 
    SetOutPath "$INSTDIR\Client\Program"
    !insertmacro ReplaceDLL  "${AFS_CLIENT_BUILDDIR}\afscreds_1046.dll"  "$INSTDIR\Client\Program\afscreds_1046.dll" "$INSTDIR"    
@@ -2919,6 +3221,11 @@ DoPortugueseBR:
    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1046.pdb"
 !endif
 
+   File "..\..\doc\help\pt_BR\afs-light.CNT"
+   File "..\..\doc\help\pt_BR\afs-light.hlp"
+   File "..\..\doc\help\pt_BR\afs-nt.CNT"
+   File "..\..\doc\help\pt_BR\afs-nt.HLP"
+
    SetOutPath "$INSTDIR\Common"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1046.dll"           "$INSTDIR\Common\afs_config_1046.dll" "$INSTDIR"     
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1046.dll"              "$INSTDIR\Common\afs_cpa_1046.dll" "$INSTDIR"     
@@ -2931,10 +3238,6 @@ DoPortugueseBR:
    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1046.dll"   "$INSTDIR\Common\TaAfsServerManager_1046.dll" "$INSTDIR"     
    File "..\..\doc\help\pt_BR\afs-cc.CNT"
    File "..\..\doc\help\pt_BR\afs-cc.hlp"
-   File "..\..\doc\help\pt_BR\afs-light.CNT"
-   File "..\..\doc\help\pt_BR\afs-light.hlp"
-   File "..\..\doc\help\pt_BR\afs-nt.CNT"
-   File "..\..\doc\help\pt_BR\afs-nt.HLP"
    File "..\..\doc\help\pt_BR\taafscfg.CNT"
    File "..\..\doc\help\pt_BR\taafscfg.hlp"
    File "..\..\doc\help\pt_BR\taafssvrmgr.CNT"
@@ -2958,6 +3261,18 @@ DoSimpChinese:
 
    SetOutPath "$INSTDIR\Documentation"
    File "..\..\doc\install\Documentation\zh_CN\README.TXT"
+   SetOutPath "$INSTDIR\Documentation\html"
+   File "..\..\doc\install\Documentation\zh_CN\html\*"
+   SetOutPath "$INSTDIR\Documentation\html\index_files"
+   ;File "..\..\doc\install\Documentation\zh_CN\html\index_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\InstallGd"
+   File "..\..\doc\install\Documentation\zh_CN\html\InstallGd\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
+   File "..\..\doc\install\Documentation\zh_CN\html\ReleaseNotes\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
+   ;File "..\..\doc\install\Documentation\zh_CN\html\ReleaseNotes\logo_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
+   ;File "..\..\doc\install\Documentation\zh_CN\html\ReleaseNotes\relnotes_files\*"
 
    SetOutPath "$INSTDIR\Client\Program"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_2052.dll"   "$INSTDIR\Client\Program\afscreds_2052.dll" "$INSTDIR"     
@@ -2967,6 +3282,11 @@ DoSimpChinese:
    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_2052.pdb"
 !endif
 
+   File "..\..\doc\help\zh_CN\afs-light.CNT"
+   File "..\..\doc\help\zh_CN\afs-light.hlp"
+   File "..\..\doc\help\zh_CN\afs-nt.CNT"
+   File "..\..\doc\help\zh_CN\afs-nt.HLP"
+
    SetOutPath "$INSTDIR\Common"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_2052.dll"           "$INSTDIR\Common\afs_config_2052.dll" "$INSTDIR"      
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_2052.dll"              "$INSTDIR\Common\afs_cpa_2052.dll" "$INSTDIR"      
@@ -2979,10 +3299,6 @@ DoSimpChinese:
    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_2052.dll"   "$INSTDIR\Common\TaAfsServerManager_2052.dll" "$INSTDIR"      
    File "..\..\doc\help\zh_CN\afs-cc.CNT"
    File "..\..\doc\help\zh_CN\afs-cc.hlp"
-   File "..\..\doc\help\zh_CN\afs-light.CNT"
-   File "..\..\doc\help\zh_CN\afs-light.hlp"
-   File "..\..\doc\help\zh_CN\afs-nt.CNT"
-   File "..\..\doc\help\zh_CN\afs-nt.HLP"
    File "..\..\doc\help\zh_CN\taafscfg.CNT"
    File "..\..\doc\help\zh_CN\taafscfg.hlp"
    File "..\..\doc\help\zh_CN\taafssvrmgr.CNT"
@@ -3006,6 +3322,18 @@ DoTradChinese:
 
    SetOutPath "$INSTDIR\Documentation"
    File "..\..\doc\install\Documentation\zh_TW\README.TXT"
+   SetOutPath "$INSTDIR\Documentation\html"
+   File "..\..\doc\install\Documentation\zh_TW\html\*"
+   SetOutPath "$INSTDIR\Documentation\html\index_files"
+   ;File "..\..\doc\install\Documentation\zh_TW\html\index_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\InstallGd"
+   File "..\..\doc\install\Documentation\zh_TW\html\InstallGd\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
+   File "..\..\doc\install\Documentation\zh_TW\html\ReleaseNotes\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
+   ;File "..\..\doc\install\Documentation\zh_TW\html\ReleaseNotes\logo_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
+   ;File "..\..\doc\install\Documentation\zh_TW\html\ReleaseNotes\relnotes_files\*"
 
    SetOutPath "$INSTDIR\Client\Program"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1028.dll"  "$INSTDIR\Client\Program\_1028.dll" "$INSTDIR"      
@@ -3015,6 +3343,11 @@ DoTradChinese:
    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1028.pdb"
 !endif
 
+   File "..\..\doc\help\zh_TW\afs-light.CNT"
+   File "..\..\doc\help\zh_TW\afs-light.hlp"
+   File "..\..\doc\help\zh_TW\afs-nt.CNT"
+   File "..\..\doc\help\zh_TW\afs-nt.HLP"
+
    SetOutPath "$INSTDIR\Common"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1028.dll"           "$INSTDIR\Common\afs_config_1028.dll" "$INSTDIR"       
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1028.dll"              "$INSTDIR\Common\afs_cpa_1028.dll" "$INSTDIR"       
@@ -3027,10 +3360,6 @@ DoTradChinese:
    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1028.dll"   "$INSTDIR\Common\TaAfsServerManager_1028.dll" "$INSTDIR"       
    File "..\..\doc\help\zh_TW\afs-cc.CNT"
    File "..\..\doc\help\zh_TW\afs-cc.hlp"
-   File "..\..\doc\help\zh_TW\afs-light.CNT"
-   File "..\..\doc\help\zh_TW\afs-light.hlp"
-   File "..\..\doc\help\zh_TW\afs-nt.CNT"
-   File "..\..\doc\help\zh_TW\afs-nt.HLP"
    File "..\..\doc\help\zh_TW\taafscfg.CNT"
    File "..\..\doc\help\zh_TW\taafscfg.hlp"
    File "..\..\doc\help\zh_TW\taafssvrmgr.CNT"
@@ -3051,6 +3380,14 @@ DoTradChinese:
    goto done
    
 done:
+
+   ; Write start menu shortcut
+   SetOutPath "$SMPROGRAMS\OpenAFS"
+   CreateDirectory "$SMPROGRAMS\OpenAFS\Documentation"
+   CreateShortCut "$SMPROGRAMS\OpenAFS\Documentation\Reference Manual.lnk" "$INSTDIR\Documentation\html\CmdRef\index.html"
+   CreateShortCut "$SMPROGRAMS\OpenAFS\Documentation\Administrator Guide.lnk" "$INSTDIR\Documentation\AdminGuide.chm"
+   CreateShortCut "$SMPROGRAMS\OpenAFS\Documentation\User Guide.lnk" "$INSTDIR\Documentation\UserGuide.chm"
+
 FunctionEnd
 
 
@@ -3359,7 +3696,7 @@ FunctionEnd
 ;
 ; Returns on top of stack
 ;
-; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003)
+; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003, Vista/2008)
 ; or
 ; '' (Unknown Windows Version)
 ;
@@ -3415,7 +3752,8 @@ Function GetWindowsVersion
 
   StrCmp $R1 '5.0' lbl_winnt_2000
   StrCmp $R1 '5.1' lbl_winnt_XP
-  StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error
+  StrCmp $R1 '5.2' lbl_winnt_2003
+  StrCmp $R1 '6.0' lbl_winnt_vista lbl_error
 
   lbl_winnt_x:
     StrCpy $R0 "NT $R0" 6
@@ -3433,6 +3771,10 @@ Function GetWindowsVersion
     Strcpy $R0 '2003'
   Goto lbl_done
 
+  lbl_winnt_vista:
+    Strcpy $R0 'Vista'
+  Goto lbl_done
+
   lbl_error:
     Strcpy $R0 ''
   lbl_done:
@@ -3626,6 +3968,12 @@ Function RegWriteMultiStr
     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
@@ -3651,4 +3999,11 @@ noClose:
   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