From 062b5d52c60fcfa282f17d1921178b8e3f367b06 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 30 Nov 2005 04:33:54 +0000 Subject: [PATCH] Updates to Wix installer source for KFW 3.0 Beta 2 - Updates all strings - Creates shortcuts for netidmgr.exe and netidmgr.chm - Adds KFW Logon Network Provider Known bugs: - the old Leash Documentation PDF still has a shortcut - specifying the WorkingDirectory does not work ticket: new component: windows status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17520 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/installer/wix/custom/custom.cpp | 109 ++++++++++++++++++- src/windows/installer/wix/custom/custom.h | 15 +++ src/windows/installer/wix/features.wxi | 24 +++-- src/windows/installer/wix/files.wxi | 111 ++++++++++++-------- src/windows/installer/wix/kfw.wxs | 53 +++++++--- src/windows/installer/wix/lang/ui_1033.wxi | 10 +- src/windows/installer/wix/site-local.wxi | 4 +- 7 files changed, 251 insertions(+), 75 deletions(-) diff --git a/src/windows/installer/wix/custom/custom.cpp b/src/windows/installer/wix/custom/custom.cpp index 31fc11caa..dd1fb9c5d 100644 --- a/src/windows/installer/wix/custom/custom.cpp +++ b/src/windows/installer/wix/custom/custom.cpp @@ -23,7 +23,9 @@ DLLEXPORTS =\ -EXPORT:AbortMsiImmediate \ -EXPORT:UninstallNsisInstallation \ -EXPORT:KillRunningProcesses \ - -EXPORT:ListRunningProcesses + -EXPORT:ListRunningProcesses \ + -EXPORT:InstallNetProvider \ + -EXPORT:UninstallNetProvider $(DLLFILE): $(OUTPATH)\custom.obj $(LINK) /OUT:$@ /DLL $** $(DLLEXPORTS) @@ -42,7 +44,7 @@ clean: #else /* -Copyright 2004 by the Massachusetts Institute of Technology +Copyright 2004,2005 by the Massachusetts Institute of Technology All rights reserved. @@ -621,6 +623,109 @@ _cleanup: } return rv; } + +/* Check and add or remove networkprovider key value + str : target string + str2: string to add/remove + bInst: == 1 if string should be added to target if not already there, + otherwise remove string from target if present. +*/ +int npi_CheckAndAddRemove( LPTSTR str, LPTSTR str2, int bInst ) { + + LPTSTR target, charset, match; + int ret=0; + + target = new TCHAR[lstrlen(str)+3]; + lstrcpy(target,_T(",")); + lstrcat(target,str); + lstrcat(target,_T(",")); + charset = new TCHAR[lstrlen(str2)+3]; + lstrcpy(charset,_T(",")); + lstrcat(charset,str2); + lstrcat(charset,_T(",")); + + match = _tcsstr(target, charset); + + if ((match) && (bInst)) { + ret = INP_ERR_PRESENT; + goto cleanup; + } + + if ((!match) && (!bInst)) { + ret = INP_ERR_ABSENT; + goto cleanup; + } + + if (bInst) // && !match + { + lstrcat(str, _T(",")); + lstrcat(str, str2); + ret = INP_ERR_ADDED; + goto cleanup; + } + + // if (!bInst) && (match) + { + lstrcpy(str+(match-target),match+lstrlen(str2)+2); + str[lstrlen(str)-1]=_T('\0'); + ret = INP_ERR_REMOVED; + goto cleanup; + } + +cleanup: + + delete target; + delete charset; + return ret; +} + +/* Sets the registry keys required for the functioning of the network provider */ + +DWORD InstNetProvider(MSIHANDLE hInstall, int bInst) { + LPTSTR strOrder; + HKEY hkOrder; + LONG rv; + DWORD dwSize; + HANDLE hProcHeap; + + strOrder = (LPTSTR) 0; + + CHECK(rv = RegOpenKeyEx( HKEY_LOCAL_MACHINE, STR_KEY_ORDER, 0, KEY_READ | KEY_WRITE, &hkOrder )); + + dwSize = 0; + CHECK(rv = RegQueryValueEx( hkOrder, STR_VAL_ORDER, NULL, NULL, NULL, &dwSize ) ); + + strOrder = new TCHAR[ (dwSize + STR_SERVICE_LEN) * sizeof(TCHAR) ]; + + CHECK(rv = RegQueryValueEx( hkOrder, STR_VAL_ORDER, NULL, NULL, (LPBYTE) strOrder, &dwSize)); + + npi_CheckAndAddRemove( strOrder, STR_SERVICE , bInst); + + dwSize = (lstrlen( strOrder ) + 1) * sizeof(TCHAR); + + CHECK(rv = RegSetValueEx( hkOrder, STR_VAL_ORDER, NULL, REG_SZ, (LPBYTE) strOrder, dwSize )); + + /* everything else should be set by the MSI tables */ + rv = ERROR_SUCCESS; +_cleanup: + + if( rv != ERROR_SUCCESS ) { + ShowMsiError( hInstall, ERR_NPI_FAILED, rv ); + } + + if(strOrder) delete strOrder; + + return rv; +} + +MSIDLLEXPORT InstallNetProvider( MSIHANDLE hInstall ) { + return InstNetProvider( hInstall, 1 ); +} + +MSIDLLEXPORT UninstallNetProvider( MSIHANDLE hInstall) { + return InstNetProvider( hInstall, 0 ); +} + #endif #ifdef __NMAKE__ !ENDIF diff --git a/src/windows/installer/wix/custom/custom.h b/src/windows/installer/wix/custom/custom.h index ee0e66319..9fcc61e65 100644 --- a/src/windows/installer/wix/custom/custom.h +++ b/src/windows/installer/wix/custom/custom.h @@ -47,6 +47,13 @@ SOFTWARE. #define CHECK2(x,y) if((x)) { msiErr = (y); goto _cleanup; } +#define STR_KEY_ORDER _T("SYSTEM\\CurrentControlSet\\Control\\NetworkProvider\\Order") +#define STR_VAL_ORDER _T("ProviderOrder") + +#define STR_SERVICE _T("MIT Kerberos") +#define STR_SERVICE_LEN 12 + + void ShowMsiError(MSIHANDLE, DWORD, DWORD); UINT SetAllowTgtSessionKey( MSIHANDLE hInstall, BOOL pInstall ); UINT KillRunningProcessesSlave( MSIHANDLE hInstall, BOOL bKill ); @@ -58,9 +65,17 @@ MSIDLLEXPORT RevertAllowTgtSessionKey( MSIHANDLE hInstall ); MSIDLLEXPORT EnableAllowTgtSessionKey( MSIHANDLE hInstall ); MSIDLLEXPORT KillRunningProcesses( MSIHANDLE hInstall ) ; MSIDLLEXPORT ListRunningProcesses( MSIHANDLE hInstall ); +MSIDLLEXPORT InstallNetProvider( MSIHANDLE ); +MSIDLLEXPORT UninstallNetProvider ( MSIHANDLE ); + +#define INP_ERR_PRESENT 1 +#define INP_ERR_ADDED 2 +#define INP_ERR_ABSENT 3 +#define INP_ERR_REMOVED 4 /* Custom errors */ #define ERR_CUSTACTDATA 4001 #define ERR_NSS_FAILED 4003 #define ERR_ABORT 4004 #define ERR_PROC_LIST 4006 +#define ERR_NPI_FAILED 4007 diff --git a/src/windows/installer/wix/features.wxi b/src/windows/installer/wix/features.wxi index 890dcb709..22630053d 100644 --- a/src/windows/installer/wix/features.wxi +++ b/src/windows/installer/wix/features.wxi @@ -47,23 +47,24 @@ AllowAdvertise="no" Description="$(loc.StrKerberosClientDebugDesc)" Display="expand" - InstallDefault="$(var.DebugSymInstallDefault)" + InstallDefault="$(var.DebugSymInstallDefault)" Level="$(var.DebugSymLowLevel)" Title="$(loc.StrKerberosClientDebugTitle)"> + - + - + @@ -93,6 +94,7 @@ + @@ -249,7 +251,7 @@ - + diff --git a/src/windows/installer/wix/files.wxi b/src/windows/installer/wix/files.wxi index a5732222e..8d0085a0e 100644 --- a/src/windows/installer/wix/files.wxi +++ b/src/windows/installer/wix/files.wxi @@ -1,7 +1,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - KRB4KRBREALMS - - - - KRB4KRBCONF - - - - KRB4CONFIGDIR - - - - KRB4TICKETFILE - - - - - - KRB5CONFIG - - - - KRB5CCNAME - - - - KRB5PRESERVEIDENTITY - + + + + KRB4KRBREALMS + + + + KRB4KRBCONF + + + + KRB4CONFIGDIR + + + + KRB4TICKETFILE + + + + + + KRB5CONFIG + + + + KRB5CCNAME + + + + KRB5PRESERVEIDENTITY + @@ -155,7 +180,7 @@ - + @@ -190,7 +215,7 @@ - + @@ -310,10 +335,13 @@ - - - - + + + + + + + @@ -654,6 +682,7 @@ + @@ -750,12 +779,12 @@ - + - + diff --git a/src/windows/installer/wix/kfw.wxs b/src/windows/installer/wix/kfw.wxs index 2f7e41358..01c6f53b6 100644 --- a/src/windows/installer/wix/kfw.wxs +++ b/src/windows/installer/wix/kfw.wxs @@ -1,7 +1,7 @@ + - UPGRADEPISMERE Or UPGRADEKFW - - - UILevel = 0 And (Not Installed) And (CCP_Success <> 1) - UPGRADENSIS <> "" And UILevel >= 4 - UPGRADENSIS <> "" And UILevel < 4 - VersionNT >= 500 And &feaKfwClient=3 - VersionNT >= 500 And &feaKfwClient=3 - VersionNT >= 500 And &feaKfwClient=2 + UPGRADEPISMERE Or UPGRADEKFW + + + UILevel = 0 And (Not Installed) And (CCP_Success <> 1) + UPGRADENSIS <> "" And UILevel >= 4 + UPGRADENSIS <> "" And UILevel < 4 + VersionNT >= 500 And &feaKfwClient=3 + VersionNT >= 500 And &feaKfwClient=3 + VersionNT >= 500 And &feaKfwClient=2 + + &feaKfwClient=3 + &feaKfwClient=3 + &feaKfwClient=2 diff --git a/src/windows/installer/wix/lang/ui_1033.wxi b/src/windows/installer/wix/lang/ui_1033.wxi index b2983fc3d..448e162de 100644 --- a/src/windows/installer/wix/lang/ui_1033.wxi +++ b/src/windows/installer/wix/lang/ui_1033.wxi @@ -728,11 +728,11 @@ - The Leash ticket manager maybe installed with the following optional functionality. Please check those items that you wish to activate. + The Network Identity Manager may be installed with the following optional functionality. Please check those items that you wish to activate. - Autostart the Leash ticket manager each time you login to Windows + Autostart the Network Identity Manager each time you login to Windows @@ -756,7 +756,7 @@ - Leash startup options + Network Identity Manager startup options [DlgTitleFont]Kerberos Options @@ -879,8 +879,8 @@ - Yes - No + + diff --git a/src/windows/installer/wix/site-local.wxi b/src/windows/installer/wix/site-local.wxi index 345bdbf95..476471956 100644 --- a/src/windows/installer/wix/site-local.wxi +++ b/src/windows/installer/wix/site-local.wxi @@ -6,7 +6,7 @@ - + - + -- 2.26.2