From 993051678f84137fd216a95ca3af84a59ca66451 Mon Sep 17 00:00:00 2001 From: Asanka Herath Date: Wed, 4 Aug 2004 17:36:10 +0000 Subject: [PATCH] misc-post-1366-20040804 Update documentation on cache control and credential manager options in MSI deployment guide. 'CachePath' setting in registry allows REG_EXPAND_SZ type. Update registry documentation for 'CachePath' setting. Both installers save the credential manager command line options in registry. Fix handling of existing 'afsdcell.ini' file in WiX installer. WiX 2.0.1927 changed the XML schema. The WiX installer has beed updated accordingly. --- doc/txt/winnotes/msi-deployment-guide.txt | 31 ++++- doc/txt/winnotes/registry.txt | 6 +- src/WINNT/afsd/afsd_init.c | 20 ++- src/WINNT/install/NSIS/OpenAFS.nsi | 2 + src/WINNT/install/wix/feature.wxi | 5 + src/WINNT/install/wix/files.wxi | 37 +++--- src/WINNT/install/wix/openafs.wxs | 1 + src/WINNT/install/wix/property.wxi | 12 ++ src/WINNT/install/wix/registry.wxi | 201 ++++++++++++++++-------------- 9 files changed, 194 insertions(+), 121 deletions(-) diff --git a/doc/txt/winnotes/msi-deployment-guide.txt b/doc/txt/winnotes/msi-deployment-guide.txt index 7bdfb3b..70c6c27 100644 --- a/doc/txt/winnotes/msi-deployment-guide.txt +++ b/doc/txt/winnotes/msi-deployment-guide.txt @@ -85,6 +85,16 @@ OpenAFS for Windows The configurable properties are as follows: + AFSCACHEPATH + Registry key : (Service parameters) + Registry value : CachePath + Valid values : string + + AFSCACHESIZE + Registry key : (Service parameters) + Registry value : CacheSize + Valid values : numeric + AFSCELLNAME Registry key : (Service parameters) @@ -114,11 +124,19 @@ OpenAFS for Windows Option for AFSCREDS.EXE. Enables renewing drive map at startup. + (see below) + + CREDSSHOW + Valid values : '-s' or '' - The four properties above determine the behavior of the AFS + Option for AFSCREDS.EXE. Enables displaying the credential + manager window when AFSCREDS starts up. + + The five properties above determine the behavior of the AFS credential manager ( AFSCREDS.EXE ). Each property adds a command line option to the shortcut that will be created in - the Program Menu (both under 'OpenAFS' and 'Startup' folders). + the Program Menu, both under 'OpenAFS' and 'Startup' folders + (see CREDSSTARTUP). The way in which the options are specified was chosen for easy integration with the Windows Installer user interface. @@ -126,6 +144,15 @@ OpenAFS for Windows options to AFSCREDS.EXE, we advise against it because such transforms may not apply to future releases of OpenAFS. + CREDSSTARTUP + Valid values : '1' or '0' + + Controls whether AFSCREDS.EXE starts up automatically when a + user logs on. When CREDSSTARTUP is '1' a shortcut is added + to the 'Startup' folder in the 'Program menu' which starts + AFSCREDS.EXE with the options that are determined by the + other CREDS* properties. + FREELANCEMODE Registry key : (Service parameters) diff --git a/doc/txt/winnotes/registry.txt b/doc/txt/winnotes/registry.txt index 9ace6bb..c762115 100644 --- a/doc/txt/winnotes/registry.txt +++ b/doc/txt/winnotes/registry.txt @@ -32,7 +32,7 @@ Type : QWORD Default : 20480 (CM_CONFIGDEFAULT_CACHESIZE) Variable: cm_initParams.cacheSize - Size of the AFS cache. + Size of the AFS cache in 1k blocks. Value : ChunkSize Type : DWORD @@ -104,8 +104,8 @@ Variable: cm_mountRoot where the symlink exists) Value : CachePath -Type : REG_SZ -Default : "\AFSCache" +Type : REG_SZ or REG_EXPAND_SZ +Default : "%SYSTEMDRIVE%\AFSCache" Variable: cm_CachePath Location of on-disk cache file. The default implies the root diff --git a/src/WINNT/afsd/afsd_init.c b/src/WINNT/afsd/afsd_init.c index a3d3671..96cccf0 100644 --- a/src/WINNT/afsd/afsd_init.c +++ b/src/WINNT/afsd/afsd_init.c @@ -378,6 +378,7 @@ int afsd_InitCM(char **reasonP) char buf[200]; HKEY parmKey; DWORD dummyLen; + DWORD regType; long code; /*int freelanceEnabled;*/ WSADATA WSAjunk; @@ -588,12 +589,21 @@ int afsd_InitCM(char **reasonP) /* Don't log */ } - dummyLen = sizeof(cm_CachePath); - code = RegQueryValueEx(parmKey, "CachePath", NULL, NULL, - cm_CachePath, &dummyLen); - if (code == ERROR_SUCCESS) + dummyLen = sizeof(buf); + code = RegQueryValueEx(parmKey, "CachePath", NULL, ®Type, + buf, &dummyLen); + if (code == ERROR_SUCCESS && buf[0]) { + if(regType == REG_EXPAND_SZ) { + dummyLen = ExpandEnvironmentStrings(buf, cm_CachePath, sizeof(cm_CachePath)); + if(dummyLen > sizeof(cm_CachePath)) { + afsi_log("Cache path [%s] longer than %d after expanding env strings", buf, sizeof(cm_CachePath)); + osi_panic("CachePath too long", __FILE__, __LINE__); + } + } else { + StringCbCopyA(cm_CachePath, sizeof(cm_CachePath), buf); + } afsi_log("Cache path %s", cm_CachePath); - else { + } else { GetWindowsDirectory(cm_CachePath, sizeof(cm_CachePath)); cm_CachePath[2] = 0; /* get drive letter only */ StringCbCatA(cm_CachePath, sizeof(cm_CachePath), "\\AFSCache"); diff --git a/src/WINNT/install/NSIS/OpenAFS.nsi b/src/WINNT/install/NSIS/OpenAFS.nsi index 8ed4eca..cdde2e3 100644 --- a/src/WINNT/install/NSIS/OpenAFS.nsi +++ b/src/WINNT/install/NSIS/OpenAFS.nsi @@ -626,6 +626,8 @@ Section "AFS Client" secClient StrCmp $R1 "1" +1 +2 StrCpy $R2 "$R2-S" + WriteRegStr HKLM "SOFTWARE\OpenAFS\Client" "AfscredsShortcutParams" "$R2" + CreateShortCut "$SMPROGRAMS\OpenAFS\Client\Authentication.lnk" "$INSTDIR\Client\Program\afscreds.exe" "$R2" ReadINIStr $R1 $2 "Field 1" "State" diff --git a/src/WINNT/install/wix/feature.wxi b/src/WINNT/install/wix/feature.wxi index 8bfe8ce..431741e 100644 --- a/src/WINNT/install/wix/feature.wxi +++ b/src/WINNT/install/wix/feature.wxi @@ -31,6 +31,7 @@ + CREDSSTARTUP = 0 @@ -45,10 +46,14 @@ + + + + diff --git a/src/WINNT/install/wix/files.wxi b/src/WINNT/install/wix/files.wxi index 8d251de..0411877 100644 --- a/src/WINNT/install/wix/files.wxi +++ b/src/WINNT/install/wix/files.wxi @@ -1,17 +1,15 @@ - - - + - - - - - + + + + + @@ -733,9 +731,14 @@ - + - + OLDCELLSERVDB = "" + + + + + OLDCELLSERVDB <> "" @@ -779,7 +782,7 @@ - + + - - + + + diff --git a/src/WINNT/install/wix/openafs.wxs b/src/WINNT/install/wix/openafs.wxs index dc4eb00..df94cd5 100644 --- a/src/WINNT/install/wix/openafs.wxs +++ b/src/WINNT/install/wix/openafs.wxs @@ -23,6 +23,7 @@ Id="$(var.PackageCode)" --> --> + + $(var.ProductComments) @@ -109,4 +115,10 @@ $(loc.StrNsisAbortReason) + + + + + + diff --git a/src/WINNT/install/wix/registry.wxi b/src/WINNT/install/wix/registry.wxi index 609e898..9266497 100644 --- a/src/WINNT/install/wix/registry.wxi +++ b/src/WINNT/install/wix/registry.wxi @@ -4,84 +4,88 @@ This file will be included as a child of the root Directory tag. --> - + - + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - + - - + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - + + + - + - - - - - - - + + + + + + + + + + + - - - + + + @@ -89,89 +93,96 @@ - - + + - - - - - - - - - - - - - + + + + + + + + + + + + - - - + + + + + + AFSCACHEPATH <> "" + + + + AFSCACHESIZE <> "" + - - + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - + + - - - - - - - + + + + + + + - - - - - - + + + + + + @@ -185,7 +196,7 @@ being removed when the product is uninstalled. This is just a flag component to add to the loopback feature so that it is not empty. --> - + -- 1.9.4