windows-install-nsis-20070622
[openafs.git] / src / WINNT / install / NSIS / OpenAFS.nsi
index e668ab4..32134a2 100644 (file)
@@ -50,7 +50,7 @@ VIAddVersionKey "CompanyName" "OpenAFS.org"
 VIAddVersionKey "ProductVersion" ${AFS_VERSION}
 VIAddVersionKey "FileVersion" ${AFS_VERSION}
 VIAddVersionKey "FileDescription" "OpenAFS for Windows Installer"
-VIAddVersionKey "LegalCopyright" "(C)2000-2005"
+VIAddVersionKey "LegalCopyright" "(C)2000-2007"
 !ifdef DEBUG
 VIAddVersionKey "PrivateBuild" "Checked/Debug"
 !endif               ; End DEBUG
@@ -85,6 +85,7 @@ VIAddVersionKey "PrivateBuild" "Checked/Debug"
   !define AFS_COMPANY_NAME "OpenAFS"
   !define AFS_PRODUCT_NAME "OpenAFS"
   !define AFS_REGKEY_ROOT "Software\TransarcCorporation"
+  !define NID_PLUGIN_MGR  "Software\MIT\NetIDMgr\PluginManager"
   CRCCheck force
 
   ;Folder selection page
@@ -110,7 +111,7 @@ VIAddVersionKey "PrivateBuild" "Checked/Debug"
 ;--------------------------------
 ;Modern UI Configuration
 
-  ;!define MUI_LICENSEPAGE
+  !define MUI_LICENSEPAGE
   !define MUI_CUSTOMPAGECOMMANDS
   !define MUI_WELCOMEPAGE
   !define MUI_COMPONENTSPAGE
@@ -125,6 +126,7 @@ VIAddVersionKey "PrivateBuild" "Checked/Debug"
   
   
   !insertmacro MUI_PAGE_WELCOME
+  !insertmacro MUI_PAGE_LICENSE "Licenses.rtf"
   !insertmacro MUI_PAGE_COMPONENTS
   !insertmacro MUI_PAGE_DIRECTORY
   Page custom AFSPageGetCellServDB
@@ -133,7 +135,6 @@ VIAddVersionKey "PrivateBuild" "Checked/Debug"
   !insertmacro MUI_PAGE_INSTFILES
   !insertmacro MUI_PAGE_FINISH
   
-  ;LicenseData "Licenses.rtf"
 ;--------------------------------
 ;Languages
 
@@ -539,9 +540,9 @@ Section "!AFS Client" secClient
   File "${AFS_CLIENT_BUILDDIR}\afsdacl.exe"
   File "${AFS_CLIENT_BUILDDIR}\cmdebug.exe"
   File "${AFS_CLIENT_BUILDDIR}\aklog.exe"
-  File "${AFS_CLIENT_BUILDDIR}\afscreds.exe"
+  !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds.exe"           "$INSTDIR\Client\Program\afscreds.exe"    "$INSTDIR"
   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext.dll" "$INSTDIR\Client\Program\afs_shl_ext.dll" "$INSTDIR"
-  File "${AFS_CLIENT_BUILDDIR}\afsd_service.exe"
+  !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afsd_service.exe" "$INSTDIR\Client\Program\afsd_service.exe" "$INSTDIR"
   File "${AFS_CLIENT_BUILDDIR}\symlink.exe"
   File "${AFS_DESTDIR}\bin\kpasswd.exe"
   File "${AFS_SERVER_BUILDDIR}\pts.exe"
@@ -553,6 +554,9 @@ Section "!AFS Client" secClient
   File "${AFS_DESTDIR}\etc\rxdebug.exe"
   File "${AFS_DESTDIR}\etc\backup.exe"
   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa.cpl" "$INSTDIR\Client\Program\afs_cpa.cpl" "$INSTDIR"
