set eol-style properties
authorTom Yu <tlyu@mit.edu>
Thu, 23 Jul 2009 17:55:04 +0000 (17:55 +0000)
committerTom Yu <tlyu@mit.edu>
Thu, 23 Jul 2009 17:55:04 +0000 (17:55 +0000)
ticket: 6535

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@22450 dc483132-0cff-0310-8789-dd5450dbe970

src/windows/installer/nsis/kfw-fixed-tagged.nsi

index 532cb16d553b1a1385e72c19e8a2df23df31216e..82b096fbb172b2b1029a29898d834fdd8a2cced6 100644 (file)
-;-----------------------------------------------------------------\r
-; KfW defines and functionality\r
-; Copyright (c) 2004,2005,2006,2007 Massachusetts Institute of Technology\r
-; Copyright (c) 2006,2007 Secure Endpoints Inc.\r
-\r
-!define KFW_VERSION "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}"\r
-\r
-!define PROGRAM_NAME "Kerberos for Windows"\r
-!ifdef RELEASE\r
-!ifndef DEBUG        ; !DEBUG on v2.0b4\r
-Name "MIT ${PROGRAM_NAME} ${KFW_VERSION}"\r
-!else                ; DEBUG on v2.0b4\r
-Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Checked/Debug"\r
-!endif               ; End DEBUG/!DEBUG\r
-!else\r
-!ifdef BETA\r
-!ifndef DEBUG        ; !DEBUG on v2.0b4\r
-Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Beta ${BETA}"\r
-!else                ; DEBUG on v2.0b4\r
-Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Beta ${BETA} Checked/Debug"\r
-!endif               ; End DEBUG/!DEBUG\r
-!else\r
-!ifndef DEBUG        ; !DEBUG on v2.0b4\r
-Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} ${__DATE__} ${__TIME__}"\r
-!else                ; DEBUG on v2.0b4\r
-Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} ${__DATE__} ${__TIME__} Checked/Debug"\r
-!endif               ; End DEBUG/!DEBUG\r
-!endif\r
-!endif\r
-VIProductVersion "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}.00"\r
-VIAddVersionKey "ProductName" "${PROGRAM_NAME}"\r
-VIAddVersionKey "CompanyName" "Massachusetts Institute of Technology"\r
-VIAddVersionKey "FileVersion"  ${VIProductVersion}\r
-VIAddVersionKey "ProductVersion"  "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}.0"\r
-VIAddVersionKey "FileDescription" "MIT Kerberos for Windows Installer"\r
-VIAddVersionKey "LegalCopyright" "(C)2004,2005,2006,2007"\r
-!ifdef DEBUG\r
-VIAddVersionKey "PrivateBuild" "Checked/Debug"\r
-!endif               ; End DEBUG\r
-\r
-\r
-;--------------------------------\r
-;Configuration\r
-\r
-  ;General\r
-  SetCompressor lzma\r
-!ifndef DEBUG\r
-  OutFile "MITKerberosForWindows.exe"\r
-!else\r
-  OutFile "MITKerberosForWindows-DEBUG.exe"\r
-!endif\r
-  SilentInstall normal\r
-  ShowInstDetails show\r
-  XPStyle on\r
-  !define MUI_ICON "kfw.ico"\r
-  !define MUI_UNICON "kfw.ico"\r
-  !define KFW_COMPANY_NAME "Massachusetts Institute of Technology"\r
-  !define KFW_PRODUCT_NAME "${PROGRAM_NAME}"\r
-  !define KFW_REGKEY_ROOT  "Software\MIT\Kerberos\"\r
-  !define NIM_REGKEY_ROOT  "Software\MIT\NetIDMgr\"\r
-  CRCCheck force\r
-  !define REPLACEDLL_NOREGISTER\r
-\r
-  ;Folder selection page\r
-  InstallDir "$PROGRAMFILES\MIT\Kerberos"      ; Install to shorter path\r
-  \r
-  ;Remember install folder\r
-  InstallDirRegKey HKLM "${KFW_REGKEY_ROOT}" ""\r
-  \r
-  ;Remember the installer language\r
-  !define MUI_LANGDLL_REGISTRY_ROOT "HKLM" \r
-  !define MUI_LANGDLL_REGISTRY_KEY "${KFW_REGKEY_ROOT}" \r
-  !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"\r
-  \r
-  ;Where are the files?\r
-  !define KFW_BIN_DIR "${KFW_TARGETDIR}\bin\%cpu%"\r
-  !define KFW_DOC_DIR "${KFW_TARGETDIR}\doc"\r
-  !define KFW_INC_DIR "${KFW_TARGETDIR}\inc"\r
-  !define KFW_LIB_DIR "${KFW_TARGETDIR}\lib\%cpu%"\r
-  !define KFW_SAMPLE_DIR "${KFW_TARGETDIR}\sample"\r
-  !define KFW_INSTALL_DIR "${KFW_TARGETDIR}\install"\r
-  !define SYSTEMDIR   "$%SystemRoot%\System32" \r
-  !define SXSDIR1     "$%SystemRoot%\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f"\r
-  !define SXSLANG     "c:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.MFCLOC"\r
-  !ifdef X86\r
-  !define SXSDIR2     "$%SystemRoot%\WinSxS\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_c8452471"\r
-  !define SXSMAND     "$%SystemRoot%\WinSxS\Manifests"\r
-  !else\r
-  !ifdef AMD64\r
-  !define SXSDIR2     "$%SystemRoot%\WinSxS\amd64_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_57812684"\r
-  !endif\r
-  !endif\r
-  \r
-  !define REDISTDIR   "c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86"\r
-\r
-;--------------------------------\r
-;Modern UI Configuration\r
-\r
-  !define MUI_LICENSEPAGE\r
-  !define MUI_CUSTOMPAGECOMMANDS\r
-  !define MUI_WELCOMEPAGE\r
-  !define MUI_COMPONENTSPAGE\r
-  !define MUI_COMPONENTSPAGE_SMALLDESC\r
-  !define MUI_DIRECTORYPAGE\r
-\r
-  !define MUI_ABORTWARNING\r
-  !define MUI_FINISHPAGE\r
-  \r
-  !define MUI_UNINSTALLER\r
-  !define MUI_UNCONFIRMPAGE\r
-  \r
-  \r
-  !insertmacro MUI_PAGE_WELCOME\r
-  !insertmacro MUI_PAGE_LICENSE "Licenses.rtf"\r
-  !insertmacro MUI_PAGE_COMPONENTS\r
-  !insertmacro MUI_PAGE_DIRECTORY\r
-  Page custom KFWPageGetConfigFiles\r
-  Page custom KFWPageGetStartupConfig\r
-  !insertmacro MUI_PAGE_INSTFILES\r
-  !insertmacro MUI_PAGE_FINISH\r
-  \r
-;--------------------------------\r
-;Languages\r
-\r
-  !insertmacro MUI_LANGUAGE "English"\r
-  \r
-;--------------------------------\r
-;Language Strings\r
-    \r
-  ;Descriptions\r
-  LangString DESC_SecCopyUI ${LANG_ENGLISH} "${PROGRAM_NAME}: English"\r
-\r
-  LangString DESC_secClient ${LANG_ENGLISH} "Client: Allows you to utilize MIT Kerberos from your Windows PC."\r
-  \r
-  LangString DESC_secDebug ${LANG_ENGLISH} "Debug Symbols: Used for debugging problems with MIT Kerberos for Windows"\r
-  \r
-  LangString DESC_secSDK ${LANG_ENGLISH} "SDK: Allows you to build MIT Kerberos aware applications."\r
-  \r
-  LangString DESC_secDocs ${LANG_ENGLISH} "Documentation: Release Notes and User Manuals."\r
-  \r
-; Popup error messages\r
-  LangString RealmNameError ${LANG_ENGLISH} "You must specify a realm name for your client to use."\r
-\r
-  LangString ConfigFileError ${LANG_ENGLISH} "You must specify a valid configuration file location from which files can be copied during the install"\r
\r
-  LangString URLError ${LANG_ENGLISH} "You must specify a URL if you choose the option to download the config files."\r
-  \r
-; Upgrade/re-install strings\r
-   LangString UPGRADE_CLIENT ${LANG_ENGLISH} "Upgrade Kerberos Client"\r
-   LangString REINSTALL_CLIENT ${LANG_ENGLISH} "Re-install Kerberos Client"\r
-   LangString DOWNGRADE_CLIENT ${LANG_ENGLISH} "Downgrade Kerberos Client"\r
-  \r
-   LangString UPGRADE_SDK ${LANG_ENGLISH} "Upgrade Kerberos SDK"\r
-   LangString REINSTALL_SDK ${LANG_ENGLISH} "Re-install Kerberos SDK"\r
-   LangString DOWNGRADE_SDK ${LANG_ENGLISH} "Downgrade Kerberos SDK"\r
-  \r
-   LangString UPGRADE_DOCS ${LANG_ENGLISH} "Upgrade Kerberos Documentation"\r
-   LangString REINSTALL_DOCS ${LANG_ENGLISH} "Re-install Kerberos Documentation"\r
-   LangString DOWNGRADE_DOCS ${LANG_ENGLISH} "Downgrade Kerberos Documentation"\r
-  \r
-  ReserveFile "${KFW_CONFIG_DIR}\sample\krb.con"\r
-  ReserveFile "${KFW_CONFIG_DIR}\sample\krbrealm.con"\r
-  ReserveFile "${KFW_CONFIG_DIR}\sample\krb5.ini"\r
-  !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions plug-in\r
-  !insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog\r
-\r
-;--------------------------------\r
-;Reserve Files\r
-  \r
-  ;Things that need to be extracted on first (keep these lines before any File command!)\r
-  ;Only useful for BZIP2 compression\r
-  !insertmacro MUI_RESERVEFILE_LANGDLL\r
-  \r
-;--------------------------------\r
-; Load Macros\r
-!include "utils.nsi"\r
-\r
-;--------------------------------\r
-;Installer Sections\r
-\r
-;----------------------\r
-; Kerberos for Windows CLIENT\r
-Section "KfW Client" secClient\r
-\r
-  SetShellVarContext all\r
-  ; Stop any running services or we can't replace the files\r
-  ; Stop the running processes\r
-  GetTempFileName $R0\r
-  File /oname=$R0 "Killer.exe"\r
-  nsExec::Exec '$R0 netidmgr.exe'\r
-  nsExec::Exec '$R0 leash32.exe'\r
-  nsExec::Exec '$R0 krbcc%WL%s.exe'\r
-  nsExec::Exec '$R0 k95.exe'\r
-  nsExec::Exec '$R0 k95g.exe'\r
-  nsExec::Exec '$R0 krb5.exe'\r
-  nsExec::Exec '$R0 gss.exe'\r
-  nsExec::Exec '$R0 afscreds.exe'\r
-\r
-  RMDir /r "$INSTDIR\bin"\r
-\r
-   ; Do client components\r
-  SetOutPath "$INSTDIR\bin"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\comerr%WL%.dll"      "$INSTDIR\bin\comerr%WL%.dll"     "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss.exe"             "$INSTDIR\bin\gss.exe"            "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss-client.exe"      "$INSTDIR\bin\gss-client.exe"     "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss-server.exe"      "$INSTDIR\bin\gss-server.exe"     "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gssapi%WL%.dll"      "$INSTDIR\bin\gssapi%WL%.dll"     "$INSTDIR"\r
-  ;!insertmacro ReplaceDLL "${KFW_BIN_DIR}\k524init.exe"        "$INSTDIR\bin\k524init.exe"       "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kdestroy.exe"        "$INSTDIR\bin\kdestroy.exe"       "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kinit.exe"           "$INSTDIR\bin\kinit.exe"          "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\klist.exe"           "$INSTDIR\bin\klist.exe"          "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kpasswd.exe"         "$INSTDIR\bin\kpasswd.exe"        "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kvno.exe"            "$INSTDIR\bin\kvno.exe"           "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5_%WL%.dll"       "$INSTDIR\bin\krb5_%WL%.dll"      "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\k5sprt%WL%.dll"      "$INSTDIR\bin\k5sprt%WL%.dll"     "$INSTDIR"\r
-  ;!insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb524.dll"          "$INSTDIR\bin\krb524.dll"         "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krbcc%WL%.dll"       "$INSTDIR\bin\krbcc%WL%.dll"      "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krbcc%WL%s.exe"      "$INSTDIR\bin\krbcc%WL%s.exe"     "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\netidmgr.chm"        "$INSTDIR\bin\netidmgr.chm"       "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5cred.dll"        "$INSTDIR\bin\krb5cred.dll"       "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5cred_en_us.dll"  "$INSTDIR\bin\krb5cred_en_us.dll" "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\leashw%WL%.dll"      "$INSTDIR\bin\leashw%WL%.dll"     "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\ms2mit.exe"          "$INSTDIR\bin\ms2mit.exe"         "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\mit2ms.exe"          "$INSTDIR\bin\mit2ms.exe"         "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kcpytkt.exe"         "$INSTDIR\bin\kcpytkt.exe"        "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kdeltkt.exe"         "$INSTDIR\bin\kdeltkt.exe"        "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\wshelp%WL%.dll"      "$INSTDIR\bin\wshelp%WL%.dll"     "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\xpprof%WL%.dll"      "$INSTDIR\bin\xpprof%WL%.dll"     "$INSTDIR"\r
-\r
-  Call GetWindowsVersion\r
-  Pop $R0\r
-  StrCmp $R0 "2000" nid_inst2000\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\netidmgr.exe"         "$INSTDIR\bin\netidmgr.exe"       "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\nidmgr%WL%.dll"       "$INSTDIR\bin\nidmgr%WL%.dll"     "$INSTDIR"\r
-  goto nid_done\r
-nid_inst2000:  \r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\W2K\netidmgr.exe"     "$INSTDIR\bin\netidmgr.exe"       "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\W2K\nidmgr%WL%.dll"   "$INSTDIR\bin\nidmgr%WL%.dll"     "$INSTDIR"\r
-nid_done:\r
-\r
-!ifdef DEBUG\r
-!IFDEF CL_1400\r
-  !insertmacro ReplaceDLL "${SXSDIR1}\msvcr80d.dll"      "$INSTDIR\bin\msvcr80d.dll"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SXSDIR1}\msvcp80d.dll"      "$INSTDIR\bin\msvcp80d.dll"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SXSDIR2}\mfc80d.dll"        "$INSTDIR\bin\mfc80d.dll"    "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SXSLANG}\MFC80CHS.DLL"      "$INSTDIR\bin\MFC80CHS.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SXSLANG}\MFC80CHT.DLL"      "$INSTDIR\bin\MFC80CHT.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SXSLANG}\MFC80DEU.DLL"      "$INSTDIR\bin\MFC80DEU.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SXSLANG}\MFC80ENU.DLL"      "$INSTDIR\bin\MFC80ENU.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SXSLANG}\MFC80ESP.DLL"      "$INSTDIR\bin\MFC80ESP.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SXSLANG}\MFC80FRA.DLL"      "$INSTDIR\bin\MFC80FRA.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SXSLANG}\MFC80ITA.DLL"      "$INSTDIR\bin\MFC80ITA.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SXSLANG}\MFC80JPN.DLL"      "$INSTDIR\bin\MFC80JPN.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SXSLANG}\MFC80KOR.DLL"      "$INSTDIR\bin\MFC80KOR.DLL"  "$INSTDIR"\r
-  !IFDEF X86\r
-  !insertmacro ReplaceDLL   "${SXSMAND}\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest"   "$INSTDIR\bin\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest"  "$INSTDIR"\r
-  !ELSE\r
-  !IFDEF AMD64\r
-  !insertmacro ReplaceDLL "${SXSMAND}\AMD64_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest" "$INSTDIR\bin\AMD64_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest"  "$INSTDIR"\r
-  !ENDIF\r
-  !ENDIF\r
-!ELSE                                                                   \r
-!IFDEF CL_1310\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71d.dll"    "$INSTDIR\bin\msvcr71d.dll"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71d.dll"    "$INSTDIR\bin\msvcp71d.dll"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71d.dll"      "$INSTDIR\bin\mfc71d.dll"    "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL"    "$INSTDIR\bin\MFC71CHS.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL"    "$INSTDIR\bin\MFC71CHT.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL"    "$INSTDIR\bin\MFC71DEU.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL"    "$INSTDIR\bin\MFC71ENU.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL"    "$INSTDIR\bin\MFC71ESP.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL"    "$INSTDIR\bin\MFC71FRA.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL"    "$INSTDIR\bin\MFC71ITA.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL"    "$INSTDIR\bin\MFC71JPN.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL"    "$INSTDIR\bin\MFC71KOR.DLL"  "$INSTDIR"\r
-!ELSE                                                                   \r
-!IFDEF CL_1300                                                          \r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70d.dll"    "$INSTDIR\bin\msvcr70d.dll"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70d.dll"    "$INSTDIR\bin\msvcp70d.dll"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70d.dll"      "$INSTDIR\bin\mfc70d.dll"    "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL"    "$INSTDIR\bin\MFC70CHS.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL"    "$INSTDIR\bin\MFC70CHT.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL"    "$INSTDIR\bin\MFC70DEU.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL"    "$INSTDIR\bin\MFC70ENU.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL"    "$INSTDIR\bin\MFC70ESP.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL"    "$INSTDIR\bin\MFC70FRA.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL"    "$INSTDIR\bin\MFC70ITA.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL"    "$INSTDIR\bin\MFC70JPN.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL"    "$INSTDIR\bin\MFC70KOR.DLL"  "$INSTDIR"\r
-!ELSE                                                                   \r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42d.dll"      "$INSTDIR\bin\mfc42d.dll"    "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60d.dll"    "$INSTDIR\bin\msvcp60d.dll"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrtd.dll"     "$INSTDIR\bin\msvcrtd.dll"   "$INSTDIR"\r
-!ENDIF                                                                  \r
-!ENDIF                                                                  \r
-!ENDIF\r
-!ELSE                                                                   \r
-;!IFDEF CL_1400\r
-;  GetTempFileName $R0\r
-;  File /oname=$R0 '${REDISTDIR}\vcredist_x86.exe'\r
-;  nsExec::Exec '$R0'\r
-;!ELSE                                                                   \r
-!IFDEF CL_1310                                                          \r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71.dll"       "$INSTDIR\bin\mfc71.dll"     "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71.dll"     "$INSTDIR\bin\msvcr71.dll"   "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71.dll"     "$INSTDIR\bin\msvcp71.dll"   "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL"    "$INSTDIR\bin\MFC71CHS.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL"    "$INSTDIR\bin\MFC71CHT.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL"    "$INSTDIR\bin\MFC71DEU.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL"    "$INSTDIR\bin\MFC71ENU.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL"    "$INSTDIR\bin\MFC71ESP.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL"    "$INSTDIR\bin\MFC71FRA.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL"    "$INSTDIR\bin\MFC71ITA.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL"    "$INSTDIR\bin\MFC71JPN.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL"    "$INSTDIR\bin\MFC71KOR.DLL"  "$INSTDIR"\r
-!ELSE                                                                   \r
-!IFDEF CL_1300                                                          \r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70.dll"       "$INSTDIR\bin\mfc70.dll"     "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70.dll"     "$INSTDIR\bin\msvcr70.dll"   "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70.dll"     "$INSTDIR\bin\msvcp70.dll"   "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL"    "$INSTDIR\bin\MFC70CHS.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL"    "$INSTDIR\bin\MFC70CHT.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL"    "$INSTDIR\bin\MFC70DEU.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL"    "$INSTDIR\bin\MFC70ENU.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL"    "$INSTDIR\bin\MFC70ESP.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL"    "$INSTDIR\bin\MFC70FRA.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL"    "$INSTDIR\bin\MFC70ITA.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL"    "$INSTDIR\bin\MFC70JPN.DLL"  "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL"    "$INSTDIR\bin\MFC70KOR.DLL"  "$INSTDIR"\r
-!ELSE                                                                   \r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42.dll"       "$INSTDIR\bin\mfc42.dll"     "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60.dll"     "$INSTDIR\bin\msvcp60.dll"   "$INSTDIR"\r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrt.dll"      "$INSTDIR\bin\msvcrt.dll"    "$INSTDIR"\r
-!ENDIF                                                                  \r
-!ENDIF                                                                  \r
-;!ENDIF\r
-!ENDIF                                                                  \r
-  !insertmacro ReplaceDLL "${SYSTEMDIR}\psapi.dll"       "$INSTDIR\bin\psapi.dll"     "$INSTDIR"\r
-   \r
-  ; Do WINDOWSDIR components\r
-  ;SetOutPath "$WINDOWSDIR"\r
-!ifdef DEBUG\r
-!endif\r
-  \r
-  ; Do Windows SYSDIR (Control panel)\r
-  SetOutPath "$SYSDIR"\r
-  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kfwlogon.dll" "$SYSDIR\kfwlogon.dll" "$INSTDIR"\r
-  File "${KFW_BIN_DIR}\kfwcpcc.exe"  \r
-\r
-  ; Get Kerberos config files\r
-  Call kfw.GetConfigFiles\r
-\r
-  Call KFWCommon.Install\r
-  \r
-  ; KfW Reg entries\r
-  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "VersionString" ${KFW_VERSION}\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Title" "KfW"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Description" "${PROGRAM_NAME}"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PathName" "$INSTDIR"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Software Type" "Authentication"\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION}\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION}\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL}\r
-\r
-  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "VersionString" ${KFW_VERSION}\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Title" "KfW"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Description" "${PROGRAM_NAME}"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "PathName" "$INSTDIR"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Software Type" "Authentication"\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION}\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION}\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL}\r
-\r
-  ; Daemon entries\r
-  WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos" "" ""\r
-  WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "ProviderPath" "$SYSDIR\kfwlogon.dll"\r
-  WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "AuthentProviderPath" "$SYSDIR\kfwlogon.dll"\r
-  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "Class" 2\r
-  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "VerboseLogging" 10\r
-\r
-  ; Must also add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\HwOrder\r
-  ; and HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order\r
-  ; to also include the service name.\r
-  Call AddProvider\r
-  ReadINIStr $R0 $1 "Field 7" "State"\r
-  WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "Name" "MIT Kerberos"\r
-  \r
-  ; WinLogon Event Notification\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Asynchronous" 0\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Impersonate"  0\r
-  WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "DLLName" "kfwlogon.dll"\r
-  WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Logon" "KFW_Logon_Event"\r
-\r
-  ; NetIdMgr Reg entries\r
-  WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Modules\MITKrb5" "ImagePath" "$INSTDIR\bin\krb5cred.dll"\r
-  WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Modules\MITKrb5" "PluginList" "Krb5Cred,Krb5Ident"\r
-\r
-  WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Module" "MITKrb5"\r
-  WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Description" "Kerberos v5 Credentials Provider"\r
-  WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Type"  1\r
-  WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Flags" 0\r
-  \r
-  WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Module" "MITKrb5"\r
-  WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Description" "Kerberos v5 Identity Provider"\r
-  WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Dependencies" "Krb5Cred"\r
-  WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Type"  2\r
-  WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Flags" 0\r
\r
-  ;Write start menu entries\r
-  CreateDirectory "$SMPROGRAMS\${PROGRAM_NAME}"\r
-  SetOutPath "$INSTDIR\bin"\r
-  CreateShortCut  "$SMPROGRAMS\${PROGRAM_NAME}\Uninstall ${PROGRAM_NAME}.lnk" "$INSTDIR\Uninstall.exe"\r
-\r
-  ReadINIStr $R0 $1 "Field 2" "State"  ; startup\r
-\r
-  CreateShortCut  "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager.lnk" "$INSTDIR\bin\netidmgr.exe" "" "$INSTDIR\bin\netidmgr.exe" \r
-\r
-startshort:\r
-  StrCmp $R0 "0" nostart\r
-  CreateShortCut  "$SMSTARTUP\Network Identity Manager.lnk" "$INSTDIR\bin\netidmgr.exe" "" "$INSTDIR\bin\netidmgr.exe" 0 SW_SHOWMINIMIZED\r
-  goto checkconflicts\r
-\r
-nostart:\r
-  Delete  "$SMSTARTUP\Network Identity Manager.lnk"\r
-\r
-checkconflicts:\r
-  Call GetSystemPath\r
-  Push "krb5_%WL%.dll"\r
-  Call SearchPath\r
-  Pop  $R0\r
-  StrCmp $R0 "" addpath\r
-\r
-  Push $R0\r
-  Call GetParent\r
-  Pop $R0\r
-  StrCmp $R0 "$INSTDIR\bin" addpath\r
-  MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "A previous installation of MIT Kerberos for Windows binaries has been found in folder $R0.  This may interfere with the use of the current installation."\r
-\r
-addpath:\r
-  ; Add kfw bin to path\r
-  Push "$INSTDIR\bin"\r
-  Call AddToSystemPath\r
-\r
-  Call GetWindowsVersion\r
-  Pop $R0\r
-  StrCmp $R0 "2003" addAllowTgtKey\r
-  StrCmp $R0 "2000" addAllowTgtKey\r
-  StrCmp $R0 "XP"   addAllowTgtKey\r
-  goto skipAllowTgtKey\r
-\r
-addAllowTgtKey:\r
-  ReadRegDWORD $R0 HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" \r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup" $R0\r
-  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" "1"\r
-  ReadRegDWORD $R0 HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" \r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup2" $R0\r
-  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" "1"\r
-skipAllowTgtKey:  \r
-\r
-  ; The following are keys added for Terminal Server compatibility\r
-  ; http://support.microsoft.com/default.aspx?scid=kb;EN-US;186499\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\netidmgr" "Flags" 0x408\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kinit" "Flags" 0x408\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\klist" "Flags" 0x408\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdestroy" "Flags" 0x408\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss" "Flags" 0x408\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-client" "Flags" 0x408\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-server" "Flags" 0x408\r
-  ;WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k524init" "Flags" 0x408\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kpasswd" "Flags" 0x408\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kvno" "Flags" 0x408\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\ms2mit" "Flags" 0x408\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms" "Flags" 0x408\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms" "Flags" 0x408\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kcpytkt" "Flags" 0x408\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdeltkt" "Flags" 0x408\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95" "Flags" 0x408\r
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95g" "Flags" 0x408\r
-\r
-SectionEnd\r
-\r
-Section "Debug Symbols" secDebug\r
-\r
-  SetOutPath "$INSTDIR\bin"\r
-  File "${KFW_BIN_DIR}\comerr%WL%.pdb"\r
-  File "${KFW_BIN_DIR}\gss.pdb"\r
-  File "${KFW_BIN_DIR}\gss-client.pdb"\r
-  File "${KFW_BIN_DIR}\gss-server.pdb"\r
-  File "${KFW_BIN_DIR}\gssapi%WL%.pdb"\r
-  ;File "${KFW_BIN_DIR}\k524init.pdb"\r
-  File "${KFW_BIN_DIR}\kdestroy.pdb"\r
-  File "${KFW_BIN_DIR}\kinit.pdb"\r
-  File "${KFW_BIN_DIR}\klist.pdb"\r
-  File "${KFW_BIN_DIR}\kpasswd.pdb"\r
-  File "${KFW_BIN_DIR}\kvno.pdb"\r
-  File "${KFW_BIN_DIR}\krb5_%WL%.pdb"\r
-  File "${KFW_BIN_DIR}\k5sprt%WL%.pdb"\r
-  ;File "${KFW_BIN_DIR}\krb524.pdb"\r
-  File "${KFW_BIN_DIR}\krbcc%WL%.pdb"\r
-  File "${KFW_BIN_DIR}\krbcc%WL%s.pdb"\r
-  File "${KFW_BIN_DIR}\leashw%WL%.pdb"\r
-  File "${KFW_BIN_DIR}\krb5cred.pdb"\r
-  File "${KFW_BIN_DIR}\ms2mit.pdb"\r
-  File "${KFW_BIN_DIR}\mit2ms.pdb"\r
-  File "${KFW_BIN_DIR}\kcpytkt.pdb"\r
-  File "${KFW_BIN_DIR}\kdeltkt.pdb"\r
-  File "${KFW_BIN_DIR}\wshelp%WL%.pdb"\r
-  File "${KFW_BIN_DIR}\xpprof%WL%.pdb"\r
-\r
-  Call GetWindowsVersion\r
-  Pop $R0\r
-  StrCmp $R0 "2000" nidpdb_inst2000\r
-  File "${KFW_BIN_DIR}\netidmgr.pdb"\r
-  File "${KFW_BIN_DIR}\nidmgr%WL%.pdb"\r
-  goto nidpdb_done\r
-nidpdb_inst2000:\r
-  File "${KFW_BIN_DIR}\W2K\netidmgr.pdb"\r
-  File "${KFW_BIN_DIR}\W2K\nidmgr%WL%.pdb"\r
-nidpdb_done:\r
-\r
-!IFDEF DEBUG\r
-!IFDEF CL_1400\r
-!IFDEF X86\r
-  File "$%SystemRoot%\symbols\dll\msvcr80d.i386.pdb"\r
-  File "$%SystemRoot%\symbols\dll\msvcp80d.i386.pdb"\r
-  File "$%SystemRoot%\symbols\dll\mfc80d.i386.pdb"\r
-!ELSE\r
-!IFDEF AMD64\r
-  File "$%SystemRoot%\symbols\dll\msvcr80d.AMD64.pdb"\r
-  File "$%SystemRoot%\symbols\dll\msvcp80d.AMD64.pdb"\r
-  File "$%SystemRoot%\symbols\dll\mfc80d.AMD64.pdb"\r
-!ENDIF  ; AMD64\r
-!ENDIF  ; X86  \r
-!ELSE   ; NOT CL_1400                                                                \r
-!IFDEF CL_1310\r
-  File "${SYSTEMDIR}\msvcr71d.pdb"                                           \r
-  File "${SYSTEMDIR}\msvcp71d.pdb"                                           \r
-  File "${SYSTEMDIR}\mfc71d.pdb"                                             \r
-!ELSE                                                                   \r
-!IFDEF CL_1300                                                          \r
-  File "${SYSTEMDIR}\msvcr70d.pdb"                                           \r
-  File "${SYSTEMDIR}\msvcp70d.pdb"                                           \r
-  File "${SYSTEMDIR}\mfc70d.pdb"                                             \r
-!ELSE                                                                   \r
-  File "${SYSTEMDIR}\mfc42d.pdb"                                             \r
-  File "${SYSTEMDIR}\msvcp60d.pdb"                                           \r
-  File "${SYSTEMDIR}\msvcrtd.pdb"                                            \r
-!ENDIF                                                                  \r
-!ENDIF                                                                  \r
-!ENDIF\r
-!ENDIF  ; DEBUG\r
-\r
-  SetOutPath "$SYSDIR"\r
-  File "${KFW_BIN_DIR}\kfwlogon.pdb"\r
-  File "${KFW_BIN_DIR}\kfwcpcc.pdb"\r
-\r
-SectionEnd\r
-\r
-;----------------------\r
-; Kerberos for Windows SDK\r
-Section "KfW SDK" secSDK\r
-\r
-  RMDir /r "$INSTDIR\inc"\r
-  RMDir /r "$INSTDIR\lib"\r
-  RMDir /r "$INSTDIR\install"\r
-  RMDir /r "$INSTDIR\sample"\r
-\r
-  SetOutPath "$INSTDIR\doc"\r
-  File /r "${KFW_DOC_DIR}\netiddev.chm"\r
-\r
-  SetOutPath "$INSTDIR\inc\krb5"\r
-  File /r "${KFW_INC_DIR}\krb5\*"  \r
-\r
-  SetOutPath "$INSTDIR\inc\leash"\r
-  File /r "${KFW_INC_DIR}\leash\*"  \r
-\r
-  SetOutPath "$INSTDIR\inc\loadfuncs"\r
-  File /r "${KFW_INC_DIR}\loadfuncs\*"  \r
-\r
-  SetOutPath "$INSTDIR\inc\netidmgr"\r
-  File /r "${KFW_INC_DIR}\netidmgr\*"  \r
-\r
-  SetOutPath "$INSTDIR\inc\wshelper"\r
-  File /r "${KFW_INC_DIR}\wshelper\*"  \r
-\r
-  SetOutPath "$INSTDIR\lib\%cpu%"\r
-  File /r "${KFW_LIB_DIR}\*"\r
-\r
-  SetOutPath "$INSTDIR\install"\r
-  File /r "${KFW_INSTALL_DIR}\*"\r
-\r
-  SetOutPath "$INSTDIR\sample"\r
-  File /r "${KFW_SAMPLE_DIR}\*"\r
-\r
-  CreateShortCut  "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Developer Documentation.lnk" "$INSTDIR\bin\netiddev.chm" \r
-\r
-  Call KFWCommon.Install\r
-  \r
-  ; KfW Reg entries\r
-  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "VersionString" ${KFW_VERSION}\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Title" "KfW"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Description" "${PROGRAM_NAME}"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PathName" "$INSTDIR"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Software Type" "Authentication"\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION}\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION}\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL}\r
-\r
-  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "VersionString" ${KFW_VERSION}\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Title" "KfW"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Description" "${PROGRAM_NAME}"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PathName" "$INSTDIR"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Software Type" "Authentication"\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION}\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION}\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL}\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL}\r
-\r
-SectionEnd\r
-\r
-;----------------------\r
-; Kerberos for Windows Documentation\r
-Section "KfW Documentation" secDocs\r
-\r
-  RMDir /r "$INSTDIR\doc"\r
-\r
-  SetOutPath "$INSTDIR\doc"\r
-  File "${KFW_DOC_DIR}\relnotes.html"\r
-  File "${KFW_DOC_DIR}\netidmgr_userdoc.pdf"\r
-   \r
-  Call KFWCommon.Install\r
-  \r
-  ; KfW Reg entries\r
-  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "VersionString" ${KFW_VERSION}\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Title" "KfW"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Description" "${PROGRAM_NAME}"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PathName" "$INSTDIR"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Software Type" "Authentication"\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION}\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION}\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL}\r
-\r
-  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "VersionString" ${KFW_VERSION}\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Title" "KfW"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Description" "${PROGRAM_NAME}"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PathName" "$INSTDIR"\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Software Type" "Authentication"\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION}\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION}\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL}\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL}\r
-  \r
-  ;Write start menu entries\r
-  CreateDirectory "$SMPROGRAMS\${PROGRAM_NAME}"\r
-  SetOutPath "$INSTDIR\doc"\r
-  CreateShortCut  "$SMPROGRAMS\${PROGRAM_NAME}\Release Notes.lnk" "$INSTDIR\doc\relnotes.html" \r
-  CreateShortCut  "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager User Documentation.lnk" "$INSTDIR\doc\netidmgr_userdoc.pdf" \r
-  CreateShortCut  "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager Documentation.lnk" "$INSTDIR\bin\netidmgr.chm" \r
-SectionEnd\r
-\r
-;Display the Finish header\r
-;Insert this macro after the sections if you are not using a finish page\r
-;!insertmacro MUI_SECTIONS_FINISHHEADER\r
-\r
-;--------------------------------\r
-;Installer Functions\r
-\r
-Function .onInit\r
-  !insertmacro MUI_LANGDLL_DISPLAY\r
-  \r
-  ; Set the default install options\r
-  Push $0\r
-\r
-   Call IsUserAdmin\r
-   Pop $R0\r
-   StrCmp $R0 "true" checkVer\r
-\r
-   MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "You must be an administrator of this machine to install this software."\r
-   Abort\r
-   \r
-checkVer:\r
-  ; Check Version of Windows.   Do not install onto Windows 95\r
-   Call GetWindowsVersion\r
-   Pop $R0\r
-   StrCmp $R0 "95" wrongVersion\r
-   StrCmp $R0 "98" wrongVersion\r
-   StrCmp $R0 "ME" wrongVersion\r
-   StrCmp $R0 "NT 4.0" wrongVersion\r
-   goto checkIPHLPAPI\r
-\r
-wrongVersion:\r
-   MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "MIT ${PROGRAM_NAME} requires Microsoft Windows 2000 or higher."\r
-   Abort\r
-\r
-checkIPHLPAPI:\r
-   ClearErrors\r
-   ReadEnvStr $R0 "WinDir"\r
-   GetDLLVersion "$R0\System32\iphlpapi.dll" $R1 $R2\r
-   IfErrors +1 +3 \r
-   GetDLLVersion "$R0\System\iphlpapi.dll" $R1 $R2\r
-   IfErrors iphlperror\r
-   IntOp $R3 $R2 / 0x00010000\r
-   IntCmpU $R3 1952 iphlpwarning checkprevious checkprevious\r
-\r
-iphlperror:\r
-   MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "MIT ${PROGRAM_NAME} requires Internet Explorer version 5.01 or higher. IPHLPAPI.DLL is missing."\r
-   Abort\r
-\r
-iphlpwarning:\r
-   MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "IPHLPAPI.DLL must be upgraded.  Please install Internet Explorer 5.01 or higher."\r
-\r
-checkprevious:\r
-  ClearErrors\r
-  ReadRegStr $R0 HKLM \\r
-  "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \\r
-  "DisplayVersion"\r
-  IfErrors testWIX\r
-  StrCmp $R0 "${KFW_VERSION}" contInstall\r
-\r
-  MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \\r
-  "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \\r
-  previous version or `Cancel` to cancel this upgrade or downgrade." \\r
-  IDOK uninstNSIS\r
-  Abort\r
-  \r
-;Run the uninstaller\r
-uninstNSIS:\r
-  ReadRegStr $R0 HKLM \\r
-  "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \\r
-  "UninstallString"\r
-  ClearErrors\r
-  ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file\r
-\r
-  IfErrors no_remove_uninstaller\r
-    ;You can either use Delete /REBOOTOK in the uninstaller or add some code\r
-    ;here to remove the uninstaller. Use a registry key to check\r
-    ;whether the user has chosen to uninstall. If you are using an uninstaller\r
-    ;components page, make sure all sections are uninstalled.\r
-\r
-  Push $R1\r
-  Call RestartRequired\r
-  Pop $R1\r
-  StrCmp $R1 "1" Restart DoNotRestart\r
-\r
-testWIX:\r
-  ClearErrors\r
-  ReadRegStr $R0 HKLM \\r
-  "Software\Microsoft\Windows\CurrentVersion\Uninstall\{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A}" \\r
-  "DisplayVersion"\r
-  IfErrors testSWRT\r
-\r
-  MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \\r
-  "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \\r
-  previous version or `Cancel` to cancel this installation." \\r
-  IDOK uninstMSI1\r
-  Abort\r
-  \r
-;Run the uninstaller\r
-uninstMSI1:\r
-  Call GetWindowsVersion\r
-  Pop $R0\r
-  StrCmp $R0 "2000" uninstMSI1_2000\r
-\r
-  ClearErrors\r
-  ExecWait 'MSIEXEC /x{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A} /passive /promptrestart'\r
-\r
-  IfErrors no_remove_uninstaller\r
-    ;You can either use Delete /REBOOTOK in the uninstaller or add some code\r
-    ;here to remove the uninstaller. Use a registry key to check\r
-    ;whether the user has chosen to uninstall. If you are using an uninstaller\r
-    ;components page, make sure all sections are uninstalled.\r
-\r
-  Push $R1\r
-  Call RestartRequired\r
-  Pop $R1\r
-  StrCmp $R1 "1" Restart DoNotRestart\r
-  \r
-uninstMSI1_2000:\r
-  ClearErrors\r
-  ExecWait 'MSIEXEC /x{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A}'\r
-\r
-  IfErrors no_remove_uninstaller\r
-    ;You can either use Delete /REBOOTOK in the uninstaller or add some code\r
-    ;here to remove the uninstaller. Use a registry key to check\r
-    ;whether the user has chosen to uninstall. If you are using an uninstaller\r
-    ;components page, make sure all sections are uninstalled.\r
-\r
-  Push $R1\r
-  Call RestartRequired\r
-  Pop $R1\r
-  StrCmp $R1 "1" Restart DoNotRestart\r
-  \r
-testSWRT:\r
-  ClearErrors\r
-  ReadRegStr $R0 HKLM \\r
-  "Software\Microsoft\Windows\CurrentVersion\Uninstall\{61211594-AAA1-4A98-A299-757326763CC7}" \\r
-  "DisplayVersion"\r
-  IfErrors testPismere\r
-\r
-  MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \\r
-  "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \\r
-  previous version or `Cancel` to cancel this installation." \\r
-  IDOK uninstMSI2\r
-  Abort\r
-  \r
-;Run the uninstaller\r
-uninstMSI2:\r
-  Call GetWindowsVersion\r
-  Pop $R0\r
-  StrCmp $R0 "2000" uninstMSI2_2000\r
-\r
-  ClearErrors\r
-  ExecWait 'MSIEXEC /x{61211594-AAA1-4A98-A299-757326763CC7} /passive /promptrestart'\r
-\r
-  IfErrors no_remove_uninstaller\r
-    ;You can either use Delete /REBOOTOK in the uninstaller or add some code\r
-    ;here to remove the uninstaller. Use a registry key to check\r
-    ;whether the user has chosen to uninstall. If you are using an uninstaller\r
-    ;components page, make sure all sections are uninstalled.\r
-\r
-  Push $R1\r
-  Call RestartRequired\r
-  Pop $R1\r
-  StrCmp $R1 "1" Restart DoNotRestart\r
-\r
-uninstMSI2_2000:\r
-  ClearErrors\r
-  ExecWait 'MSIEXEC /x{61211594-AAA1-4A98-A299-757326763CC7}'\r
-\r
-  IfErrors no_remove_uninstaller\r
-    ;You can either use Delete /REBOOTOK in the uninstaller or add some code\r
-    ;here to remove the uninstaller. Use a registry key to check\r
-    ;whether the user has chosen to uninstall. If you are using an uninstaller\r
-    ;components page, make sure all sections are uninstalled.\r
-\r
-  Push $R1\r
-  Call RestartRequired\r
-  Pop $R1\r
-  StrCmp $R1 "1" Restart DoNotRestart\r
-\r
-testPismere:\r
-  ClearErrors\r
-  ReadRegStr $R0 HKLM \\r
-  "Software\Microsoft\Windows\CurrentVersion\Uninstall\{83977767-388D-4DF8-BB08-3BF2401635BD}" \\r
-  "DisplayVersion"\r
-  IfErrors contInstall\r
-\r
-  MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \\r
-  "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \\r
-  previous version or `Cancel` to cancel this installation." \\r
-  IDOK uninstPismere\r
-  Abort\r
-  \r
-;Run the uninstaller\r
-uninstPismere:\r
-  Call GetWindowsVersion\r
-  Pop $R0\r
-  StrCmp $R0 "2000" uninstPismere_2000\r
-\r
-  ClearErrors\r
-  ExecWait 'MSIEXEC /x{83977767-388D-4DF8-BB08-3BF2401635BD} /passive /promptrestart'\r
-\r
-  IfErrors no_remove_uninstaller\r
-    ;You can either use Delete /REBOOTOK in the uninstaller or add some code\r
-    ;here to remove the uninstaller. Use a registry key to check\r
-    ;whether the user has chosen to uninstall. If you are using an uninstaller\r
-    ;components page, make sure all sections are uninstalled.\r
-\r
-  Push $R1\r
-  Call RestartRequired\r
-  Pop $R1\r
-  StrCmp $R1 "1" Restart DoNotRestart\r
-\r
-uninstPismere_2000:\r
-  ClearErrors\r
-  ExecWait 'MSIEXEC /x{83977767-388D-4DF8-BB08-3BF2401635BD}'\r
-\r
-  IfErrors no_remove_uninstaller\r
-    ;You can either use Delete /REBOOTOK in the uninstaller or add some code\r
-    ;here to remove the uninstaller. Use a registry key to check\r
-    ;whether the user has chosen to uninstall. If you are using an uninstaller\r
-    ;components page, make sure all sections are uninstalled.\r
-\r
-  Push $R1\r
-  Call RestartRequired\r
-  Pop $R1\r
-  StrCmp $R1 "1" Restart DoNotRestart\r
-\r
-\r
-Restart:\r
-   MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "Please reboot and then restart the installer."\r
-   Abort\r
-   MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "Abort failed"\r
\r
-DoNotRestart:\r
-no_remove_uninstaller:\r
-\r
-contInstall:\r
-   ; Never install debug symbols unless explicitly selected, except in DEBUG mode\r
-!IFNDEF DEBUG\r
-   SectionGetFlags ${secDebug} $0\r
-   IntOp $0 $0 & ${SECTION_OFF}\r
-   SectionSetFlags ${secDebug} $0\r
-!ELSE\r
-   SectionGetFlags ${secDebug} $0\r
-   IntOp $0 $0 | ${SF_SELECTED}\r
-   SectionSetFlags ${secDebug} $0\r
-!ENDIF\r
-\r
-   ; Our logic should be like this.\r
-   ;     1) If no KfW components are installed, we do a clean install with default options. (Client/Docs)\r
-   ;     2) If existing modules are installed, we keep them selected\r
-   ;     3) If it is an upgrade, we set the text accordingly, else we mark it as a re-install\r
-   ;  TODO: Downgrade?\r
-   Call IsAnyKfWInstalled\r
-   Pop $R0\r
-   StrCmp $R0 "0" DefaultOptions\r
-   \r
-   Call ShouldClientInstall\r
-   Pop $R2\r
-   \r
-   StrCmp $R2 "0" NoClient\r
-   StrCmp $R2 "1" ReinstallClient\r
-   StrCmp $R2 "2" UpgradeClient\r
-   StrCmp $R2 "3" DowngradeClient\r
-   \r
-       SectionGetFlags ${secClient} $0\r
-       IntOp $0 $0 | ${SF_SELECTED}\r
-       SectionSetFlags ${secClient} $0\r
-    ;# !insertmacro SelectSection ${secClient}\r
-   goto skipClient\r
-NoClient:\r
-       ;StrCpy $1 ${secClient} ; Gotta remember which section we are at now...\r
-       SectionGetFlags ${secClient} $0\r
-       IntOp $0 $0 & ${SECTION_OFF}\r
-       SectionSetFlags ${secClient} $0\r
-   goto skipClient\r
-UpgradeClient:\r
-       SectionGetFlags ${secClient} $0\r
-       IntOp $0 $0 | ${SF_SELECTED}\r
-       SectionSetFlags ${secClient} $0\r
-   SectionSetText ${secClient} $(UPGRADE_CLIENT)\r
-   goto skipClient\r
-ReinstallClient:\r
-       SectionGetFlags ${secClient} $0\r
-       IntOp $0 $0 | ${SF_SELECTED}\r
-       SectionSetFlags ${secClient} $0\r
-   SectionSetText ${secClient} $(REINSTALL_CLIENT)\r
-   goto skipClient\r
-DowngradeClient:\r
-       SectionGetFlags ${secClient} $0\r
-       IntOp $0 $0 | ${SF_SELECTED}\r
-       SectionSetFlags ${secClient} $0\r
-   SectionSetText ${secClient} $(DOWNGRADE_CLIENT)\r
-   goto skipClient\r
-\r
-   \r
-skipClient:   \r
-   \r
-   Call ShouldSDKInstall\r
-   Pop $R2\r
-   StrCmp $R2 "0" NoSDK\r
-   StrCmp $R2 "1" ReinstallSDK\r
-   StrCmp $R2 "2" UpgradeSDK\r
-   StrCmp $R2 "3" DowngradeSDK\r
-   \r
-       SectionGetFlags ${secSDK} $0\r
-       IntOp $0 $0 | ${SF_SELECTED}\r
-       SectionSetFlags ${secSDK} $0\r
-       ;# !insertmacro UnselectSection ${secSDK}\r
-   goto skipSDK\r
-\r
-UpgradeSDK:\r
-   SectionGetFlags ${secSDK} $0\r
-   IntOp $0 $0 | ${SF_SELECTED}\r
-   SectionSetFlags ${secSDK} $0\r
-   SectionSetText ${secSDK} $(UPGRADE_SDK)\r
-   goto skipSDK\r
-\r
-ReinstallSDK:\r
-   SectionGetFlags ${secSDK} $0\r
-   IntOp $0 $0 | ${SF_SELECTED}\r
-   SectionSetFlags ${secSDK} $0\r
-   SectionSetText ${secSDK} $(REINSTALL_SDK)\r
-   goto skipSDK\r
-\r
-DowngradeSDK:\r
-   SectionGetFlags ${secSDK} $0\r
-   IntOp $0 $0 | ${SF_SELECTED}\r
-   SectionSetFlags ${secSDK} $0\r
-   SectionSetText ${secSDK} $(DOWNGRADE_SDK)\r
-   goto skipSDK\r
-   \r
-NoSDK:\r
-       SectionGetFlags ${secSDK} $0\r
-       IntOp $0 $0 & ${SECTION_OFF}\r
-       SectionSetFlags ${secSDK} $0\r
-       ;# !insertmacro UnselectSection ${secSDK}\r
-   goto skipSDK\r
-   \r
-skipSDK:\r
-\r
-   Call ShouldDocumentationInstall\r
-   Pop $R2\r
-   StrCmp $R2 "0" NoDocumentation\r
-   StrCmp $R2 "1" ReinstallDocumentation\r
-   StrCmp $R2 "2" UpgradeDocumentation\r
-   StrCmp $R2 "3" DowngradeDocumentation\r
-   \r
-       SectionGetFlags ${secDocs} $0\r
-       IntOp $0 $0 | ${SF_SELECTED}\r
-       SectionSetFlags ${secDocs} $0\r
-       ;# !insertmacro UnselectSection ${secDocs}\r
-   goto skipDocumentation\r
-\r
-UpgradeDocumentation:\r
-   SectionGetFlags ${secDocs} $0\r
-   IntOp $0 $0 | ${SF_SELECTED}\r
-   SectionSetFlags ${secDocs} $0\r
-   SectionSetText ${secDocs} $(UPGRADE_DOCS)\r
-   goto skipDocumentation\r
-\r
-ReinstallDocumentation:\r
-   SectionGetFlags ${secDocs} $0\r
-   IntOp $0 $0 | ${SF_SELECTED}\r
-   SectionSetFlags ${secDocs} $0\r
-   SectionSetText ${secDocs} $(REINSTALL_DOCS)\r
-   goto skipDocumentation\r
-\r
-DowngradeDocumentation:\r
-   SectionGetFlags ${secDocs} $0\r
-   IntOp $0 $0 | ${SF_SELECTED}\r
-   SectionSetFlags ${secDocs} $0\r
-   SectionSetText ${secDocs} $(DOWNGRADE_DOCS)\r
-   goto skipDocumentation\r
-   \r
-NoDocumentation:\r
-       SectionGetFlags ${secDocs} $0\r
-       IntOp $0 $0 & ${SECTION_OFF}\r
-       SectionSetFlags ${secDocs} $0\r
-       ;# !insertmacro UnselectSection ${secDocs}\r
-   goto skipDocumentation\r
-   \r
-skipDocumentation:\r
-   goto end\r
-   \r
-DefaultOptions:\r
-   ; Client Selected\r
-       SectionGetFlags ${secClient} $0\r
-       IntOp $0 $0 | ${SF_SELECTED}\r
-       SectionSetFlags ${secClient} $0\r
-\r
-   ; SDK NOT selected\r
-       SectionGetFlags ${secSDK} $0\r
-       IntOp $0 $0 & ${SECTION_OFF}\r
-       SectionSetFlags ${secSDK} $0\r
-   \r
-   ; Documentation selected\r
-       SectionGetFlags ${secDocs} $0\r
-       IntOp $0 $0 | ${SF_SELECTED}\r
-       SectionSetFlags ${secDocs} $0\r
-   goto end\r
-\r
-end:\r
-       Pop $0\r
-  \r
-   Push $R0\r
-  \r
-  ; See if we can set a default installation path...\r
-  ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PathName"\r
-  StrCmp $R0 "" TrySDK\r
-  StrCpy $INSTDIR $R0\r
-  goto Nope\r
-  \r
-TrySDK:\r
-  ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PathName"\r
-  StrCmp $R0 "" TryDocs\r
-  StrCpy $INSTDIR $R0\r
-  goto Nope\r
-\r
-TryDocs:\r
-  ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PathName"\r
-  StrCmp $R0 "" TryRoot\r
-  StrCpy $INSTDIR $R0\r
-  goto Nope\r
-\r
-TryRoot:\r
-  ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}" "InstallDir"\r
-  StrCmp $R0 "" Nope\r
-  StrCpy $INSTDIR $R0\r
-  \r
-Nope:\r
-  Pop $R0\r
-  \r
-  GetTempFilename $0\r
-  File /oname=$0 KfWConfigPage.ini\r
-  GetTempFilename $1\r
-  File /oname=$1 KfWConfigPage2.ini\r
-  \r
-FunctionEnd\r
-\r
-\r
-;--------------------------------\r
-; These are our cleanup functions\r
-Function .onInstFailed\r
-Delete $0\r
-Delete $1\r
-FunctionEnd\r
-\r
-Function .onInstSuccess\r
-Delete $0\r
-Delete $1\r
-FunctionEnd\r
-\r
-\r
-;--------------------------------\r
-;Descriptions\r
-\r
-  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\r
-  !insertmacro MUI_DESCRIPTION_TEXT ${secClient} $(DESC_secClient)\r
-  !insertmacro MUI_DESCRIPTION_TEXT ${secSDK} $(DESC_secSDK)\r
-  !insertmacro MUI_DESCRIPTION_TEXT ${secDocs} $(DESC_secDocs)\r
-  !insertmacro MUI_DESCRIPTION_TEXT ${secDebug} $(DESC_secDebug)\r
-  !insertmacro MUI_FUNCTION_DESCRIPTION_END\r
\r
-;--------------------------------\r
-;Uninstaller Section\r
-\r
-Section "Uninstall"\r
-  ; Make sure the user REALLY wants to do this, unless they did a silent uninstall, in which case...let them!\r
-  IfSilent StartRemove     ; New in v2.0b4\r
-  MessageBox MB_YESNO "Are you sure you want to remove MIT ${PROGRAM_NAME} from this machine?" IDYES StartRemove\r
-  abort\r
-  \r
-StartRemove:\r
-  \r
-  SetShellVarContext all\r
-  ; Stop the running processes\r
-  GetTempFileName $R0\r
-  File /oname=$R0 "Killer.exe"\r
-  nsExec::Exec '$R0 netidmgr.exe'\r
-  nsExec::Exec '$R0 krbcc%WL%s.exe'\r
-\r
-  Push "$INSTDIR\bin"\r
-  Call un.RemoveFromSystemPath\r
-  \r
-  ; Delete documentation\r
-  Delete "$INSTDIR\doc\relnotes.html"\r
-  Delete "$INSTDIR\doc\netidmgr_userdoc.pdf"\r
-  Delete "$INSTDIR\doc\netiddev.chm"\r
\r
-   Delete /REBOOTOK "$INSTDIR\bin\comerr%WL%.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\gss.exe"\r
-   Delete /REBOOTOK "$INSTDIR\bin\gss-client.exe"\r
-   Delete /REBOOTOK "$INSTDIR\bin\gss-server.exe"\r
-   Delete /REBOOTOK "$INSTDIR\bin\gssapi32.dll"\r
-   ;Delete /REBOOTOK "$INSTDIR\bin\k524init.exe"\r
-   Delete /REBOOTOK "$INSTDIR\bin\kdestroy.exe"\r
-   Delete /REBOOTOK "$INSTDIR\bin\kinit.exe"\r
-   Delete /REBOOTOK "$INSTDIR\bin\klist.exe"   \r
-   Delete /REBOOTOK "$INSTDIR\bin\kpasswd.exe"   \r
-   Delete /REBOOTOK "$INSTDIR\bin\kvno.exe"   \r
-   Delete /REBOOTOK "$INSTDIR\bin\krb5_%WL%.dll" \r
-   Delete /REBOOTOK "$INSTDIR\bin\k5sprt%WL%.dll" \r
-   ;Delete /REBOOTOK "$INSTDIR\bin\krb524.dll"  \r
-   Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%.dll" \r
-   Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%s.exe"\r
-   Delete /REBOOTOK "$INSTDIR\bin\netidmgr.exe"      \r
-   Delete /REBOOTOK "$INSTDIR\bin\netidmgr.chm"      \r
-   Delete /REBOOTOK "$INSTDIR\bin\nidmgr%WL%.dll"      \r
-   Delete /REBOOTOK "$INSTDIR\bin\krb5cred.dll"      \r
-   Delete /REBOOTOK "$INSTDIR\bin\krb5cred_en_us.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\leashw%WL%.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\ms2mit.exe"  \r
-   Delete /REBOOTOK "$INSTDIR\bin\mit2ms.exe"  \r
-   Delete /REBOOTOK "$INSTDIR\bin\kcpytkt.exe"  \r
-   Delete /REBOOTOK "$INSTDIR\bin\kdeltkt.exe"  \r
-   Delete /REBOOTOK "$INSTDIR\bin\wshelp%WL%.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\xpprof%WL%.dll"\r
-   Delete /REBOOTOK "$SYSDIR\bin\kfwlogon.dll"\r
-   Delete /REBOOTOK "$SYSDIR\bin\kfwcpcc.exe"\r
-\r
-   Delete /REBOOTOK "$INSTDIR\bin\comerr%WL%.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\gss.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\gss-client.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\gss-server.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\gssapi32.pdb"\r
-   ;Delete /REBOOTOK "$INSTDIR\bin\k524init.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\kdestroy.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\kinit.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\klist.pdb"   \r
-   Delete /REBOOTOK "$INSTDIR\bin\kpasswd.pdb"   \r
-   Delete /REBOOTOK "$INSTDIR\bin\kvno.pdb"   \r
-   Delete /REBOOTOK "$INSTDIR\bin\krb5_32.pdb" \r
-   Delete /REBOOTOK "$INSTDIR\bin\k5sprt%WL%.pdb" \r
-   ;Delete /REBOOTOK "$INSTDIR\bin\krb524.pdb"  \r
-   Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%.pdb" \r
-   Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%s.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\netidmgr.pdb"      \r
-   Delete /REBOOTOK "$INSTDIR\bin\nidmgr%WL%.pdb"      \r
-   Delete /REBOOTOK "$INSTDIR\bin\krb5cred.pdb"      \r
-   Delete /REBOOTOK "$INSTDIR\bin\leashw%WL%.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\ms2mit.pdb"  \r
-   Delete /REBOOTOK "$INSTDIR\bin\mit2ms.pdb"  \r
-   Delete /REBOOTOK "$INSTDIR\bin\kcpytkt.pdb"  \r
-   Delete /REBOOTOK "$INSTDIR\bin\kdeltkt.pdb"  \r
-   Delete /REBOOTOK "$INSTDIR\bin\wshelp%WL%.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\xpprof%WL%.pdb"\r
-   Delete /REBOOTOK "$SYSDIR\bin\kfwlogon.pdb"\r
-   Delete /REBOOTOK "$SYSDIR\bin\kfwcpcc.pdb"\r
-\r
-!IFDEF DEBUG\r
-!IFDEF CL_1400\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr80d.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr80d.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp80d.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp80d.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\mfc80d.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\mfc80d.pdb"\r
-!ELSE\r
-!IFDEF CL_1310\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\mfc71d.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\mfc71d.pdb"\r
-!ELSE\r
-!IFDEF CL_1300\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\mfc70d.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\mfc70d.pdb"\r
-!ELSE\r
-   Delete /REBOOTOK "$INSTDIR\bin\mfc42d.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\mfc42d.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.pdb"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.pdb"\r
-!ENDIF\r
-!ENDIF\r
-!ENDIF\r
-!ELSE\r
-!IFDEF CL_1400\r
-   Delete /REBOOTOK "$INSTDIR\bin\mfc80.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr80.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp80.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC80CHS.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC80CHT.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC80DEU.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC80ENU.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC80ESP.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC80FRA.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC80ITA.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC80JPN.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC80KOR.DLL"\r
-!ELSE\r
-!IFDEF CL_1310\r
-   Delete /REBOOTOK "$INSTDIR\bin\mfc71.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr71.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp71.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71CHS.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71CHT.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71DEU.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71ENU.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71ESP.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71FRA.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71ITA.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71JPN.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71KOR.DLL"\r
-!ELSE\r
-!IFDEF CL_1300\r
-   Delete /REBOOTOK "$INSTDIR\bin\mfc70.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr70.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp70.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70CHS.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70CHT.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70DEU.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70ENU.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70ESP.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70FRA.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70ITA.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70JPN.DLL"\r
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70KOR.DLL"\r
-!ELSE\r
-   Delete /REBOOTOK "$INSTDIR\bin\mfc42.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp60.dll"\r
-   Delete /REBOOTOK "$INSTDIR\bin\msvcrt.dll"\r
-!ENDIF\r
-!ENDIF\r
-!ENDIF\r
-!ENDIF\r
-   Delete /REBOOTOK "$INSTDIR\bin\psapi.dll"\r
-\r
-  RMDir  "$INSTDIR\bin"\r
-  RmDir  "$INSTDIR\doc"\r
-  RmDir  "$INSTDIR\lib"\r
-  RmDir  "$INSTDIR\inc"\r
-  RmDir  "$INSTDIR\install"\r
-  RMDir  "$INSTDIR"\r
-  \r
-  Delete  "$SMPROGRAMS\${PROGRAM_NAME}\Uninstall ${PROGRAM_NAME}.lnk"\r
-  Delete  "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager.lnk"\r
-  Delete  "$SMPROGRAMS\${PROGRAM_NAME}\Release Notes.lnk"\r
-  Delete  "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager User Documentation.lnk"\r
-  Delete  "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Developer Documentation.lnk"\r
-  RmDir   "$SMPROGRAMS\${PROGRAM_NAME}"\r
-  Delete  "$SMSTARTUP\Network Identity Manager.lnk"\r
-\r
-   IfSilent SkipAsk\r
-;  IfFileExists "$WINDIR\krb5.ini" CellExists SkipDelAsk\r
-;  RealmExists:\r
-  MessageBox MB_YESNO "Would you like to keep your configuration files?" IDYES SkipDel\r
-  SkipAsk:\r
-  Delete "$WINDIR\krb5.ini"\r
-  Delete "$WINDIR\krb.con"\r
-  Delete "$WINDIR\krbrealm.con"\r
-  \r
-  SkipDel:\r
-  Delete "$INSTDIR\Uninstall.exe"\r
-\r
-  ; Restore previous value of AllowTGTSessionKey \r
-  ReadRegDWORD $R0 HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup"\r
-  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" $R0\r
-  ReadRegDWORD $R0 HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup2"\r
-  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" $R0\r
-\r
-  ; The following are keys added for Terminal Server compatibility\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\netidmgr"\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kinit"\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\klist"\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdestroy"\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss"\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-client"\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-server"\r
-  ;DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k524init"\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kpasswd"\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kvno"\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\ms2mit"\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms"\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kcpytkt"\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdeltkt"\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95"\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95g"\r
-\r
-  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion"\r
-  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client"\r
-  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion"\r
-  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation"\r
-  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion"\r
-  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK"\r
-  DeleteRegKey /ifempty HKLM "${KFW_REGKEY_ROOT}"\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}"\r
-\r
-  ; NIM Registry Keys\r
-  DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Modules\MITKrb5"\r
-  DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins\Krb5Cred"\r
-  DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins\Krb5Ident"\r
-  DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager\Modules"\r
-  DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins"\r
-  DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager"\r
-  DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}"\r
\r
-  ; WinLogon Event Notification\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify\MIT_KFW"\r
-  DeleteRegKey HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos"\r
-\r
-  RMDir  "$INSTDIR"\r
-\r
-SectionEnd\r
-\r
-;--------------------------------\r
-;Uninstaller Functions\r
-\r
-Function un.onInit\r
-\r
-  ;Get language from registry\r
-  ReadRegStr $LANGUAGE ${MUI_LANGDLL_REGISTRY_ROOT} "${MUI_LANGDLL_REGISTRY_KEY}" "${MUI_LANGDLL_REGISTRY_VALUENAME}"\r
-                                                    \r
-FunctionEnd\r
-\r
-Function un.onUninstSuccess\r
-\r
-   MessageBox MB_OK "Please reboot your machine to complete uninstallation of the software"\r
-\r
-FunctionEnd\r
-\r
-;------------------------------\r
-; Get the Configurations files from the Internet\r
-\r
-Function kfw.GetConfigFiles\r
-\r
-;Check if we should download Config Files\r
-ReadINIStr $R0 $0 "Field 4" "State"\r
-StrCmp $R0 "1" DoDownload\r
-\r
-;Do nothing if we're keeping the existing file\r
-ReadINIStr $R0 $0 "Field 2" "State"\r
-StrCmp $R0 "1" done\r
-\r
-ReadINIStr $R0 $0 "Field 3" "State"\r
-StrCmp $R0 "1" UsePackaged\r
-\r
-; If none of these, grab file from other location\r
-goto CheckOther\r
-\r
-DoDownload:\r
-   ReadINIStr $R0 $0 "Field 5" "State"\r
-   NSISdl::download "$R0/krb5.ini" "$WINDIR\krb5.ini"\r
-   NSISdl::download "$R0/krb.con" "$WINDIR\krb.con"\r
-   NSISdl::download "$R0/krbrealm.con" "$WINDIR\krbrealm.con"\r
-   Pop $R0 ;Get the return value\r
-   StrCmp $R0 "success" done\r
-   MessageBox MB_OK|MB_ICONSTOP "Download failed: $R0"\r
-   goto done\r
-\r
-UsePackaged:\r
-   SetOutPath "$WINDIR"\r
-   File "${KFW_CONFIG_DIR}\sample\krb5.ini"\r
-   File "${KFW_CONFIG_DIR}\sample\krb.con"\r
-   File "${KFW_CONFIG_DIR}\sample\krbrealm.con"\r
-   goto done\r
-   \r
-CheckOther:\r
-   ReadINIStr $R0 $0 "Field 7" "State"\r
-   StrCmp $R0 "" done\r
-   CopyFiles "$R0\krb5.ini" "$WINDIR\krb5.ini"\r
-   CopyFiles "$R0\krb.con" "$WINDIR\krb.con"\r
-   CopyFiles "$R0\krbrealm.con" "$WINDIR\krbrealm.con"\r
-   \r
-done:\r
-\r
-FunctionEnd\r
-\r
-\r
-\r
-;-------------------------------\r
-;Do the page to get the Config files\r
-\r
-Function KFWPageGetConfigFiles\r
-  ; Skip this page if we are not installing the client\r
-  SectionGetFlags ${secClient} $R0\r
-  IntOp $R0 $R0 & ${SF_SELECTED}\r
-  StrCmp $R0 "0" Skip\r
-  \r
-  ; Set the install options here\r
-  \r
-startOver:\r
-  WriteINIStr $0 "Field 2" "Flags" "DISABLED"\r
-  WriteINIStr $0 "Field 3" "State" "1"\r
-  WriteINIStr $0 "Field 4" "State" "0"\r
-  WriteINIStr $0 "Field 6" "State" "0"\r
-  WriteINIStr $0 "Field 3" "Text"  "Use packaged configuration files for the ${SAMPLE_CONFIG_REALM} realm."\r
-  WriteINIStr $0 "Field 5" "State"  "${HTTP_CONFIG_URL}"  \r
-\r
-  ; If there is an existing krb5.ini file, allow the user to choose it and make it default\r
-  IfFileExists "$WINDIR\krb5.ini" +1 notpresent\r
-  WriteINIStr $0 "Field 2" "Flags" "ENABLED"\r
-  WriteINIStr $0 "Field 2" "State" "1"\r
-  WriteINIStr $0 "Field 3" "State" "0"\r
-  \r
-  notpresent:\r
-  \r
-  !insertmacro MUI_HEADER_TEXT "Kerberos Configuration" "Please choose a method for installing the Kerberos Configuration files:" \r
-  InstallOptions::dialog $0\r
-  Pop $R1\r
-  StrCmp $R1 "cancel" exit\r
-  StrCmp $R1 "back" done\r
-  StrCmp $R1 "success" done\r
-exit: Quit\r
-done:\r
-\r
-   ; Check that if a file is set, a valid filename is entered...\r
-   ReadINIStr $R0 $0 "Field 6" "State"\r
-   StrCmp $R0 "1" CheckFileName\r
-   \r
-   ;Check if a URL is specified, one *IS* specified\r
-   ReadINIStr $R0 $0 "Field 4" "State"\r
-   StrCmp $R0 "1" CheckURL Skip\r
-   \r
-   CheckURL:\r
-   ReadINIStr $R0 $0 "Field 5" "State"\r
-   StrCmp $R0 "" +1 Skip\r
-   MessageBox MB_OK|MB_ICONSTOP $(URLError)\r
-   WriteINIStr $0 "Field 4" "State" "0"\r
-   goto startOver\r
-   \r
-   CheckFileName:\r
-   ReadINIStr $R0 $0 "Field 7" "State"\r
-   IfFileExists "$R0\krb5.ini" Skip\r
-\r
-   MessageBox MB_OK|MB_ICONSTOP $(ConfigFileError)\r
-   WriteINIStr $0 "Field 6" "State" "0"\r
-   goto startOver\r
-   \r
-   Skip:\r
-   \r
-FunctionEnd\r
-\r
-\r
-;-------------------------------\r
-;Do the page to get the Startup Configuration\r
-\r
-Function KFWPageGetStartupConfig\r
-  ; Skip this page if we are not installing the client\r
-  SectionGetFlags ${secClient} $R0\r
-  IntOp $R0 $R0 & ${SF_SELECTED}\r
-  StrCmp $R0 "0" Skip\r
-  \r
-  ; Set the install options here\r
-  \r
-  !insertmacro MUI_HEADER_TEXT "Network Identity Manager Setup" "Please select Network Identity ticket manager setup options:" \r
-  InstallOptions::dialog $1\r
-  Pop $R1\r
-  StrCmp $R1 "cancel" exit\r
-  StrCmp $R1 "back" done\r
-  StrCmp $R1 "success" done\r
-exit: \r
-  Quit\r
-done:\r
-skip:\r
-   \r
-FunctionEnd\r
-\r
-\r
-;-------------\r
-; Common install routines for each module\r
-Function KFWCommon.Install\r
-\r
-  WriteRegStr HKLM "${KFW_REGKEY_ROOT}" "InstallDir" $INSTDIR\r
-\r
-  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayName" "${PROGRAM_NAME}"\r
-  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "UninstallString" "$INSTDIR\uninstall.exe"\r
-!ifndef DEBUG\r
-  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayVersion" "${KFW_VERSION}"\r
-!else\r
-  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayVersion" "${KFW_VERSION} Checked/Debug"\r
-!endif\r
-  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "URLInfoAbout" "http://web.mit.edu/kerberos/"\r
-\r
-!ifdef DEBUG\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\CurrentVersion" "Debug" 1\r
-  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\${KFW_VERSION}" "Debug" 1\r
-!else\r
-   ; Delete the DEBUG string\r
-   DeleteRegValue HKLM "${KFW_REGKEY_ROOT}\CurrentVersion" "Debug"\r
-   DeleteRegValue HKLM "${KFW_REGKEY_ROOT}\${KFW_VERSION}" "Debug"\r
-!endif\r
-\r
-  WriteUninstaller "$INSTDIR\Uninstall.exe"\r
-FunctionEnd\r
-\r
-\r
-;-------------------------------\r
-; Check if the client should be checked for default install\r
-Function ShouldClientInstall\r
-   Push $R0\r
-   StrCpy $R2 "Client"\r
-   Call GetInstalledVersion\r
-   Pop $R0\r
-   \r
-   StrCmp $R0 "" NotInstalled\r
-   ; Now we see if it's an older or newer version\r
-\r
-   Call GetInstalledVersionMajor\r
-   Pop $R0\r
-   IntCmpU $R0 ${KFW_MAJORVERSION} +1 Upgrade Downgrade\r
-\r
-   Call GetInstalledVersionMinor\r
-   Pop $R0\r
-   IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade\r
-   \r
-   Call GetInstalledVersionPatch\r
-   Pop $R0\r
-   IntCmpU $R0 ${KFW_PATCHLEVEL} Reinstall Upgrade Downgrade\r
-   \r
-Reinstall:\r
-   StrCpy $R0 "1"\r
-   Exch $R0\r
-   goto end\r
-   \r
-Upgrade:\r
-   StrCpy $R0 "2"\r
-   Exch $R0\r
-   goto end\r
-   \r
-Downgrade:\r
-   StrCpy $R0 "3"\r
-   Exch $R0\r
-   goto end\r
-   \r
-NotInstalled:\r
-   StrCpy $R0 "0"\r
-   Exch $R0\r
-end:   \r
-FunctionEnd\r
-\r
-;-------------------------------\r
-; Check how the Documentation options should be set\r
-Function ShouldDocumentationInstall\r
-   Push $R0\r
-   StrCpy $R2 "Documentation"\r
-   Call GetInstalledVersion\r
-   Pop $R0\r
-   \r
-   StrCmp $R0 "" NotInstalled\r
-   ; Now we see if it's an older or newer version\r
-\r
-   Call GetInstalledVersionMajor\r
-   Pop $R0\r
-   IntCmpU $R0 ${KFW_MAJORVERSION} +1 Upgrade Downgrade\r
-\r
-   Call GetInstalledVersionMinor\r
-   Pop $R0\r
-   IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade\r
-   \r
-   Call GetInstalledVersionPatch\r
-   Pop $R0\r
-   IntCmpU $R0 ${KFW_PATCHLEVEL} Reinstall Upgrade Downgrade\r
-   \r
-Reinstall:\r
-   StrCpy $R0 "1"\r
-   Exch $R0\r
-   goto end\r
-   \r
-Upgrade:\r
-   StrCpy $R0 "2"\r
-   Exch $R0\r
-   goto end\r
-   \r
-Downgrade:\r
-   StrCpy $R0 "3"\r
-   Exch $R0\r
-   goto end\r
-   \r
-   \r
-NotInstalled:\r
-   StrCpy $R0 "0"\r
-   Exch $R0\r
-end:   \r
-FunctionEnd\r
-\r
-\r
-;-------------------------------\r
-; Check how the SDK options should be set\r
-Function ShouldSDKInstall\r
-   Push $R0\r
-   StrCpy $R2 "SDK"\r
-   Call GetInstalledVersion\r
-   Pop $R0\r
-   \r
-   StrCmp $R0 "" NotInstalled\r
-   ; Now we see if it's an older or newer version\r
-\r
-   Call GetInstalledVersionMajor\r
-   Pop $R0\r
-   IntCmpU $R0 ${KFW_MAJORVERSION} +1 Upgrade Downgrade\r
-\r
-   Call GetInstalledVersionMinor\r
-   Pop $R0\r
-   IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade\r
-   \r
-   Call GetInstalledVersionPatch\r
-   Pop $R0\r
-   IntCmpU $R0 ${KFW_PATCHLEVEL} Reinstall Upgrade Downgrade\r
-   \r
-Reinstall:\r
-   StrCpy $R0 "1"\r
-   Exch $R0\r
-   goto end\r
-   \r
-Upgrade:\r
-   StrCpy $R0 "2"\r
-   Exch $R0\r
-   goto end\r
-   \r
-Downgrade:\r
-   StrCpy $R0 "3"\r
-   Exch $R0\r
-   goto end\r
-   \r
-   \r
-NotInstalled:\r
-   StrCpy $R0 "0"\r
-   Exch $R0\r
-end:   \r
-FunctionEnd\r
-\r
-; See if KfW SDK is installed\r
-; Returns: "1" if it is, 0 if it is not (on the stack)\r
-Function IsSDKInstalled\r
-   Push $R0\r
-   StrCpy $R2 "SDK"\r
-   Call GetInstalledVersion\r
-   Pop $R0\r
-   \r
-   StrCmp $R0 "" NotInstalled\r
-   \r
-   StrCpy $R0 "1"\r
-   Exch $R0\r
-   goto end\r
-   \r
-NotInstalled:\r
-   StrCpy $R0 "0"\r
-   Exch $R0\r
-end:   \r
-FunctionEnd\r
-\r
-\r
-; See if KfW Client is installed\r
-; Returns: "1" if it is, 0 if it is not (on the stack)\r
-Function IsClientInstalled\r
-   Push $R0\r
-   StrCpy $R2 "Client"\r
-   Call GetInstalledVersion\r
-   Pop $R0\r
-   \r
-   StrCmp $R0 "" NotInstalled\r
-   \r
-   StrCpy $R0 "1"\r
-   Exch $R0\r
-   goto end\r
-   \r
-NotInstalled:\r
-   StrCpy $R0 "0"\r
-   Exch $R0\r
-end:   \r
-FunctionEnd\r
-\r
-\r
-\r
-; See if KfW Documentation is installed\r
-; Returns: "1" if it is, 0 if it is not (on the stack)\r
-Function IsDocumentationInstalled\r
-   Push $R0\r
-   StrCpy $R2 "Documentation"\r
-   Call GetInstalledVersion\r
-   Pop $R0\r
-   \r
-   StrCmp $R0 "" NotInstalled\r
-   \r
-   StrCpy $R0 "1"\r
-   Exch $R0\r
-   goto end\r
-   \r
-NotInstalled:\r
-   StrCpy $R0 "0"\r
-   Exch $R0\r
-end:   \r
-FunctionEnd\r
-\r
-\r
-\r
-;Check to see if any KfW component is installed\r
-;Returns: Value on stack: "1" if it is, "0" if it is not\r
-Function IsAnyKfWInstalled\r
-   Push $R0\r
-   Push $R1\r
-   Push $R2\r
-   Call IsClientInstalled\r
-   Pop $R0\r
-   Call IsSDKInstalled\r
-   Pop $R1\r
-   Call IsDocumentationInstalled\r
-   Pop $R2\r
-   ; Now we must see if ANY of the $Rn values are 1\r
-   StrCmp $R0 "1" SomethingInstalled\r
-   StrCmp $R1 "1" SomethingInstalled\r
-   StrCmp $R2 "1" SomethingInstalled\r
-   ;Nothing installed\r
-   StrCpy $R0 "0"\r
-   goto end\r
-SomethingInstalled:\r
-   StrCpy $R0 "1"\r
-end:\r
-   Pop $R2\r
-   Pop $R1\r
-   Exch $R0\r
-FunctionEnd\r
-\r
-;--------------------------------\r
-;Handle what must and what must not be installed\r
-Function .onSelChange\r
-   ; If they install the SDK, they MUST install the client\r
-   SectionGetFlags ${secSDK} $R0\r
-   IntOp $R0 $R0 & ${SF_SELECTED}\r
-   StrCmp $R0 "1" MakeClientSelected\r
-   goto end\r
-   \r
-MakeClientSelected:\r
-   SectionGetFlags ${secClient} $R0\r
-   IntOp $R0 $R0 | ${SF_SELECTED}\r
-   SectionSetFlags ${secClient} $R0\r
-   \r
-end:\r
-FunctionEnd\r
-\r
-Function AddProvider\r
-   Push $R0\r
-   Push $R1\r
-   ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder"\r
-   Push $R0\r
-   StrCpy $R0 "MIT Kerberos"\r
-   Push $R0\r
-   Call StrStr\r
-   Pop $R0\r
-   StrCmp $R0 "" DoOther +1\r
-   ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder"\r
-   StrCpy $R0 "$R1,MIT Kerberos"\r
-   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" $R0\r
-DoOther:\r
-   ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder"\r
-   Push $R0\r
-   StrCpy $R0 "MIT Kerberos"\r
-   Push $R0\r
-   Call StrStr\r
-   Pop $R0\r
-   StrCmp $R0 "" +1 End\r
-   ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder"\r
-   StrCpy $R0 "$R1,MIT Kerberos"\r
-   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" $R0\r
-End:\r
-   Pop $R1\r
-   Pop $R0\r
-FunctionEnd\r
-\r
-Function un.RemoveProvider\r
-   Push $R0\r
-   StrCpy $R0 "MIT Kerberos"\r
-   Push $R0\r
-   StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" \r
-   Call un.RemoveFromProvider\r
-   StrCpy $R0 "MIT Kerberos"\r
-   Push $R0\r
-   StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order"\r
-   Call un.RemoveFromProvider\r
-   Pop $R0\r
-FunctionEnd\r
-\r
-Function un.RemoveFromProvider\r
-  Exch $0\r
-  Push $1\r
-  Push $2\r
-  Push $3\r
-  Push $4\r
-  Push $5\r
-  Push $6\r
-\r
-  ReadRegStr $1 HKLM "$R0" "ProviderOrder"\r
-    StrCpy $5 $1 1 -1 # copy last char\r
-    StrCmp $5 "," +2 # if last char != ,\r
-      StrCpy $1 "$1," # append ,\r
-    Push $1\r
-    Push "$0,"\r
-    Call un.StrStr ; Find `$0,` in $1\r
-    Pop $2 ; pos of our dir\r
-    StrCmp $2 "" unRemoveFromPath_done\r
-      ; else, it is in path\r
-      # $0 - path to add\r
-      # $1 - path var\r
-      StrLen $3 "$0,"\r
-      StrLen $4 $2\r
-      StrCpy $5 $1 -$4 # $5 is now the part before the path to remove\r
-      StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove\r
-      StrCpy $3 $5$6\r
-\r
-      StrCpy $5 $3 1 -1 # copy last char\r
-      StrCmp $5 "," 0 +2 # if last char == ,\r
-        StrCpy $3 $3 -1 # remove last char\r
-\r
-      WriteRegStr HKLM "$R0" "ProviderOrder" $3\r
-\r
-  unRemoveFromPath_done:\r
-    Pop $6\r
-    Pop $5\r
-    Pop $4\r
-    Pop $3\r
-    Pop $2\r
-    Pop $1\r
-    Pop $0\r
-FunctionEnd\r
+;-----------------------------------------------------------------
+; KfW defines and functionality
+; Copyright (c) 2004,2005,2006,2007 Massachusetts Institute of Technology
+; Copyright (c) 2006,2007 Secure Endpoints Inc.
+
+!define KFW_VERSION "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}"
+
+!define PROGRAM_NAME "Kerberos for Windows"
+!ifdef RELEASE
+!ifndef DEBUG        ; !DEBUG on v2.0b4
+Name "MIT ${PROGRAM_NAME} ${KFW_VERSION}"
+!else                ; DEBUG on v2.0b4
+Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Checked/Debug"
+!endif               ; End DEBUG/!DEBUG
+!else
+!ifdef BETA
+!ifndef DEBUG        ; !DEBUG on v2.0b4
+Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Beta ${BETA}"
+!else                ; DEBUG on v2.0b4
+Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Beta ${BETA} Checked/Debug"
+!endif               ; End DEBUG/!DEBUG
+!else
+!ifndef DEBUG        ; !DEBUG on v2.0b4
+Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} ${__DATE__} ${__TIME__}"
+!else                ; DEBUG on v2.0b4
+Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} ${__DATE__} ${__TIME__} Checked/Debug"
+!endif               ; End DEBUG/!DEBUG
+!endif
+!endif
+VIProductVersion "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}.00"
+VIAddVersionKey "ProductName" "${PROGRAM_NAME}"
+VIAddVersionKey "CompanyName" "Massachusetts Institute of Technology"
+VIAddVersionKey "FileVersion"  ${VIProductVersion}
+VIAddVersionKey "ProductVersion"  "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}.0"
+VIAddVersionKey "FileDescription" "MIT Kerberos for Windows Installer"
+VIAddVersionKey "LegalCopyright" "(C)2004,2005,2006,2007"
+!ifdef DEBUG
+VIAddVersionKey "PrivateBuild" "Checked/Debug"
+!endif               ; End DEBUG
+
+
+;--------------------------------
+;Configuration
+
+  ;General
+  SetCompressor lzma
+!ifndef DEBUG
+  OutFile "MITKerberosForWindows.exe"
+!else
+  OutFile "MITKerberosForWindows-DEBUG.exe"
+!endif
+  SilentInstall normal
+  ShowInstDetails show
+  XPStyle on
+  !define MUI_ICON "kfw.ico"
+  !define MUI_UNICON "kfw.ico"
+  !define KFW_COMPANY_NAME "Massachusetts Institute of Technology"
+  !define KFW_PRODUCT_NAME "${PROGRAM_NAME}"
+  !define KFW_REGKEY_ROOT  "Software\MIT\Kerberos\"
+  !define NIM_REGKEY_ROOT  "Software\MIT\NetIDMgr\"
+  CRCCheck force
+  !define REPLACEDLL_NOREGISTER
+
+  ;Folder selection page
+  InstallDir "$PROGRAMFILES\MIT\Kerberos"      ; Install to shorter path
+  
+  ;Remember install folder
+  InstallDirRegKey HKLM "${KFW_REGKEY_ROOT}" ""
+  
+  ;Remember the installer language
+  !define MUI_LANGDLL_REGISTRY_ROOT "HKLM" 
+  !define MUI_LANGDLL_REGISTRY_KEY "${KFW_REGKEY_ROOT}" 
+  !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
+  
+  ;Where are the files?
+  !define KFW_BIN_DIR "${KFW_TARGETDIR}\bin\%cpu%"
+  !define KFW_DOC_DIR "${KFW_TARGETDIR}\doc"
+  !define KFW_INC_DIR "${KFW_TARGETDIR}\inc"
+  !define KFW_LIB_DIR "${KFW_TARGETDIR}\lib\%cpu%"
+  !define KFW_SAMPLE_DIR "${KFW_TARGETDIR}\sample"
+  !define KFW_INSTALL_DIR "${KFW_TARGETDIR}\install"
+  !define SYSTEMDIR   "$%SystemRoot%\System32" 
+  !define SXSDIR1     "$%SystemRoot%\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f"
+  !define SXSLANG     "c:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.MFCLOC"
+  !ifdef X86
+  !define SXSDIR2     "$%SystemRoot%\WinSxS\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_c8452471"
+  !define SXSMAND     "$%SystemRoot%\WinSxS\Manifests"
+  !else
+  !ifdef AMD64
+  !define SXSDIR2     "$%SystemRoot%\WinSxS\amd64_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_57812684"
+  !endif
+  !endif
+  
+  !define REDISTDIR   "c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86"
+
+;--------------------------------
+;Modern UI Configuration
+
+  !define MUI_LICENSEPAGE
+  !define MUI_CUSTOMPAGECOMMANDS
+  !define MUI_WELCOMEPAGE
+  !define MUI_COMPONENTSPAGE
+  !define MUI_COMPONENTSPAGE_SMALLDESC
+  !define MUI_DIRECTORYPAGE
+
+  !define MUI_ABORTWARNING
+  !define MUI_FINISHPAGE
+  
+  !define MUI_UNINSTALLER
+  !define MUI_UNCONFIRMPAGE
+  
+  
+  !insertmacro MUI_PAGE_WELCOME
+  !insertmacro MUI_PAGE_LICENSE "Licenses.rtf"
+  !insertmacro MUI_PAGE_COMPONENTS
+  !insertmacro MUI_PAGE_DIRECTORY
+  Page custom KFWPageGetConfigFiles
+  Page custom KFWPageGetStartupConfig
+  !insertmacro MUI_PAGE_INSTFILES
+  !insertmacro MUI_PAGE_FINISH
+  
+;--------------------------------
+;Languages
+
+  !insertmacro MUI_LANGUAGE "English"
+  
+;--------------------------------
+;Language Strings
+    
+  ;Descriptions
+  LangString DESC_SecCopyUI ${LANG_ENGLISH} "${PROGRAM_NAME}: English"
+
+  LangString DESC_secClient ${LANG_ENGLISH} "Client: Allows you to utilize MIT Kerberos from your Windows PC."
+  
+  LangString DESC_secDebug ${LANG_ENGLISH} "Debug Symbols: Used for debugging problems with MIT Kerberos for Windows"
+  
+  LangString DESC_secSDK ${LANG_ENGLISH} "SDK: Allows you to build MIT Kerberos aware applications."
+  
+  LangString DESC_secDocs ${LANG_ENGLISH} "Documentation: Release Notes and User Manuals."
+  
+; Popup error messages
+  LangString RealmNameError ${LANG_ENGLISH} "You must specify a realm name for your client to use."
+
+  LangString ConfigFileError ${LANG_ENGLISH} "You must specify a valid configuration file location from which files can be copied during the install"
+  LangString URLError ${LANG_ENGLISH} "You must specify a URL if you choose the option to download the config files."
+  
+; Upgrade/re-install strings
+   LangString UPGRADE_CLIENT ${LANG_ENGLISH} "Upgrade Kerberos Client"
+   LangString REINSTALL_CLIENT ${LANG_ENGLISH} "Re-install Kerberos Client"
+   LangString DOWNGRADE_CLIENT ${LANG_ENGLISH} "Downgrade Kerberos Client"
+  
+   LangString UPGRADE_SDK ${LANG_ENGLISH} "Upgrade Kerberos SDK"
+   LangString REINSTALL_SDK ${LANG_ENGLISH} "Re-install Kerberos SDK"
+   LangString DOWNGRADE_SDK ${LANG_ENGLISH} "Downgrade Kerberos SDK"
+  
+   LangString UPGRADE_DOCS ${LANG_ENGLISH} "Upgrade Kerberos Documentation"
+   LangString REINSTALL_DOCS ${LANG_ENGLISH} "Re-install Kerberos Documentation"
+   LangString DOWNGRADE_DOCS ${LANG_ENGLISH} "Downgrade Kerberos Documentation"
+  
+  ReserveFile "${KFW_CONFIG_DIR}\sample\krb.con"
+  ReserveFile "${KFW_CONFIG_DIR}\sample\krbrealm.con"
+  ReserveFile "${KFW_CONFIG_DIR}\sample\krb5.ini"
+  !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions plug-in
+  !insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog
+
+;--------------------------------
+;Reserve Files
+  
+  ;Things that need to be extracted on first (keep these lines before any File command!)
+  ;Only useful for BZIP2 compression
+  !insertmacro MUI_RESERVEFILE_LANGDLL
+  
+;--------------------------------
+; Load Macros
+!include "utils.nsi"
+
+;--------------------------------
+;Installer Sections
+
+;----------------------
+; Kerberos for Windows CLIENT
+Section "KfW Client" secClient
+
+  SetShellVarContext all
+  ; Stop any running services or we can't replace the files
+  ; Stop the running processes
+  GetTempFileName $R0
+  File /oname=$R0 "Killer.exe"
+  nsExec::Exec '$R0 netidmgr.exe'
+  nsExec::Exec '$R0 leash32.exe'
+  nsExec::Exec '$R0 krbcc%WL%s.exe'
+  nsExec::Exec '$R0 k95.exe'
+  nsExec::Exec '$R0 k95g.exe'
+  nsExec::Exec '$R0 krb5.exe'
+  nsExec::Exec '$R0 gss.exe'
+  nsExec::Exec '$R0 afscreds.exe'
+
+  RMDir /r "$INSTDIR\bin"
+
+   ; Do client components
+  SetOutPath "$INSTDIR\bin"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\comerr%WL%.dll"      "$INSTDIR\bin\comerr%WL%.dll"     "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss.exe"             "$INSTDIR\bin\gss.exe"            "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss-client.exe"      "$INSTDIR\bin\gss-client.exe"     "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss-server.exe"      "$INSTDIR\bin\gss-server.exe"     "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gssapi%WL%.dll"      "$INSTDIR\bin\gssapi%WL%.dll"     "$INSTDIR"
+  ;!insertmacro ReplaceDLL "${KFW_BIN_DIR}\k524init.exe"        "$INSTDIR\bin\k524init.exe"       "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kdestroy.exe"        "$INSTDIR\bin\kdestroy.exe"       "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kinit.exe"           "$INSTDIR\bin\kinit.exe"          "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\klist.exe"           "$INSTDIR\bin\klist.exe"          "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kpasswd.exe"         "$INSTDIR\bin\kpasswd.exe"        "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kvno.exe"            "$INSTDIR\bin\kvno.exe"           "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5_%WL%.dll"       "$INSTDIR\bin\krb5_%WL%.dll"      "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\k5sprt%WL%.dll"      "$INSTDIR\bin\k5sprt%WL%.dll"     "$INSTDIR"
+  ;!insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb524.dll"          "$INSTDIR\bin\krb524.dll"         "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krbcc%WL%.dll"       "$INSTDIR\bin\krbcc%WL%.dll"      "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krbcc%WL%s.exe"      "$INSTDIR\bin\krbcc%WL%s.exe"     "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\netidmgr.chm"        "$INSTDIR\bin\netidmgr.chm"       "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5cred.dll"        "$INSTDIR\bin\krb5cred.dll"       "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5cred_en_us.dll"  "$INSTDIR\bin\krb5cred_en_us.dll" "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\leashw%WL%.dll"      "$INSTDIR\bin\leashw%WL%.dll"     "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\ms2mit.exe"          "$INSTDIR\bin\ms2mit.exe"         "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\mit2ms.exe"          "$INSTDIR\bin\mit2ms.exe"         "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kcpytkt.exe"         "$INSTDIR\bin\kcpytkt.exe"        "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kdeltkt.exe"         "$INSTDIR\bin\kdeltkt.exe"        "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\wshelp%WL%.dll"      "$INSTDIR\bin\wshelp%WL%.dll"     "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\xpprof%WL%.dll"      "$INSTDIR\bin\xpprof%WL%.dll"     "$INSTDIR"
+
+  Call GetWindowsVersion
+  Pop $R0
+  StrCmp $R0 "2000" nid_inst2000
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\netidmgr.exe"         "$INSTDIR\bin\netidmgr.exe"       "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\nidmgr%WL%.dll"       "$INSTDIR\bin\nidmgr%WL%.dll"     "$INSTDIR"
+  goto nid_done
+nid_inst2000:  
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\W2K\netidmgr.exe"     "$INSTDIR\bin\netidmgr.exe"       "$INSTDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\W2K\nidmgr%WL%.dll"   "$INSTDIR\bin\nidmgr%WL%.dll"     "$INSTDIR"
+nid_done:
+
+!ifdef DEBUG
+!IFDEF CL_1400
+  !insertmacro ReplaceDLL "${SXSDIR1}\msvcr80d.dll"      "$INSTDIR\bin\msvcr80d.dll"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SXSDIR1}\msvcp80d.dll"      "$INSTDIR\bin\msvcp80d.dll"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SXSDIR2}\mfc80d.dll"        "$INSTDIR\bin\mfc80d.dll"    "$INSTDIR"
+  !insertmacro ReplaceDLL "${SXSLANG}\MFC80CHS.DLL"      "$INSTDIR\bin\MFC80CHS.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SXSLANG}\MFC80CHT.DLL"      "$INSTDIR\bin\MFC80CHT.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SXSLANG}\MFC80DEU.DLL"      "$INSTDIR\bin\MFC80DEU.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SXSLANG}\MFC80ENU.DLL"      "$INSTDIR\bin\MFC80ENU.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SXSLANG}\MFC80ESP.DLL"      "$INSTDIR\bin\MFC80ESP.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SXSLANG}\MFC80FRA.DLL"      "$INSTDIR\bin\MFC80FRA.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SXSLANG}\MFC80ITA.DLL"      "$INSTDIR\bin\MFC80ITA.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SXSLANG}\MFC80JPN.DLL"      "$INSTDIR\bin\MFC80JPN.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SXSLANG}\MFC80KOR.DLL"      "$INSTDIR\bin\MFC80KOR.DLL"  "$INSTDIR"
+  !IFDEF X86
+  !insertmacro ReplaceDLL   "${SXSMAND}\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest"   "$INSTDIR\bin\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest"  "$INSTDIR"
+  !ELSE
+  !IFDEF AMD64
+  !insertmacro ReplaceDLL "${SXSMAND}\AMD64_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest" "$INSTDIR\bin\AMD64_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest"  "$INSTDIR"
+  !ENDIF
+  !ENDIF
+!ELSE                                                                   
+!IFDEF CL_1310
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71d.dll"    "$INSTDIR\bin\msvcr71d.dll"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71d.dll"    "$INSTDIR\bin\msvcp71d.dll"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71d.dll"      "$INSTDIR\bin\mfc71d.dll"    "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL"    "$INSTDIR\bin\MFC71CHS.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL"    "$INSTDIR\bin\MFC71CHT.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL"    "$INSTDIR\bin\MFC71DEU.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL"    "$INSTDIR\bin\MFC71ENU.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL"    "$INSTDIR\bin\MFC71ESP.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL"    "$INSTDIR\bin\MFC71FRA.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL"    "$INSTDIR\bin\MFC71ITA.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL"    "$INSTDIR\bin\MFC71JPN.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL"    "$INSTDIR\bin\MFC71KOR.DLL"  "$INSTDIR"
+!ELSE                                                                   
+!IFDEF CL_1300                                                          
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70d.dll"    "$INSTDIR\bin\msvcr70d.dll"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70d.dll"    "$INSTDIR\bin\msvcp70d.dll"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70d.dll"      "$INSTDIR\bin\mfc70d.dll"    "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL"    "$INSTDIR\bin\MFC70CHS.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL"    "$INSTDIR\bin\MFC70CHT.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL"    "$INSTDIR\bin\MFC70DEU.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL"    "$INSTDIR\bin\MFC70ENU.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL"    "$INSTDIR\bin\MFC70ESP.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL"    "$INSTDIR\bin\MFC70FRA.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL"    "$INSTDIR\bin\MFC70ITA.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL"    "$INSTDIR\bin\MFC70JPN.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL"    "$INSTDIR\bin\MFC70KOR.DLL"  "$INSTDIR"
+!ELSE                                                                   
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42d.dll"      "$INSTDIR\bin\mfc42d.dll"    "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60d.dll"    "$INSTDIR\bin\msvcp60d.dll"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrtd.dll"     "$INSTDIR\bin\msvcrtd.dll"   "$INSTDIR"
+!ENDIF                                                                  
+!ENDIF                                                                  
+!ENDIF
+!ELSE                                                                   
+;!IFDEF CL_1400
+;  GetTempFileName $R0
+;  File /oname=$R0 '${REDISTDIR}\vcredist_x86.exe'
+;  nsExec::Exec '$R0'
+;!ELSE                                                                   
+!IFDEF CL_1310                                                          
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71.dll"       "$INSTDIR\bin\mfc71.dll"     "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71.dll"     "$INSTDIR\bin\msvcr71.dll"   "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71.dll"     "$INSTDIR\bin\msvcp71.dll"   "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL"    "$INSTDIR\bin\MFC71CHS.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL"    "$INSTDIR\bin\MFC71CHT.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL"    "$INSTDIR\bin\MFC71DEU.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL"    "$INSTDIR\bin\MFC71ENU.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL"    "$INSTDIR\bin\MFC71ESP.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL"    "$INSTDIR\bin\MFC71FRA.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL"    "$INSTDIR\bin\MFC71ITA.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL"    "$INSTDIR\bin\MFC71JPN.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL"    "$INSTDIR\bin\MFC71KOR.DLL"  "$INSTDIR"
+!ELSE                                                                   
+!IFDEF CL_1300                                                          
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70.dll"       "$INSTDIR\bin\mfc70.dll"     "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70.dll"     "$INSTDIR\bin\msvcr70.dll"   "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70.dll"     "$INSTDIR\bin\msvcp70.dll"   "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL"    "$INSTDIR\bin\MFC70CHS.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL"    "$INSTDIR\bin\MFC70CHT.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL"    "$INSTDIR\bin\MFC70DEU.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL"    "$INSTDIR\bin\MFC70ENU.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL"    "$INSTDIR\bin\MFC70ESP.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL"    "$INSTDIR\bin\MFC70FRA.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL"    "$INSTDIR\bin\MFC70ITA.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL"    "$INSTDIR\bin\MFC70JPN.DLL"  "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL"    "$INSTDIR\bin\MFC70KOR.DLL"  "$INSTDIR"
+!ELSE                                                                   
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42.dll"       "$INSTDIR\bin\mfc42.dll"     "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60.dll"     "$INSTDIR\bin\msvcp60.dll"   "$INSTDIR"
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrt.dll"      "$INSTDIR\bin\msvcrt.dll"    "$INSTDIR"
+!ENDIF                                                                  
+!ENDIF                                                                  
+;!ENDIF
+!ENDIF                                                                  
+  !insertmacro ReplaceDLL "${SYSTEMDIR}\psapi.dll"       "$INSTDIR\bin\psapi.dll"     "$INSTDIR"
+   
+  ; Do WINDOWSDIR components
+  ;SetOutPath "$WINDOWSDIR"
+!ifdef DEBUG
+!endif
+  
+  ; Do Windows SYSDIR (Control panel)
+  SetOutPath "$SYSDIR"
+  !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kfwlogon.dll" "$SYSDIR\kfwlogon.dll" "$INSTDIR"
+  File "${KFW_BIN_DIR}\kfwcpcc.exe"  
+
+  ; Get Kerberos config files
+  Call kfw.GetConfigFiles
+
+  Call KFWCommon.Install
+  
+  ; KfW Reg entries
+  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "VersionString" ${KFW_VERSION}
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Title" "KfW"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Description" "${PROGRAM_NAME}"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PathName" "$INSTDIR"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Software Type" "Authentication"
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION}
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION}
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL}
+
+  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "VersionString" ${KFW_VERSION}
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Title" "KfW"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Description" "${PROGRAM_NAME}"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "PathName" "$INSTDIR"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Software Type" "Authentication"
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION}
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION}
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL}
+
+  ; Daemon entries
+  WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos" "" ""
+  WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "ProviderPath" "$SYSDIR\kfwlogon.dll"
+  WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "AuthentProviderPath" "$SYSDIR\kfwlogon.dll"
+  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "Class" 2
+  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "VerboseLogging" 10
+
+  ; Must also add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\HwOrder
+  ; and HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order
+  ; to also include the service name.
+  Call AddProvider
+  ReadINIStr $R0 $1 "Field 7" "State"
+  WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "Name" "MIT Kerberos"
+  
+  ; WinLogon Event Notification
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Asynchronous" 0
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Impersonate"  0
+  WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "DLLName" "kfwlogon.dll"
+  WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Logon" "KFW_Logon_Event"
+
+  ; NetIdMgr Reg entries
+  WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Modules\MITKrb5" "ImagePath" "$INSTDIR\bin\krb5cred.dll"
+  WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Modules\MITKrb5" "PluginList" "Krb5Cred,Krb5Ident"
+
+  WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Module" "MITKrb5"
+  WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Description" "Kerberos v5 Credentials Provider"
+  WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Type"  1
+  WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Flags" 0
+  
+  WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Module" "MITKrb5"
+  WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Description" "Kerberos v5 Identity Provider"
+  WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Dependencies" "Krb5Cred"
+  WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Type"  2
+  WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Flags" 0
+  ;Write start menu entries
+  CreateDirectory "$SMPROGRAMS\${PROGRAM_NAME}"
+  SetOutPath "$INSTDIR\bin"
+  CreateShortCut  "$SMPROGRAMS\${PROGRAM_NAME}\Uninstall ${PROGRAM_NAME}.lnk" "$INSTDIR\Uninstall.exe"
+
+  ReadINIStr $R0 $1 "Field 2" "State"  ; startup
+
+  CreateShortCut  "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager.lnk" "$INSTDIR\bin\netidmgr.exe" "" "$INSTDIR\bin\netidmgr.exe" 
+
+startshort:
+  StrCmp $R0 "0" nostart
+  CreateShortCut  "$SMSTARTUP\Network Identity Manager.lnk" "$INSTDIR\bin\netidmgr.exe" "" "$INSTDIR\bin\netidmgr.exe" 0 SW_SHOWMINIMIZED
+  goto checkconflicts
+
+nostart:
+  Delete  "$SMSTARTUP\Network Identity Manager.lnk"
+
+checkconflicts:
+  Call GetSystemPath
+  Push "krb5_%WL%.dll"
+  Call SearchPath
+  Pop  $R0
+  StrCmp $R0 "" addpath
+
+  Push $R0
+  Call GetParent
+  Pop $R0
+  StrCmp $R0 "$INSTDIR\bin" addpath
+  MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "A previous installation of MIT Kerberos for Windows binaries has been found in folder $R0.  This may interfere with the use of the current installation."
+
+addpath:
+  ; Add kfw bin to path
+  Push "$INSTDIR\bin"
+  Call AddToSystemPath
+
+  Call GetWindowsVersion
+  Pop $R0
+  StrCmp $R0 "2003" addAllowTgtKey
+  StrCmp $R0 "2000" addAllowTgtKey
+  StrCmp $R0 "XP"   addAllowTgtKey
+  goto skipAllowTgtKey
+
+addAllowTgtKey:
+  ReadRegDWORD $R0 HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" 
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup" $R0
+  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" "1"
+  ReadRegDWORD $R0 HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" 
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup2" $R0
+  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" "1"
+skipAllowTgtKey:  
+
+  ; The following are keys added for Terminal Server compatibility
+  ; http://support.microsoft.com/default.aspx?scid=kb;EN-US;186499
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\netidmgr" "Flags" 0x408
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kinit" "Flags" 0x408
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\klist" "Flags" 0x408
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdestroy" "Flags" 0x408
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss" "Flags" 0x408
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-client" "Flags" 0x408
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-server" "Flags" 0x408
+  ;WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k524init" "Flags" 0x408
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kpasswd" "Flags" 0x408
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kvno" "Flags" 0x408
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\ms2mit" "Flags" 0x408
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms" "Flags" 0x408
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms" "Flags" 0x408
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kcpytkt" "Flags" 0x408
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdeltkt" "Flags" 0x408
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95" "Flags" 0x408
+  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95g" "Flags" 0x408
+
+SectionEnd
+
+Section "Debug Symbols" secDebug
+
+  SetOutPath "$INSTDIR\bin"
+  File "${KFW_BIN_DIR}\comerr%WL%.pdb"
+  File "${KFW_BIN_DIR}\gss.pdb"
+  File "${KFW_BIN_DIR}\gss-client.pdb"
+  File "${KFW_BIN_DIR}\gss-server.pdb"
+  File "${KFW_BIN_DIR}\gssapi%WL%.pdb"
+  ;File "${KFW_BIN_DIR}\k524init.pdb"
+  File "${KFW_BIN_DIR}\kdestroy.pdb"
+  File "${KFW_BIN_DIR}\kinit.pdb"
+  File "${KFW_BIN_DIR}\klist.pdb"
+  File "${KFW_BIN_DIR}\kpasswd.pdb"
+  File "${KFW_BIN_DIR}\kvno.pdb"
+  File "${KFW_BIN_DIR}\krb5_%WL%.pdb"
+  File "${KFW_BIN_DIR}\k5sprt%WL%.pdb"
+  ;File "${KFW_BIN_DIR}\krb524.pdb"
+  File "${KFW_BIN_DIR}\krbcc%WL%.pdb"
+  File "${KFW_BIN_DIR}\krbcc%WL%s.pdb"
+  File "${KFW_BIN_DIR}\leashw%WL%.pdb"
+  File "${KFW_BIN_DIR}\krb5cred.pdb"
+  File "${KFW_BIN_DIR}\ms2mit.pdb"
+  File "${KFW_BIN_DIR}\mit2ms.pdb"
+  File "${KFW_BIN_DIR}\kcpytkt.pdb"
+  File "${KFW_BIN_DIR}\kdeltkt.pdb"
+  File "${KFW_BIN_DIR}\wshelp%WL%.pdb"
+  File "${KFW_BIN_DIR}\xpprof%WL%.pdb"
+
+  Call GetWindowsVersion
+  Pop $R0
+  StrCmp $R0 "2000" nidpdb_inst2000
+  File "${KFW_BIN_DIR}\netidmgr.pdb"
+  File "${KFW_BIN_DIR}\nidmgr%WL%.pdb"
+  goto nidpdb_done
+nidpdb_inst2000:
+  File "${KFW_BIN_DIR}\W2K\netidmgr.pdb"
+  File "${KFW_BIN_DIR}\W2K\nidmgr%WL%.pdb"
+nidpdb_done:
+
+!IFDEF DEBUG
+!IFDEF CL_1400
+!IFDEF X86
+  File "$%SystemRoot%\symbols\dll\msvcr80d.i386.pdb"
+  File "$%SystemRoot%\symbols\dll\msvcp80d.i386.pdb"
+  File "$%SystemRoot%\symbols\dll\mfc80d.i386.pdb"
+!ELSE
+!IFDEF AMD64
+  File "$%SystemRoot%\symbols\dll\msvcr80d.AMD64.pdb"
+  File "$%SystemRoot%\symbols\dll\msvcp80d.AMD64.pdb"
+  File "$%SystemRoot%\symbols\dll\mfc80d.AMD64.pdb"
+!ENDIF  ; AMD64
+!ENDIF  ; X86  
+!ELSE   ; NOT CL_1400                                                                
+!IFDEF CL_1310
+  File "${SYSTEMDIR}\msvcr71d.pdb"                                           
+  File "${SYSTEMDIR}\msvcp71d.pdb"                                           
+  File "${SYSTEMDIR}\mfc71d.pdb"                                             
+!ELSE                                                                   
+!IFDEF CL_1300                                                          
+  File "${SYSTEMDIR}\msvcr70d.pdb"                                           
+  File "${SYSTEMDIR}\msvcp70d.pdb"                                           
+  File "${SYSTEMDIR}\mfc70d.pdb"                                             
+!ELSE                                                                   
+  File "${SYSTEMDIR}\mfc42d.pdb"                                             
+  File "${SYSTEMDIR}\msvcp60d.pdb"                                           
+  File "${SYSTEMDIR}\msvcrtd.pdb"                                            
+!ENDIF                                                                  
+!ENDIF                                                                  
+!ENDIF
+!ENDIF  ; DEBUG
+
+  SetOutPath "$SYSDIR"
+  File "${KFW_BIN_DIR}\kfwlogon.pdb"
+  File "${KFW_BIN_DIR}\kfwcpcc.pdb"
+
+SectionEnd
+
+;----------------------
+; Kerberos for Windows SDK
+Section "KfW SDK" secSDK
+
+  RMDir /r "$INSTDIR\inc"
+  RMDir /r "$INSTDIR\lib"
+  RMDir /r "$INSTDIR\install"
+  RMDir /r "$INSTDIR\sample"
+
+  SetOutPath "$INSTDIR\doc"
+  File /r "${KFW_DOC_DIR}\netiddev.chm"
+
+  SetOutPath "$INSTDIR\inc\krb5"
+  File /r "${KFW_INC_DIR}\krb5\*"  
+
+  SetOutPath "$INSTDIR\inc\leash"
+  File /r "${KFW_INC_DIR}\leash\*"  
+
+  SetOutPath "$INSTDIR\inc\loadfuncs"
+  File /r "${KFW_INC_DIR}\loadfuncs\*"  
+
+  SetOutPath "$INSTDIR\inc\netidmgr"
+  File /r "${KFW_INC_DIR}\netidmgr\*"  
+
+  SetOutPath "$INSTDIR\inc\wshelper"
+  File /r "${KFW_INC_DIR}\wshelper\*"  
+
+  SetOutPath "$INSTDIR\lib\%cpu%"
+  File /r "${KFW_LIB_DIR}\*"
+
+  SetOutPath "$INSTDIR\install"
+  File /r "${KFW_INSTALL_DIR}\*"
+
+  SetOutPath "$INSTDIR\sample"
+  File /r "${KFW_SAMPLE_DIR}\*"
+
+  CreateShortCut  "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Developer Documentation.lnk" "$INSTDIR\bin\netiddev.chm" 
+
+  Call KFWCommon.Install
+  
+  ; KfW Reg entries
+  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "VersionString" ${KFW_VERSION}
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Title" "KfW"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Description" "${PROGRAM_NAME}"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PathName" "$INSTDIR"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Software Type" "Authentication"
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION}
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION}
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL}
+
+  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "VersionString" ${KFW_VERSION}
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Title" "KfW"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Description" "${PROGRAM_NAME}"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PathName" "$INSTDIR"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Software Type" "Authentication"
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION}
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION}
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL}
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL}
+
+SectionEnd
+
+;----------------------
+; Kerberos for Windows Documentation
+Section "KfW Documentation" secDocs
+
+  RMDir /r "$INSTDIR\doc"
+
+  SetOutPath "$INSTDIR\doc"
+  File "${KFW_DOC_DIR}\relnotes.html"
+  File "${KFW_DOC_DIR}\netidmgr_userdoc.pdf"
+   
+  Call KFWCommon.Install
+  
+  ; KfW Reg entries
+  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "VersionString" ${KFW_VERSION}
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Title" "KfW"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Description" "${PROGRAM_NAME}"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PathName" "$INSTDIR"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Software Type" "Authentication"
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION}
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION}
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL}
+
+  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "VersionString" ${KFW_VERSION}
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Title" "KfW"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Description" "${PROGRAM_NAME}"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PathName" "$INSTDIR"
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Software Type" "Authentication"
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION}
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION}
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL}
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL}
+  
+  ;Write start menu entries
+  CreateDirectory "$SMPROGRAMS\${PROGRAM_NAME}"
+  SetOutPath "$INSTDIR\doc"
+  CreateShortCut  "$SMPROGRAMS\${PROGRAM_NAME}\Release Notes.lnk" "$INSTDIR\doc\relnotes.html" 
+  CreateShortCut  "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager User Documentation.lnk" "$INSTDIR\doc\netidmgr_userdoc.pdf" 
+  CreateShortCut  "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager Documentation.lnk" "$INSTDIR\bin\netidmgr.chm" 
+SectionEnd
+
+;Display the Finish header
+;Insert this macro after the sections if you are not using a finish page
+;!insertmacro MUI_SECTIONS_FINISHHEADER
+
+;--------------------------------
+;Installer Functions
+
+Function .onInit
+  !insertmacro MUI_LANGDLL_DISPLAY
+  
+  ; Set the default install options
+  Push $0
+
+   Call IsUserAdmin
+   Pop $R0
+   StrCmp $R0 "true" checkVer
+
+   MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "You must be an administrator of this machine to install this software."
+   Abort
+   
+checkVer:
+  ; Check Version of Windows.   Do not install onto Windows 95
+   Call GetWindowsVersion
+   Pop $R0
+   StrCmp $R0 "95" wrongVersion
+   StrCmp $R0 "98" wrongVersion
+   StrCmp $R0 "ME" wrongVersion
+   StrCmp $R0 "NT 4.0" wrongVersion
+   goto checkIPHLPAPI
+
+wrongVersion:
+   MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "MIT ${PROGRAM_NAME} requires Microsoft Windows 2000 or higher."
+   Abort
+
+checkIPHLPAPI:
+   ClearErrors
+   ReadEnvStr $R0 "WinDir"
+   GetDLLVersion "$R0\System32\iphlpapi.dll" $R1 $R2
+   IfErrors +1 +3 
+   GetDLLVersion "$R0\System\iphlpapi.dll" $R1 $R2
+   IfErrors iphlperror
+   IntOp $R3 $R2 / 0x00010000
+   IntCmpU $R3 1952 iphlpwarning checkprevious checkprevious
+
+iphlperror:
+   MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "MIT ${PROGRAM_NAME} requires Internet Explorer version 5.01 or higher. IPHLPAPI.DLL is missing."
+   Abort
+
+iphlpwarning:
+   MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "IPHLPAPI.DLL must be upgraded.  Please install Internet Explorer 5.01 or higher."
+
+checkprevious:
+  ClearErrors
+  ReadRegStr $R0 HKLM \
+  "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \
+  "DisplayVersion"
+  IfErrors testWIX
+  StrCmp $R0 "${KFW_VERSION}" contInstall
+
+  MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
+  "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \
+  previous version or `Cancel` to cancel this upgrade or downgrade." \
+  IDOK uninstNSIS
+  Abort
+  
+;Run the uninstaller
+uninstNSIS:
+  ReadRegStr $R0 HKLM \
+  "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \
+  "UninstallString"
+  ClearErrors
+  ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
+
+  IfErrors no_remove_uninstaller
+    ;You can either use Delete /REBOOTOK in the uninstaller or add some code
+    ;here to remove the uninstaller. Use a registry key to check
+    ;whether the user has chosen to uninstall. If you are using an uninstaller
+    ;components page, make sure all sections are uninstalled.
+
+  Push $R1
+  Call RestartRequired
+  Pop $R1
+  StrCmp $R1 "1" Restart DoNotRestart
+
+testWIX:
+  ClearErrors
+  ReadRegStr $R0 HKLM \
+  "Software\Microsoft\Windows\CurrentVersion\Uninstall\{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A}" \
+  "DisplayVersion"
+  IfErrors testSWRT
+
+  MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
+  "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \
+  previous version or `Cancel` to cancel this installation." \
+  IDOK uninstMSI1
+  Abort
+  
+;Run the uninstaller
+uninstMSI1:
+  Call GetWindowsVersion
+  Pop $R0
+  StrCmp $R0 "2000" uninstMSI1_2000
+
+  ClearErrors
+  ExecWait 'MSIEXEC /x{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A} /passive /promptrestart'
+
+  IfErrors no_remove_uninstaller
+    ;You can either use Delete /REBOOTOK in the uninstaller or add some code
+    ;here to remove the uninstaller. Use a registry key to check
+    ;whether the user has chosen to uninstall. If you are using an uninstaller
+    ;components page, make sure all sections are uninstalled.
+
+  Push $R1
+  Call RestartRequired
+  Pop $R1
+  StrCmp $R1 "1" Restart DoNotRestart
+  
+uninstMSI1_2000:
+  ClearErrors
+  ExecWait 'MSIEXEC /x{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A}'
+
+  IfErrors no_remove_uninstaller
+    ;You can either use Delete /REBOOTOK in the uninstaller or add some code
+    ;here to remove the uninstaller. Use a registry key to check
+    ;whether the user has chosen to uninstall. If you are using an uninstaller
+    ;components page, make sure all sections are uninstalled.
+
+  Push $R1
+  Call RestartRequired
+  Pop $R1
+  StrCmp $R1 "1" Restart DoNotRestart
+  
+testSWRT:
+  ClearErrors
+  ReadRegStr $R0 HKLM \
+  "Software\Microsoft\Windows\CurrentVersion\Uninstall\{61211594-AAA1-4A98-A299-757326763CC7}" \
+  "DisplayVersion"
+  IfErrors testPismere
+
+  MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
+  "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \
+  previous version or `Cancel` to cancel this installation." \
+  IDOK uninstMSI2
+  Abort
+  
+;Run the uninstaller
+uninstMSI2:
+  Call GetWindowsVersion
+  Pop $R0
+  StrCmp $R0 "2000" uninstMSI2_2000
+
+  ClearErrors
+  ExecWait 'MSIEXEC /x{61211594-AAA1-4A98-A299-757326763CC7} /passive /promptrestart'
+
+  IfErrors no_remove_uninstaller
+    ;You can either use Delete /REBOOTOK in the uninstaller or add some code
+    ;here to remove the uninstaller. Use a registry key to check
+    ;whether the user has chosen to uninstall. If you are using an uninstaller
+    ;components page, make sure all sections are uninstalled.
+
+  Push $R1
+  Call RestartRequired
+  Pop $R1
+  StrCmp $R1 "1" Restart DoNotRestart
+
+uninstMSI2_2000:
+  ClearErrors
+  ExecWait 'MSIEXEC /x{61211594-AAA1-4A98-A299-757326763CC7}'
+
+  IfErrors no_remove_uninstaller
+    ;You can either use Delete /REBOOTOK in the uninstaller or add some code
+    ;here to remove the uninstaller. Use a registry key to check
+    ;whether the user has chosen to uninstall. If you are using an uninstaller
+    ;components page, make sure all sections are uninstalled.
+
+  Push $R1
+  Call RestartRequired
+  Pop $R1
+  StrCmp $R1 "1" Restart DoNotRestart
+
+testPismere:
+  ClearErrors
+  ReadRegStr $R0 HKLM \
+  "Software\Microsoft\Windows\CurrentVersion\Uninstall\{83977767-388D-4DF8-BB08-3BF2401635BD}" \
+  "DisplayVersion"
+  IfErrors contInstall
+
+  MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
+  "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \
+  previous version or `Cancel` to cancel this installation." \
+  IDOK uninstPismere
+  Abort
+  
+;Run the uninstaller
+uninstPismere:
+  Call GetWindowsVersion
+  Pop $R0
+  StrCmp $R0 "2000" uninstPismere_2000
+
+  ClearErrors
+  ExecWait 'MSIEXEC /x{83977767-388D-4DF8-BB08-3BF2401635BD} /passive /promptrestart'
+
+  IfErrors no_remove_uninstaller
+    ;You can either use Delete /REBOOTOK in the uninstaller or add some code
+    ;here to remove the uninstaller. Use a registry key to check
+    ;whether the user has chosen to uninstall. If you are using an uninstaller
+    ;components page, make sure all sections are uninstalled.
+
+  Push $R1
+  Call RestartRequired
+  Pop $R1
+  StrCmp $R1 "1" Restart DoNotRestart
+
+uninstPismere_2000:
+  ClearErrors
+  ExecWait 'MSIEXEC /x{83977767-388D-4DF8-BB08-3BF2401635BD}'
+
+  IfErrors no_remove_uninstaller
+    ;You can either use Delete /REBOOTOK in the uninstaller or add some code
+    ;here to remove the uninstaller. Use a registry key to check
+    ;whether the user has chosen to uninstall. If you are using an uninstaller
+    ;components page, make sure all sections are uninstalled.
+
+  Push $R1
+  Call RestartRequired
+  Pop $R1
+  StrCmp $R1 "1" Restart DoNotRestart
+
+
+Restart:
+   MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "Please reboot and then restart the installer."
+   Abort
+   MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "Abort failed"
+DoNotRestart:
+no_remove_uninstaller:
+
+contInstall:
+   ; Never install debug symbols unless explicitly selected, except in DEBUG mode
+!IFNDEF DEBUG
+   SectionGetFlags ${secDebug} $0
+   IntOp $0 $0 & ${SECTION_OFF}
+   SectionSetFlags ${secDebug} $0
+!ELSE
+   SectionGetFlags ${secDebug} $0
+   IntOp $0 $0 | ${SF_SELECTED}
+   SectionSetFlags ${secDebug} $0
+!ENDIF
+
+   ; Our logic should be like this.
+   ;     1) If no KfW 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 IsAnyKfWInstalled
+   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
+   
+       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...
+       SectionGetFlags ${secClient} $0
+       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
+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} $(DOWNGRADE_CLIENT)
+   goto skipClient
+
+   
+skipClient:   
+   
+   Call ShouldSDKInstall
+   Pop $R2
+   StrCmp $R2 "0" NoSDK
+   StrCmp $R2 "1" ReinstallSDK
+   StrCmp $R2 "2" UpgradeSDK
+   StrCmp $R2 "3" DowngradeSDK
+   
+       SectionGetFlags ${secSDK} $0
+       IntOp $0 $0 | ${SF_SELECTED}
+       SectionSetFlags ${secSDK} $0
+       ;# !insertmacro UnselectSection ${secSDK}
+   goto skipSDK
+
+UpgradeSDK:
+   SectionGetFlags ${secSDK} $0
+   IntOp $0 $0 | ${SF_SELECTED}
+   SectionSetFlags ${secSDK} $0
+   SectionSetText ${secSDK} $(UPGRADE_SDK)
+   goto skipSDK
+
+ReinstallSDK:
+   SectionGetFlags ${secSDK} $0
+   IntOp $0 $0 | ${SF_SELECTED}
+   SectionSetFlags ${secSDK} $0
+   SectionSetText ${secSDK} $(REINSTALL_SDK)
+   goto skipSDK
+
+DowngradeSDK:
+   SectionGetFlags ${secSDK} $0
+   IntOp $0 $0 | ${SF_SELECTED}
+   SectionSetFlags ${secSDK} $0
+   SectionSetText ${secSDK} $(DOWNGRADE_SDK)
+   goto skipSDK
+   
+NoSDK:
+       SectionGetFlags ${secSDK} $0
+       IntOp $0 $0 & ${SECTION_OFF}
+       SectionSetFlags ${secSDK} $0
+       ;# !insertmacro UnselectSection ${secSDK}
+   goto skipSDK
+   
+skipSDK:
+
+   Call ShouldDocumentationInstall
+   Pop $R2
+   StrCmp $R2 "0" NoDocumentation
+   StrCmp $R2 "1" ReinstallDocumentation
+   StrCmp $R2 "2" UpgradeDocumentation
+   StrCmp $R2 "3" DowngradeDocumentation
+   
+       SectionGetFlags ${secDocs} $0
+       IntOp $0 $0 | ${SF_SELECTED}
+       SectionSetFlags ${secDocs} $0
+       ;# !insertmacro UnselectSection ${secDocs}
+   goto skipDocumentation
+
+UpgradeDocumentation:
+   SectionGetFlags ${secDocs} $0
+   IntOp $0 $0 | ${SF_SELECTED}
+   SectionSetFlags ${secDocs} $0
+   SectionSetText ${secDocs} $(UPGRADE_DOCS)
+   goto skipDocumentation
+
+ReinstallDocumentation:
+   SectionGetFlags ${secDocs} $0
+   IntOp $0 $0 | ${SF_SELECTED}
+   SectionSetFlags ${secDocs} $0
+   SectionSetText ${secDocs} $(REINSTALL_DOCS)
+   goto skipDocumentation
+
+DowngradeDocumentation:
+   SectionGetFlags ${secDocs} $0
+   IntOp $0 $0 | ${SF_SELECTED}
+   SectionSetFlags ${secDocs} $0
+   SectionSetText ${secDocs} $(DOWNGRADE_DOCS)
+   goto skipDocumentation
+   
+NoDocumentation:
+       SectionGetFlags ${secDocs} $0
+       IntOp $0 $0 & ${SECTION_OFF}
+       SectionSetFlags ${secDocs} $0
+       ;# !insertmacro UnselectSection ${secDocs}
+   goto skipDocumentation
+   
+skipDocumentation:
+   goto end
+   
+DefaultOptions:
+   ; Client Selected
+       SectionGetFlags ${secClient} $0
+       IntOp $0 $0 | ${SF_SELECTED}
+       SectionSetFlags ${secClient} $0
+
+   ; SDK NOT selected
+       SectionGetFlags ${secSDK} $0
+       IntOp $0 $0 & ${SECTION_OFF}
+       SectionSetFlags ${secSDK} $0
+   
+   ; Documentation selected
+       SectionGetFlags ${secDocs} $0
+       IntOp $0 $0 | ${SF_SELECTED}
+       SectionSetFlags ${secDocs} $0
+   goto end
+
+end:
+       Pop $0
+  
+   Push $R0
+  
+  ; See if we can set a default installation path...
+  ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PathName"
+  StrCmp $R0 "" TrySDK
+  StrCpy $INSTDIR $R0
+  goto Nope
+  
+TrySDK:
+  ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PathName"
+  StrCmp $R0 "" TryDocs
+  StrCpy $INSTDIR $R0
+  goto Nope
+
+TryDocs:
+  ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PathName"
+  StrCmp $R0 "" TryRoot
+  StrCpy $INSTDIR $R0
+  goto Nope
+
+TryRoot:
+  ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}" "InstallDir"
+  StrCmp $R0 "" Nope
+  StrCpy $INSTDIR $R0
+  
+Nope:
+  Pop $R0
+  
+  GetTempFilename $0
+  File /oname=$0 KfWConfigPage.ini
+  GetTempFilename $1
+  File /oname=$1 KfWConfigPage2.ini
+  
+FunctionEnd
+
+
+;--------------------------------
+; These are our cleanup functions
+Function .onInstFailed
+Delete $0
+Delete $1
+FunctionEnd
+
+Function .onInstSuccess
+Delete $0
+Delete $1
+FunctionEnd
+
+
+;--------------------------------
+;Descriptions
+
+  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+  !insertmacro MUI_DESCRIPTION_TEXT ${secClient} $(DESC_secClient)
+  !insertmacro MUI_DESCRIPTION_TEXT ${secSDK} $(DESC_secSDK)
+  !insertmacro MUI_DESCRIPTION_TEXT ${secDocs} $(DESC_secDocs)
+  !insertmacro MUI_DESCRIPTION_TEXT ${secDebug} $(DESC_secDebug)
+  !insertmacro MUI_FUNCTION_DESCRIPTION_END
+;--------------------------------
+;Uninstaller Section
+
+Section "Uninstall"
+  ; Make sure the user REALLY wants to do this, unless they did a silent uninstall, in which case...let them!
+  IfSilent StartRemove     ; New in v2.0b4
+  MessageBox MB_YESNO "Are you sure you want to remove MIT ${PROGRAM_NAME} from this machine?" IDYES StartRemove
+  abort
+  
+StartRemove:
+  
+  SetShellVarContext all
+  ; Stop the running processes
+  GetTempFileName $R0
+  File /oname=$R0 "Killer.exe"
+  nsExec::Exec '$R0 netidmgr.exe'
+  nsExec::Exec '$R0 krbcc%WL%s.exe'
+
+  Push "$INSTDIR\bin"
+  Call un.RemoveFromSystemPath
+  
+  ; Delete documentation
+  Delete "$INSTDIR\doc\relnotes.html"
+  Delete "$INSTDIR\doc\netidmgr_userdoc.pdf"
+  Delete "$INSTDIR\doc\netiddev.chm"
+   Delete /REBOOTOK "$INSTDIR\bin\comerr%WL%.dll"
+   Delete /REBOOTOK "$INSTDIR\bin\gss.exe"
+   Delete /REBOOTOK "$INSTDIR\bin\gss-client.exe"
+   Delete /REBOOTOK "$INSTDIR\bin\gss-server.exe"
+   Delete /REBOOTOK "$INSTDIR\bin\gssapi32.dll"
+   ;Delete /REBOOTOK "$INSTDIR\bin\k524init.exe"
+   Delete /REBOOTOK "$INSTDIR\bin\kdestroy.exe"
+   Delete /REBOOTOK "$INSTDIR\bin\kinit.exe"
+   Delete /REBOOTOK "$INSTDIR\bin\klist.exe"   
+   Delete /REBOOTOK "$INSTDIR\bin\kpasswd.exe"   
+   Delete /REBOOTOK "$INSTDIR\bin\kvno.exe"   
+   Delete /REBOOTOK "$INSTDIR\bin\krb5_%WL%.dll" 
+   Delete /REBOOTOK "$INSTDIR\bin\k5sprt%WL%.dll" 
+   ;Delete /REBOOTOK "$INSTDIR\bin\krb524.dll"  
+   Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%.dll" 
+   Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%s.exe"
+   Delete /REBOOTOK "$INSTDIR\bin\netidmgr.exe"      
+   Delete /REBOOTOK "$INSTDIR\bin\netidmgr.chm"      
+   Delete /REBOOTOK "$INSTDIR\bin\nidmgr%WL%.dll"      
+   Delete /REBOOTOK "$INSTDIR\bin\krb5cred.dll"      
+   Delete /REBOOTOK "$INSTDIR\bin\krb5cred_en_us.dll"
+   Delete /REBOOTOK "$INSTDIR\bin\leashw%WL%.dll"
+   Delete /REBOOTOK "$INSTDIR\bin\ms2mit.exe"  
+   Delete /REBOOTOK "$INSTDIR\bin\mit2ms.exe"  
+   Delete /REBOOTOK "$INSTDIR\bin\kcpytkt.exe"  
+   Delete /REBOOTOK "$INSTDIR\bin\kdeltkt.exe"  
+   Delete /REBOOTOK "$INSTDIR\bin\wshelp%WL%.dll"
+   Delete /REBOOTOK "$INSTDIR\bin\xpprof%WL%.dll"
+   Delete /REBOOTOK "$SYSDIR\bin\kfwlogon.dll"
+   Delete /REBOOTOK "$SYSDIR\bin\kfwcpcc.exe"
+
+   Delete /REBOOTOK "$INSTDIR\bin\comerr%WL%.pdb"
+   Delete /REBOOTOK "$INSTDIR\bin\gss.pdb"
+   Delete /REBOOTOK "$INSTDIR\bin\gss-client.pdb"
+   Delete /REBOOTOK "$INSTDIR\bin\gss-server.pdb"
+   Delete /REBOOTOK "$INSTDIR\bin\gssapi32.pdb"
+   ;Delete /REBOOTOK "$INSTDIR\bin\k524init.pdb"
+   Delete /REBOOTOK "$INSTDIR\bin\kdestroy.pdb"
+   Delete /REBOOTOK "$INSTDIR\bin\kinit.pdb"
+   Delete /REBOOTOK "$INSTDIR\bin\klist.pdb"   
+   Delete /REBOOTOK "$INSTDIR\bin\kpasswd.pdb"   
+   Delete /REBOOTOK "$INSTDIR\bin\kvno.pdb"   
+   Delete /REBOOTOK "$INSTDIR\bin\krb5_32.pdb" 
+   Delete /REBOOTOK "$INSTDIR\bin\k5sprt%WL%.pdb" 
+   ;Delete /REBOOTOK "$INSTDIR\bin\krb524.pdb"  
+   Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%.pdb" 
+   Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%s.pdb"
+   Delete /REBOOTOK "$INSTDIR\bin\netidmgr.pdb"      
+   Delete /REBOOTOK "$INSTDIR\bin\nidmgr%WL%.pdb"      
+   Delete /REBOOTOK "$INSTDIR\bin\krb5cred.pdb"      
+   Delete /REBOOTOK "$INSTDIR\bin\leashw%WL%.pdb"
+   Delete /REBOOTOK "$INSTDIR\bin\ms2mit.pdb"  
+   Delete /REBOOTOK "$INSTDIR\bin\mit2ms.pdb"  
+   Delete /REBOOTOK "$INSTDIR\bin\kcpytkt.pdb"  
+   Delete /REBOOTOK "$INSTDIR\bin\kdeltkt.pdb"  
+   Delete /REBOOTOK "$INSTDIR\bin\wshelp%WL%.pdb"
+   Delete /REBOOTOK "$INSTDIR\bin\xpprof%WL%.pdb"
+   Delete /REBOOTOK "$SYSDIR\bin\kfwlogon.pdb"
+   Delete /REBOOTOK "$SYSDIR\bin\kfwcpcc.pdb"
+
+!IFDEF DEBUG
+!IFDEF CL_1400
+   Delete /REBOOTOK "$INSTDIR\bin\msvcr80d.dll"
+   Delete /REBOOTOK "$INSTDIR\bin\msvcr80d.pdb"
+   Delete /REBOOTOK "$INSTDIR\bin\msvcp80d.dll"
+   Delete /REBOOTOK "$INSTDIR\bin\msvcp80d.pdb"
+   Delete /REBOOTOK "$INSTDIR\bin\mfc80d.dll"
+   Delete /REBOOTOK "$INSTDIR\bin\mfc80d.pdb"
+!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"
+!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"
+!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"
+!ENDIF
+!ENDIF
+!ENDIF
+!ELSE
+!IFDEF CL_1400
+   Delete /REBOOTOK "$INSTDIR\bin\mfc80.dll"
+   Delete /REBOOTOK "$INSTDIR\bin\msvcr80.dll"
+   Delete /REBOOTOK "$INSTDIR\bin\msvcp80.dll"
+   Delete /REBOOTOK "$INSTDIR\bin\MFC80CHS.DLL"
+   Delete /REBOOTOK "$INSTDIR\bin\MFC80CHT.DLL"
+   Delete /REBOOTOK "$INSTDIR\bin\MFC80DEU.DLL"
+   Delete /REBOOTOK "$INSTDIR\bin\MFC80ENU.DLL"
+   Delete /REBOOTOK "$INSTDIR\bin\MFC80ESP.DLL"
+   Delete /REBOOTOK "$INSTDIR\bin\MFC80FRA.DLL"
+   Delete /REBOOTOK "$INSTDIR\bin\MFC80ITA.DLL"
+   Delete /REBOOTOK "$INSTDIR\bin\MFC80JPN.DLL"
+   Delete /REBOOTOK "$INSTDIR\bin\MFC80KOR.DLL"
+!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"
+!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"
+!ELSE
+   Delete /REBOOTOK "$INSTDIR\bin\mfc42.dll"
+   Delete /REBOOTOK "$INSTDIR\bin\msvcp60.dll"
+   Delete /REBOOTOK "$INSTDIR\bin\msvcrt.dll"
+!ENDIF
+!ENDIF
+!ENDIF
+!ENDIF
+   Delete /REBOOTOK "$INSTDIR\bin\psapi.dll"
+
+  RMDir  "$INSTDIR\bin"
+  RmDir  "$INSTDIR\doc"
+  RmDir  "$INSTDIR\lib"
+  RmDir  "$INSTDIR\inc"
+  RmDir  "$INSTDIR\install"
+  RMDir  "$INSTDIR"
+  
+  Delete  "$SMPROGRAMS\${PROGRAM_NAME}\Uninstall ${PROGRAM_NAME}.lnk"
+  Delete  "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager.lnk"
+  Delete  "$SMPROGRAMS\${PROGRAM_NAME}\Release Notes.lnk"
+  Delete  "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager User Documentation.lnk"
+  Delete  "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Developer Documentation.lnk"
+  RmDir   "$SMPROGRAMS\${PROGRAM_NAME}"
+  Delete  "$SMSTARTUP\Network Identity Manager.lnk"
+
+   IfSilent SkipAsk
+;  IfFileExists "$WINDIR\krb5.ini" CellExists SkipDelAsk
+;  RealmExists:
+  MessageBox MB_YESNO "Would you like to keep your configuration files?" IDYES SkipDel
+  SkipAsk:
+  Delete "$WINDIR\krb5.ini"
+  Delete "$WINDIR\krb.con"
+  Delete "$WINDIR\krbrealm.con"
+  
+  SkipDel:
+  Delete "$INSTDIR\Uninstall.exe"
+
+  ; Restore previous value of AllowTGTSessionKey 
+  ReadRegDWORD $R0 HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup"
+  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" $R0
+  ReadRegDWORD $R0 HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup2"
+  WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" $R0
+
+  ; The following are keys added for Terminal Server compatibility
+  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\netidmgr"
+  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kinit"
+  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\klist"
+  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdestroy"
+  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss"
+  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-client"
+  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-server"
+  ;DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k524init"
+  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kpasswd"
+  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kvno"
+  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\ms2mit"
+  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms"
+  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kcpytkt"
+  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdeltkt"
+  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95"
+  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95g"
+
+  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion"
+  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client"
+  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion"
+  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation"
+  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion"
+  DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK"
+  DeleteRegKey /ifempty HKLM "${KFW_REGKEY_ROOT}"
+  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}"
+
+  ; NIM Registry Keys
+  DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Modules\MITKrb5"
+  DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins\Krb5Cred"
+  DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins\Krb5Ident"
+  DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager\Modules"
+  DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins"
+  DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager"
+  DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}"
+  ; WinLogon Event Notification
+  DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify\MIT_KFW"
+  DeleteRegKey HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos"
+
+  RMDir  "$INSTDIR"
+
+SectionEnd
+
+;--------------------------------
+;Uninstaller Functions
+
+Function un.onInit
+
+  ;Get language from registry
+  ReadRegStr $LANGUAGE ${MUI_LANGDLL_REGISTRY_ROOT} "${MUI_LANGDLL_REGISTRY_KEY}" "${MUI_LANGDLL_REGISTRY_VALUENAME}"
+                                                    
+FunctionEnd
+
+Function un.onUninstSuccess
+
+   MessageBox MB_OK "Please reboot your machine to complete uninstallation of the software"
+
+FunctionEnd
+
+;------------------------------
+; Get the Configurations files from the Internet
+
+Function kfw.GetConfigFiles
+
+;Check if we should download Config Files
+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/krb5.ini" "$WINDIR\krb5.ini"
+   NSISdl::download "$R0/krb.con" "$WINDIR\krb.con"
+   NSISdl::download "$R0/krbrealm.con" "$WINDIR\krbrealm.con"
+   Pop $R0 ;Get the return value
+   StrCmp $R0 "success" done
+   MessageBox MB_OK|MB_ICONSTOP "Download failed: $R0"
+   goto done
+
+UsePackaged:
+   SetOutPath "$WINDIR"
+   File "${KFW_CONFIG_DIR}\sample\krb5.ini"
+   File "${KFW_CONFIG_DIR}\sample\krb.con"
+   File "${KFW_CONFIG_DIR}\sample\krbrealm.con"
+   goto done
+   
+CheckOther:
+   ReadINIStr $R0 $0 "Field 7" "State"
+   StrCmp $R0 "" done
+   CopyFiles "$R0\krb5.ini" "$WINDIR\krb5.ini"
+   CopyFiles "$R0\krb.con" "$WINDIR\krb.con"
+   CopyFiles "$R0\krbrealm.con" "$WINDIR\krbrealm.con"
+   
+done:
+
+FunctionEnd
+
+
+
+;-------------------------------
+;Do the page to get the Config files
+
+Function KFWPageGetConfigFiles
+  ; 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"
+  WriteINIStr $0 "Field 3" "Text"  "Use packaged configuration files for the ${SAMPLE_CONFIG_REALM} realm."
+  WriteINIStr $0 "Field 5" "State"  "${HTTP_CONFIG_URL}"  
+
+  ; If there is an existing krb5.ini file, allow the user to choose it and make it default
+  IfFileExists "$WINDIR\krb5.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 "Kerberos Configuration" "Please choose a method for installing the Kerberos Configuration files:" 
+  InstallOptions::dialog $0
+  Pop $R1
+  StrCmp $R1 "cancel" exit
+  StrCmp $R1 "back" done
+  StrCmp $R1 "success" done
+exit: Quit
+done:
+
+   ; Check that if a file is set, a valid filename is entered...
+   ReadINIStr $R0 $0 "Field 6" "State"
+   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\krb5.ini" Skip
+
+   MessageBox MB_OK|MB_ICONSTOP $(ConfigFileError)
+   WriteINIStr $0 "Field 6" "State" "0"
+   goto startOver
+   
+   Skip:
+   
+FunctionEnd
+
+
+;-------------------------------
+;Do the page to get the Startup Configuration
+
+Function KFWPageGetStartupConfig
+  ; 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
+  
+  !insertmacro MUI_HEADER_TEXT "Network Identity Manager Setup" "Please select Network Identity ticket manager setup options:" 
+  InstallOptions::dialog $1
+  Pop $R1
+  StrCmp $R1 "cancel" exit
+  StrCmp $R1 "back" done
+  StrCmp $R1 "success" done
+exit: 
+  Quit
+done:
+skip:
+   
+FunctionEnd
+
+
+;-------------
+; Common install routines for each module
+Function KFWCommon.Install
+
+  WriteRegStr HKLM "${KFW_REGKEY_ROOT}" "InstallDir" $INSTDIR
+
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayName" "${PROGRAM_NAME}"
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "UninstallString" "$INSTDIR\uninstall.exe"
+!ifndef DEBUG
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayVersion" "${KFW_VERSION}"
+!else
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayVersion" "${KFW_VERSION} Checked/Debug"
+!endif
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "URLInfoAbout" "http://web.mit.edu/kerberos/"
+
+!ifdef DEBUG
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\CurrentVersion" "Debug" 1
+  WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\${KFW_VERSION}" "Debug" 1
+!else
+   ; Delete the DEBUG string
+   DeleteRegValue HKLM "${KFW_REGKEY_ROOT}\CurrentVersion" "Debug"
+   DeleteRegValue HKLM "${KFW_REGKEY_ROOT}\${KFW_VERSION}" "Debug"
+!endif
+
+  WriteUninstaller "$INSTDIR\Uninstall.exe"
+FunctionEnd
+
+
+;-------------------------------
+; Check if the client should be checked for default install
+Function ShouldClientInstall
+   Push $R0
+   StrCpy $R2 "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 ${KFW_MAJORVERSION} +1 Upgrade Downgrade
+
+   Call GetInstalledVersionMinor
+   Pop $R0
+   IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade
+   
+   Call GetInstalledVersionPatch
+   Pop $R0
+   IntCmpU $R0 ${KFW_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 Documentation options should be set
+Function ShouldDocumentationInstall
+   Push $R0
+   StrCpy $R2 "Documentation"
+   Call GetInstalledVersion
+   Pop $R0
+   
+   StrCmp $R0 "" NotInstalled
+   ; Now we see if it's an older or newer version
+
+   Call GetInstalledVersionMajor
+   Pop $R0
+   IntCmpU $R0 ${KFW_MAJORVERSION} +1 Upgrade Downgrade
+
+   Call GetInstalledVersionMinor
+   Pop $R0
+   IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade
+   
+   Call GetInstalledVersionPatch
+   Pop $R0
+   IntCmpU $R0 ${KFW_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 SDK options should be set
+Function ShouldSDKInstall
+   Push $R0
+   StrCpy $R2 "SDK"
+   Call GetInstalledVersion
+   Pop $R0
+   
+   StrCmp $R0 "" NotInstalled
+   ; Now we see if it's an older or newer version
+
+   Call GetInstalledVersionMajor
+   Pop $R0
+   IntCmpU $R0 ${KFW_MAJORVERSION} +1 Upgrade Downgrade
+
+   Call GetInstalledVersionMinor
+   Pop $R0
+   IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade
+   
+   Call GetInstalledVersionPatch
+   Pop $R0
+   IntCmpU $R0 ${KFW_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 KfW SDK is installed
+; Returns: "1" if it is, 0 if it is not (on the stack)
+Function IsSDKInstalled
+   Push $R0
+   StrCpy $R2 "SDK"
+   Call GetInstalledVersion
+   Pop $R0
+   
+   StrCmp $R0 "" NotInstalled
+   
+   StrCpy $R0 "1"
+   Exch $R0
+   goto end
+   
+NotInstalled:
+   StrCpy $R0 "0"
+   Exch $R0
+end:   
+FunctionEnd
+
+
+; See if KfW Client is installed
+; Returns: "1" if it is, 0 if it is not (on the stack)
+Function IsClientInstalled
+   Push $R0
+   StrCpy $R2 "Client"
+   Call GetInstalledVersion
+   Pop $R0
+   
+   StrCmp $R0 "" NotInstalled
+   
+   StrCpy $R0 "1"
+   Exch $R0
+   goto end
+   
+NotInstalled:
+   StrCpy $R0 "0"
+   Exch $R0
+end:   
+FunctionEnd
+
+
+
+; See if KfW Documentation is installed
+; Returns: "1" if it is, 0 if it is not (on the stack)
+Function IsDocumentationInstalled
+   Push $R0
+   StrCpy $R2 "Documentation"
+   Call GetInstalledVersion
+   Pop $R0
+   
+   StrCmp $R0 "" NotInstalled
+   
+   StrCpy $R0 "1"
+   Exch $R0
+   goto end
+   
+NotInstalled:
+   StrCpy $R0 "0"
+   Exch $R0
+end:   
+FunctionEnd
+
+
+
+;Check to see if any KfW component is installed
+;Returns: Value on stack: "1" if it is, "0" if it is not
+Function IsAnyKfWInstalled
+   Push $R0
+   Push $R1
+   Push $R2
+   Call IsClientInstalled
+   Pop $R0
+   Call IsSDKInstalled
+   Pop $R1
+   Call IsDocumentationInstalled
+   Pop $R2
+   ; Now we must see if ANY of the $Rn values are 1
+   StrCmp $R0 "1" SomethingInstalled
+   StrCmp $R1 "1" SomethingInstalled
+   StrCmp $R2 "1" SomethingInstalled
+   ;Nothing installed
+   StrCpy $R0 "0"
+   goto end
+SomethingInstalled:
+   StrCpy $R0 "1"
+end:
+   Pop $R2
+   Pop $R1
+   Exch $R0
+FunctionEnd
+
+;--------------------------------
+;Handle what must and what must not be installed
+Function .onSelChange
+   ; If they install the SDK, they MUST install the client
+   SectionGetFlags ${secSDK} $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
+
+Function AddProvider
+   Push $R0
+   Push $R1
+   ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder"
+   Push $R0
+   StrCpy $R0 "MIT Kerberos"
+   Push $R0
+   Call StrStr
+   Pop $R0
+   StrCmp $R0 "" DoOther +1
+   ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder"
+   StrCpy $R0 "$R1,MIT Kerberos"
+   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" $R0
+DoOther:
+   ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder"
+   Push $R0
+   StrCpy $R0 "MIT Kerberos"
+   Push $R0
+   Call StrStr
+   Pop $R0
+   StrCmp $R0 "" +1 End
+   ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder"
+   StrCpy $R0 "$R1,MIT Kerberos"
+   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" $R0
+End:
+   Pop $R1
+   Pop $R0
+FunctionEnd
+
+Function un.RemoveProvider
+   Push $R0
+   StrCpy $R0 "MIT Kerberos"
+   Push $R0
+   StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" 
+   Call un.RemoveFromProvider
+   StrCpy $R0 "MIT Kerberos"
+   Push $R0
+   StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order"
+   Call un.RemoveFromProvider
+   Pop $R0
+FunctionEnd
+
+Function un.RemoveFromProvider
+  Exch $0
+  Push $1
+  Push $2
+  Push $3
+  Push $4
+  Push $5
+  Push $6
+
+  ReadRegStr $1 HKLM "$R0" "ProviderOrder"
+    StrCpy $5 $1 1 -1 # copy last char
+    StrCmp $5 "," +2 # if last char != ,
+      StrCpy $1 "$1," # append ,
+    Push $1
+    Push "$0,"
+    Call un.StrStr ; Find `$0,` in $1
+    Pop $2 ; pos of our dir
+    StrCmp $2 "" unRemoveFromPath_done
+      ; else, it is in path
+      # $0 - path to add
+      # $1 - path var
+      StrLen $3 "$0,"
+      StrLen $4 $2
+      StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
+      StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
+      StrCpy $3 $5$6
+
+      StrCpy $5 $3 1 -1 # copy last char
+      StrCmp $5 "," 0 +2 # if last char == ,
+        StrCpy $3 $3 -1 # remove last char
+
+      WriteRegStr HKLM "$R0" "ProviderOrder" $3
+
+  unRemoveFromPath_done:
+    Pop $6
+    Pop $5
+    Pop $4
+    Pop $3
+    Pop $2
+    Pop $1
+    Pop $0
+FunctionEnd