--- /dev/null
+;-----------------------------------------------------------------\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