+  !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscred.dll" "$INSTDIR\Client\Program\afscred.dll" "$INSTDIR"
+  !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscred_en_us.dll" "$INSTDIR\Client\Program\afscred_en_us.dll" "$INSTDIR"
+  File "${AFS_CLIENT_BUILDDIR}\afsplhlp.chm"
   
   SetOutPath "$SYSDIR"
   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afslogon.dll" "$SYSDIR\afslogon.dll" "$INSTDIR"
@@ -626,6 +630,18 @@ Section "!AFS Client" secClient
    DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "Debug"
 !endif
 
+  ;NetIDMgr Plug-in Reg Entries
+  WriteRegStr HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS" "ImagePath" "$INSTDIR\Client\Program\afscred.dll"
+  WriteRegStr HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS" "Description" "OpenAFS Module"
+  WriteRegStr HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS" "Vendor" "Secure Endpoints Inc."
+  WriteRegStr HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS" "PluginList" "AfsCred"
+  WriteRegDWORD HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS" "NoUnload" "1"
+  
+  WriteRegStr HKLM "${NID_PLUGIN_MGR}\Plugins\AfsCred" "Module" "OpenAFS"
+  WriteRegStr HKLM "${NID_PLUGIN_MGR}\Plugins\AfsCred" "Description" "AFS Credentials Provider"
+  WriteRegStr HKLM "${NID_PLUGIN_MGR}\Plugins\AfsCred" "Dependencies" "Krb5Cred"
+  WriteRegDWORD HKLM "${NID_PLUGIN_MGR}\Plugins\AfsCred" "Type" "1"
+
    ; On Windows 2000 work around KB301673.  This is fixed in Windows XP and 2003
    Call GetWindowsVersion
    Pop $R1
@@ -764,10 +780,11 @@ skipremove:
   WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "Logoff" "AFS_Logoff_Event"
   WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "Startup" "AFS_Startup_Event"
 
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\KFWLogon" "Asynchronous" 0
-  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\KFWLogon" "Impersonate"  0
-  WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\KFWLogon" "DLLName" "afslogon.dll"
-  WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\KFWLogon" "Logon" "KFW_Logon_Event"
+; No longer install KFW Logon Handler - KFW 3.1 and above supports this functionality
+;  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\KFWLogon" "Asynchronous" 0
+;  WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\KFWLogon" "Impersonate"  0
+;  WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\KFWLogon" "DLLName" "afslogon.dll"
+;  WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\KFWLogon" "Logon" "KFW_Logon_Event"
 
   SetRebootFlag true
   
@@ -898,7 +915,7 @@ skipCheck:
   IfFileExists "$INSTDIR\Server\usr\afs\etc\ThisCell" SkipStartup
 
   ; Make the server config wizard auto-start on bootup if this is an install (not an upgrade)
-  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" "AFS Server Wizard" '"$INSTDIR\Server\usr\afs\bin\afssvrcfg.exe" /wizard"'
+  ; WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" "AFS Server Wizard" '"$INSTDIR\Server\usr\afs\bin\afssvrcfg.exe" /wizard"'
   
   
 SkipStartup:
@@ -906,10 +923,24 @@ SkipStartup:
   ;nsExec::Exec '$INSTDIR\Common\service.exe u TransarcAFSServer'
   nsExec::Exec '$INSTDIR\Common\service.exe TransarcAFSServer "$INSTDIR\Server\usr\afs\bin\bosctlsvc.exe" "OpenAFS AFS Server"'
   Delete "$INSTDIR\Common\service.exe"
+
+  strcpy $REG_SUB_KEY "SYSTEM\CurrentControlSet\Services\TransarcAFSServer" 
+  strcpy $REG_VALUE   "DependOnGroup" 
+  strcpy $REG_DATA_1  "PNP_TDI"
+  strcpy $REG_DATA_2  ""
+  strcpy $REG_DATA_3  ""
+  strcpy $REG_DATA_4  ""
+  Call RegWriteMultiStr
+  strcpy $REG_SUB_KEY "SYSTEM\CurrentControlSet\Services\TransarcAFSServer" 
+  strcpy $REG_VALUE   "DependOnService" 
+  strcpy $REG_DATA_1  "Tcpip"
+  strcpy $REG_DATA_2  ""
+  strcpy $REG_DATA_3  ""
+  strcpy $REG_DATA_4  ""
+  Call RegWriteMultiStr
   
