From c16417bf51b20ed8505ac52eafb75cf001405bd1 Mon Sep 17 00:00:00 2001 From: Kevin Reed Date: Thu, 30 Oct 2008 21:30:56 +0000 Subject: [PATCH] Prevent cc_config.xml from being deleted if the volunteer customized it. svn path=/trunk/boinc/; revision=16368 --- .../redist/Windows/src/boinccas/CACCConfigMd5sum.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/win_build/installerv2/redist/Windows/src/boinccas/CACCConfigMd5sum.cpp b/win_build/installerv2/redist/Windows/src/boinccas/CACCConfigMd5sum.cpp index 9accfd295a..1f3d8e87a8 100644 --- a/win_build/installerv2/redist/Windows/src/boinccas/CACCConfigMd5sum.cpp +++ b/win_build/installerv2/redist/Windows/src/boinccas/CACCConfigMd5sum.cpp @@ -83,6 +83,7 @@ UINT CACCConfigMd5sum::OnExecution() FILE *file; memset(&contents,'\0',sizeof(contents)); + SetProperty(_T("KEEPEXISTINGCONFIG"), _T("0")); uiReturnValue = GetProperty( _T("INSTALLDIR"), strInstallDirectory ); if ( uiReturnValue ) return uiReturnValue; if (strInstallDirectory.rfind('\\') != strInstallDirectory.size() - 1 ) { @@ -111,7 +112,6 @@ UINT CACCConfigMd5sum::OnExecution() if ( file == NULL ) { _sntprintf(szMessage,sizeof(szMessage),_T("fopen: Error Message '%s': '%s'"),strerror(errno),strLocation.c_str()); LogMessage(INSTALLMESSAGE_INFO,NULL, NULL,NULL,NULL,szMessage); - SetProperty(_T("CCCONFIGMD5SUM"), _T("1")); return ERROR_SUCCESS; } else { _sntprintf(szMessage,sizeof(szMessage),_T("fopen: File found at: '%s'"),strLocation.c_str()); @@ -157,7 +157,9 @@ UINT CACCConfigMd5sum::OnExecution() LogMessage(INSTALLMESSAGE_INFO,NULL, NULL,NULL,NULL,szMessage); return ERROR_SUCCESS; } + _sntprintf(szMessage,sizeof(szMessage),_T("CCConfig was not a version from previous install")); + SetProperty(_T("KEEPEXISTINGCONFIG"), _T("1")); LogMessage(INSTALLMESSAGE_INFO,NULL, NULL,NULL,NULL,szMessage); return ERROR_SUCCESS; }