-  CreateDirectory "$SMPROGRAMS\OpenAFS\Server"
-  CreateShortCut "$SMPROGRAMS\OpenAFS\Server\Server Configuration.lnk" "$INSTDIR\Server\usr\afs\bin\afssvrcfg.exe"
-  
+  ;CreateDirectory "$SMPROGRAMS\OpenAFS\Server"
+  ;CreateShortCut "$SMPROGRAMS\OpenAFS\Server\Server Configuration.lnk" "$INSTDIR\Server\usr\afs\bin\afssvrcfg.exe"
   
   WriteUninstaller "$INSTDIR\Uninstall.exe"
   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayIcon" "$INSTDIR\Uninstall.exe,0"  
@@ -1071,14 +1102,14 @@ SectionEnd
 
 Section /o "Software Development Kit (SDK)" secSDK
 
-    SetOutPath "$INSTDIR\Client\Program\lib"
-    File /r "${AFS_CLIENT_LIBDIR}\*.*"
+   SetOutPath "$INSTDIR\SDK\lib"
+   File /r "${AFS_CLIENT_LIBDIR}\*.*"
 
-    SetOutPath "$INSTDIR\Client\Program\Include"
-    File /r "${AFS_BUILD_INCDIR}\*.*"    
+   SetOutPath "$INSTDIR\SDK\Include"
+   File /r "${AFS_BUILD_INCDIR}\*.*"    
 
    ; Client Sample
-   SetOutPath "$INSTDIR\Client\Program\Sample"
+   SetOutPath "$INSTDIR\SDK\Sample"
    File "..\..\afsd\sample\token.c"
 
    ;Store install folder
@@ -1133,6 +1164,7 @@ Section /o "Debug symbols" secDebug
   File "${AFS_DESTDIR}\etc\rxdebug.pdb"
   File "${AFS_DESTDIR}\etc\backup.pdb"
   File "${AFS_CLIENT_BUILDDIR}\afs_cpa.pdb"
+  File "${AFS_CLIENT_BUILDDIR}\afscred.pdb"
 
   SetOutPath "$SYSDIR"
   File "${AFS_CLIENT_BUILDDIR}\afslogon.pdb"
@@ -1448,7 +1480,7 @@ NoDocs:
 ; the SDK is installed.  If not, we don't need to push it on the user.
 ; If they are there, we want to make sure they match the installed version.
 CheckSDK:
-   IfFileExists "$INSTDIR\Client\Program\Include\main.h" +1 NoSDK
+   IfFileExists "$INSTDIR\SDK\Include\main.h" +1 NoSDK
    SectionGetFlags ${secSDK} $0
    IntOp $0 $0 | ${SF_SELECTED}
    SectionSetFlags ${secSDK} $0
@@ -1632,6 +1664,7 @@ StartRemove:
   Delete "$INSTDIR\Documentation\html\InstallGd\*"
   Delete "$INSTDIR\Documentation\html\ReleaseNotes\*"
   Delete "$INSTDIR\Documentation\html\ReleaseNotes\logo_files\*"
+  Delete "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files\*"
   Delete "$INSTDIR\Documentation\html\SysAdminGd\*"
 
    Delete /REBOOTOK "$INSTDIR\Common\afs_config.exe"
@@ -1838,15 +1871,21 @@ StartRemove:
 
   Delete /REBOOTOK "$INSTDIR\Client\Program\afscreds.pdb"
 
+  Delete /REBOOTOK "$INSTDIR\SDK\Include\*"
+  Delete /REBOOTOK "$INSTDIR\SDK\Include\afs\*"
+  Delete /REBOOTOK "$INSTDIR\SDK\Include\rx\*"
+  Delete /REBOOTOK "$INSTDIR\SDK\Sample\*"
+  Delete /REBOOTOK "$INSTDIR\SDK\*"
+
+  RMDir  "$INSTDIR\SDK\Sample"
+  RMDir  "$INSTDIR\SDK\Include\afs"
+  RMDir  "$INSTDIR\SDK\Include\rx"
+  RMDir  "$INSTDIR\SDK\Include"
+  RMDir  "$INSTDIR\SDK"
+
   Delete /REBOOTOK "$INSTDIR\Client\Program\*"
-  Delete /REBOOTOK "$INSTDIR\Client\Program\Include\*"
-  Delete /REBOOTOK "$INSTDIR\Client\Program\Include\afs\*"
-  Delete /REBOOTOK "$INSTDIR\Client\Program\Include\rx\*"
-  Delete /REBOOTOK "$INSTDIR\Client\Program\Sample\*"
-  RMDir  "$INSTDIR\Client\Program\Sample"
-  RMDir  "$INSTDIR\Client\Program\Include\afs"
-  RMDir  "$INSTDIR\Client\Program\Include\rx"
-  RMDir  "$INSTDIR\Client\Program\Include"
+  Delete /REBOOTOK "$INSTDIR\Client\*"
+
   RMDir  "$INSTDIR\Client\Program"
   RMDir  "$INSTDIR\Client"
 
@@ -1992,6 +2031,9 @@ StartRemove:
   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion"
   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Server"
   DeleteRegKey /ifempty HKLM "${AFS_REGKEY_ROOT}"
+  DeleteRegKey HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS"
+  DeleteRegKey HKLM "${NID_PLUGIN_MGR}\Plugins\AfsCred"
+  DeleteRegKey /ifempty HKLM "Software\MIT\NetIDMgr"
   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS"
   DeleteRegValue HKLM "SYSTEM\CurrentControlSet\Services\NetBT\Parameters" "SmbDeviceEnabled"
 
@@ -2840,6 +2882,8 @@ DoEnglish:
    File "..\..\doc\install\Documentation\en_US\html\ReleaseNotes\*"
    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
    File "..\..\doc\install\Documentation\en_US\html\ReleaseNotes\logo_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
+   File "..\..\doc\install\Documentation\en_US\html\ReleaseNotes\relnotes_files\*"
 
    SetOutPath "$INSTDIR\Client\Program"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1033.dll"    "$INSTDIR\Client\Program\afscreds_1033.dll" "$INSTDIR"
@@ -2899,6 +2943,8 @@ DoGerman:
    ;File "..\..\doc\install\Documentation\de_DE\html\ReleaseNotes\*"
    ;SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
    ;File "..\..\doc\install\Documentation\de_DE\html\ReleaseNotes\logo_files\*"
+   ;SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
+   ;File "..\..\doc\install\Documentation\de_DE\html\ReleaseNotes\relnotes_files\*"
 
    SetOutPath "$INSTDIR\Client\Program"
   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1032.dll"                      "$INSTDIR\Client\Program\afscreds_1032.dll" "$INSTDIR"
@@ -2958,6 +3004,8 @@ DoSpanish:
    ;File "..\..\doc\install\Documentation\es_ES\html\ReleaseNotes\*"
    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
    ;File "..\..\doc\install\Documentation\es_ES\html\ReleaseNotes\logo_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
+   ;File "..\..\doc\install\Documentation\es_ES\html\ReleaseNotes\relnotes_files\*"
 
    SetOutPath "$INSTDIR\Client\Program"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1034.dll"     "$INSTDIR\Client\Program\afscreds_1034.dll" "$INSTDIR" 
@@ -3017,6 +3065,8 @@ DoJapanese:
    ;File "..\..\doc\install\Documentation\ja_JP\html\ReleaseNotes\*"
    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
    ;File "..\..\doc\install\Documentation\ja_JP\html\ReleaseNotes\logo_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
+   ;File "..\..\doc\install\Documentation\ja_JP\html\ReleaseNotes\relnotes_files\*"
 
    SetOutPath "$INSTDIR\Client\Program"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1041.dll"  "$INSTDIR\Client\Program\afscreds_1041.dll" "$INSTDIR"  
@@ -3076,6 +3126,8 @@ DoKorean:
    File "..\..\doc\install\Documentation\ko_KR\html\ReleaseNotes\*"
    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
    ;File "..\..\doc\install\Documentation\ko_KR\html\ReleaseNotes\logo_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
+   ;File "..\..\doc\install\Documentation\ko_KR\html\ReleaseNotes\relnotes_files\*"
 
    SetOutPath "$INSTDIR\Client\Program"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1042.dll"  "$INSTDIR\Client\Program\afscreds_1042.dll" "$INSTDIR"   
@@ -3136,6 +3188,8 @@ DoPortugueseBR:
    File "..\..\doc\install\Documentation\pt_BR\html\ReleaseNotes\*"
    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
    ;File "..\..\doc\install\Documentation\pt_BR\html\ReleaseNotes\logo_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
+   ;File "..\..\doc\install\Documentation\pt_BR\html\ReleaseNotes\relnotes_files\*"
 
    SetOutPath "$INSTDIR\Client\Program"
    !insertmacro ReplaceDLL  "${AFS_CLIENT_BUILDDIR}\afscreds_1046.dll"  "$INSTDIR\Client\Program\afscreds_1046.dll" "$INSTDIR"    
@@ -3195,6 +3249,8 @@ DoSimpChinese:
    File "..\..\doc\install\Documentation\zh_CN\html\ReleaseNotes\*"
    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
    ;File "..\..\doc\install\Documentation\zh_CN\html\ReleaseNotes\logo_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
+   ;File "..\..\doc\install\Documentation\zh_CN\html\ReleaseNotes\relnotes_files\*"
 
    SetOutPath "$INSTDIR\Client\Program"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_2052.dll"   "$INSTDIR\Client\Program\afscreds_2052.dll" "$INSTDIR"     
@@ -3254,6 +3310,8 @@ DoTradChinese:
    File "..\..\doc\install\Documentation\zh_TW\html\ReleaseNotes\*"
    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
    ;File "..\..\doc\install\Documentation\zh_TW\html\ReleaseNotes\logo_files\*"
+   SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
+   ;File "..\..\doc\install\Documentation\zh_TW\html\ReleaseNotes\relnotes_files\*"
 
    SetOutPath "$INSTDIR\Client\Program"
    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1028.dll"  "$INSTDIR\Client\Program\_1028.dll" "$INSTDIR"      
@@ -3614,7 +3672,7 @@ FunctionEnd
 ;
 ; Returns on top of stack
 ;
-; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003)
+; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003, Vista)
 ; or
 ; '' (Unknown Windows Version)
 ;
@@ -3670,7 +3728,8 @@ Function GetWindowsVersion
 
   StrCmp $R1 '5.0' lbl_winnt_2000
   StrCmp $R1 '5.1' lbl_winnt_XP
-  StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error
+  StrCmp $R1 '5.2' lbl_winnt_2003
+  StrCmp $R1 '6.0' lbl_winnt_vista lbl_error
 
   lbl_winnt_x:
     StrCpy $R0 "NT $R0" 6
@@ -3688,6 +3747,10 @@ Function GetWindowsVersion
     Strcpy $R0 '2003'
   Goto lbl_done
 
+  lbl_winnt_vista:
+    Strcpy $R0 'Vista'
+  Goto lbl_done
+
   lbl_error:
     Strcpy $R0 ''
   lbl_done: