mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=11773
This commit is contained in:
parent
18aab9b7f9
commit
2b399ada16
|
@ -106,3 +106,27 @@ David 4 Jan 2007
|
|||
app_start.C
|
||||
clientgui/
|
||||
WelcomePage.cpp
|
||||
|
||||
Rom 5 Jan 2007
|
||||
- Win SETUP: Add custom actions for saving and restoring user preferences
|
||||
to the registry
|
||||
- Win SETUP: MoveFileEx isn't spported on the Win9x platform, so dynamically
|
||||
load and execute it on Windows 2000 or better.
|
||||
- Win SETUP: Remove some dead code from the custom action list.
|
||||
- Win SETUP: On Windows XP systems or better, we no longer require the
|
||||
service account to have a password, Microsoft has taken care of the
|
||||
problem by not allowing incomming network connections for accounts with
|
||||
no passwords.
|
||||
|
||||
win_build/installerv2/redist/Windows/src/boinccas/
|
||||
CAMigrateCPDNBBC.cpp
|
||||
CARestoreSetupState.cpp, .h
|
||||
CASaveSetupState.cpp, .h
|
||||
CASoftwareNeedsUpgrade.cpp, .h (Removed)
|
||||
CAVerifyServicePassword.cpp
|
||||
boinccas.cpp, .h
|
||||
boinccas.rc
|
||||
boinccas95.def
|
||||
win_build/installerv2/redist/Windows/x86/
|
||||
boinccas.dll
|
||||
boinccas95.dll
|
||||
|
|
|
@ -58,32 +58,45 @@ CAMigrateCPDNBBC::~CAMigrateCPDNBBC()
|
|||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
UINT CAMigrateCPDNBBC::OnExecution()
|
||||
{
|
||||
typedef BOOL (WINAPI *tMFE)( LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, DWORD dwFlags );
|
||||
|
||||
tstring strInstallDirectory;
|
||||
UINT uiReturnValue = -1;
|
||||
BOOL bReturnValue = FALSE;
|
||||
HMODULE hKernel32Lib = NULL;
|
||||
tMFE pMFE = NULL;
|
||||
|
||||
uiReturnValue = GetProperty( _T("INSTALLDIR"), strInstallDirectory );
|
||||
if ( uiReturnValue ) return uiReturnValue;
|
||||
|
||||
bReturnValue = MoveFileEx(
|
||||
_T("C:\\Program Files\\Climate Change Experiment"),
|
||||
strInstallDirectory.c_str(),
|
||||
MOVEFILE_COPY_ALLOWED|MOVEFILE_WRITE_THROUGH
|
||||
);
|
||||
if ( bReturnValue )
|
||||
{
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
_T("Climate Change Experiment files have been migrated to the installation directory.")
|
||||
// Dynamically link to the proper function pointers.
|
||||
hKernel32Lib = GetModuleHandle("kernel32.dll");
|
||||
#ifdef _UNICODE
|
||||
pMFE = (tMFE) GetProcAddress( hKernel32Lib, "MoveFileExW" );
|
||||
#else
|
||||
pMFE = (tMFE) GetProcAddress( hKernel32Lib, "MoveFileExA" );
|
||||
#endif
|
||||
|
||||
if (pMFE) {
|
||||
uiReturnValue = GetProperty( _T("INSTALLDIR"), strInstallDirectory );
|
||||
if ( uiReturnValue ) return uiReturnValue;
|
||||
|
||||
bReturnValue = pMFE(
|
||||
_T("C:\\Program Files\\Climate Change Experiment"),
|
||||
strInstallDirectory.c_str(),
|
||||
MOVEFILE_COPY_ALLOWED|MOVEFILE_WRITE_THROUGH
|
||||
);
|
||||
if ( bReturnValue )
|
||||
{
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
_T("Climate Change Experiment files have been migrated to the installation directory.")
|
||||
);
|
||||
}
|
||||
}
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,110 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "boinccas.h"
|
||||
#include "CARestoreSetupState.h"
|
||||
|
||||
#define CUSTOMACTION_NAME _T("CARestoreSetupState")
|
||||
#define CUSTOMACTION_PROGRESSTITLE _T("Restore the previous setups saved parameters.")
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
CARestoreSetupState::CARestoreSetupState(MSIHANDLE hMSIHandle) :
|
||||
BOINCCABase(hMSIHandle, CUSTOMACTION_NAME, CUSTOMACTION_PROGRESSTITLE)
|
||||
{}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
CARestoreSetupState::~CARestoreSetupState()
|
||||
{
|
||||
BOINCCABase::~BOINCCABase();
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
UINT CARestoreSetupState::OnExecution()
|
||||
{
|
||||
tstring strInstallDirectory;
|
||||
tstring strSetupType;
|
||||
tstring strLaunchProgram;
|
||||
tstring strEnableLaunchAtLogon;
|
||||
tstring strEnableScreensaver;
|
||||
tstring strServiceDomain;
|
||||
tstring strServiceUsername;
|
||||
|
||||
GetRegistryValue( _T("INSTALLDIR"), strInstallDirectory );
|
||||
GetRegistryValue( _T("SETUPTYPE"), strSetupType );
|
||||
GetRegistryValue( _T("LAUNCHPROGRAM"), strLaunchProgram );
|
||||
GetRegistryValue( _T("ENABLELAUNCHATLOGON"), strEnableLaunchAtLogon );
|
||||
GetRegistryValue( _T("ENABLESCREENSAVER"), strEnableScreensaver );
|
||||
GetRegistryValue( _T("SERVICE_DOMAIN"), strServiceDomain );
|
||||
GetRegistryValue( _T("SERVICE_USERNAME"), strServiceUsername );
|
||||
|
||||
SetProperty( _T("INSTALLDIR"), strInstallDirectory );
|
||||
SetProperty( _T("SETUPTYPE"), strSetupType );
|
||||
SetProperty( _T("LAUNCHPROGRAM"), strLaunchProgram );
|
||||
SetProperty( _T("ENABLELAUNCHATLOGON"), strEnableLaunchAtLogon );
|
||||
SetProperty( _T("ENABLESCREENSAVER"), strEnableScreensaver );
|
||||
SetProperty( _T("SERVICE_DOMAIN"), strServiceDomain );
|
||||
SetProperty( _T("SERVICE_USERNAME"), strServiceUsername );
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function: RestoreSetupState
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
UINT __stdcall RestoreSetupState(MSIHANDLE hInstall)
|
||||
{
|
||||
UINT uiReturnValue = 0;
|
||||
|
||||
CARestoreSetupState* pCA = new CARestoreSetupState(hInstall);
|
||||
uiReturnValue = pCA->Execute();
|
||||
delete pCA;
|
||||
|
||||
return uiReturnValue;
|
||||
}
|
||||
|
||||
|
||||
const char *BOINC_RCSID_7bca879adb="$Id$";
|
|
@ -18,24 +18,19 @@
|
|||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
|
||||
#ifndef _CASOFTWARENEEDSUPGRADE_H_
|
||||
#define _CASOFTWARENEEDSUPGRADE_H_
|
||||
#ifndef _CARESTORESETUPSTATE_H_
|
||||
#define _CARESTORESETUPSTATE_H_
|
||||
|
||||
|
||||
class CASoftwareNeedsUpgrade : public BOINCCABase
|
||||
class CARestoreSetupState : public BOINCCABase
|
||||
{
|
||||
public:
|
||||
|
||||
CASoftwareNeedsUpgrade(MSIHANDLE hMSIHandle);
|
||||
~CASoftwareNeedsUpgrade();
|
||||
CARestoreSetupState(MSIHANDLE hMSIHandle);
|
||||
~CARestoreSetupState();
|
||||
virtual UINT OnExecution();
|
||||
|
||||
void VersionCheck(
|
||||
const tstring strPackage,
|
||||
const tstring strPackageLocation,
|
||||
const tstring strPackageProperty
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
|
@ -0,0 +1,110 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "boinccas.h"
|
||||
#include "CASaveSetupState.h"
|
||||
|
||||
#define CUSTOMACTION_NAME _T("CASaveSetupState")
|
||||
#define CUSTOMACTION_PROGRESSTITLE _T("Attempt to rename CPDNBBC installation directory to the default BOINC directory.")
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
CASaveSetupState::CASaveSetupState(MSIHANDLE hMSIHandle) :
|
||||
BOINCCABase(hMSIHandle, CUSTOMACTION_NAME, CUSTOMACTION_PROGRESSTITLE)
|
||||
{}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
CASaveSetupState::~CASaveSetupState()
|
||||
{
|
||||
BOINCCABase::~BOINCCABase();
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
UINT CASaveSetupState::OnExecution()
|
||||
{
|
||||
tstring strInstallDirectory;
|
||||
tstring strSetupType;
|
||||
tstring strLaunchProgram;
|
||||
tstring strEnableLaunchAtLogon;
|
||||
tstring strEnableScreensaver;
|
||||
tstring strServiceDomain;
|
||||
tstring strServiceUsername;
|
||||
|
||||
GetProperty( _T("INSTALLDIR"), strInstallDirectory );
|
||||
GetProperty( _T("SETUPTYPE"), strSetupType );
|
||||
GetProperty( _T("LAUNCHPROGRAM"), strLaunchProgram );
|
||||
GetProperty( _T("ENABLELAUNCHATLOGON"), strEnableLaunchAtLogon );
|
||||
GetProperty( _T("ENABLESCREENSAVER"), strEnableScreensaver );
|
||||
GetProperty( _T("SERVICE_DOMAIN"), strServiceDomain );
|
||||
GetProperty( _T("SERVICE_USERNAME"), strServiceUsername );
|
||||
|
||||
SetRegistryValue( _T("INSTALLDIR"), strInstallDirectory );
|
||||
SetRegistryValue( _T("SETUPTYPE"), strSetupType );
|
||||
SetRegistryValue( _T("LAUNCHPROGRAM"), strLaunchProgram );
|
||||
SetRegistryValue( _T("ENABLELAUNCHATLOGON"), strEnableLaunchAtLogon );
|
||||
SetRegistryValue( _T("ENABLESCREENSAVER"), strEnableScreensaver );
|
||||
SetRegistryValue( _T("SERVICE_DOMAIN"), strServiceDomain );
|
||||
SetRegistryValue( _T("SERVICE_USERNAME"), strServiceUsername );
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function: SaveSetupState
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
UINT __stdcall SaveSetupState(MSIHANDLE hInstall)
|
||||
{
|
||||
UINT uiReturnValue = 0;
|
||||
|
||||
CASaveSetupState* pCA = new CASaveSetupState(hInstall);
|
||||
uiReturnValue = pCA->Execute();
|
||||
delete pCA;
|
||||
|
||||
return uiReturnValue;
|
||||
}
|
||||
|
||||
|
||||
const char *BOINC_RCSID_7bca879adc="$Id$";
|
|
@ -0,0 +1,37 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
|
||||
#ifndef _CASAVESETUPSTATE_H_
|
||||
#define _CASAVESETUPSTATE_H_
|
||||
|
||||
|
||||
class CASaveSetupState : public BOINCCABase
|
||||
{
|
||||
public:
|
||||
|
||||
CASaveSetupState(MSIHANDLE hMSIHandle);
|
||||
~CASaveSetupState();
|
||||
virtual UINT OnExecution();
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -1,231 +0,0 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "boinccas.h"
|
||||
#include "CASoftwareNeedsUpgrade.h"
|
||||
|
||||
#define CUSTOMACTION_NAME _T("CASoftwareNeedsUpgrade")
|
||||
#define CUSTOMACTION_PROGRESSTITLE _T("Verifying software compatibility levels")
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
CASoftwareNeedsUpgrade::CASoftwareNeedsUpgrade(MSIHANDLE hMSIHandle) :
|
||||
BOINCCABase(hMSIHandle, CUSTOMACTION_NAME, CUSTOMACTION_PROGRESSTITLE)
|
||||
{}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
CASoftwareNeedsUpgrade::~CASoftwareNeedsUpgrade()
|
||||
{
|
||||
BOINCCABase::~BOINCCABase();
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
UINT CASoftwareNeedsUpgrade::OnExecution()
|
||||
{
|
||||
UINT uiReturnValue = 0;
|
||||
HKEY hKey;
|
||||
TCHAR szVersion[128];
|
||||
DWORD dwBufLen = (sizeof(szVersion)/sizeof(TCHAR));
|
||||
LONG lRet;
|
||||
|
||||
lRet = RegOpenKeyEx(
|
||||
HKEY_LOCAL_MACHINE,
|
||||
_T("SOFTWARE\\Microsoft\\IntelliPoint"),
|
||||
0,
|
||||
KEY_QUERY_VALUE,
|
||||
&hKey
|
||||
);
|
||||
if ( lRet != ERROR_SUCCESS )
|
||||
{
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
_T("Microsoft IntelliPoint NOT Detected.")
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
_T("Microsoft IntelliPoint Detected.")
|
||||
);
|
||||
|
||||
lRet = RegQueryValueEx(
|
||||
hKey,
|
||||
"Version",
|
||||
NULL,
|
||||
NULL,
|
||||
(LPBYTE) szVersion,
|
||||
&dwBufLen
|
||||
);
|
||||
|
||||
if( (lRet != ERROR_SUCCESS) || (dwBufLen > BUFSIZE) )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ( lRet == ERROR_SUCCESS )
|
||||
{
|
||||
DisplayMessage(
|
||||
MB_OK,
|
||||
MB_ICONERROR,
|
||||
_T("Setup has detected an older version of BOINC which must be uninstalled before this version of BOINC can be installed.")
|
||||
);
|
||||
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
_T("Setup has detected an older version of BOINC which must be uninstalled before this version of BOINC can be installed.")
|
||||
);
|
||||
|
||||
uiReturnValue = ERROR_INSTALL_FAILURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
_T("Setup did NOT detect a previous version of the BOINC installer on the system.")
|
||||
);
|
||||
uiReturnValue = ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
RegCloseKey( hKey );
|
||||
|
||||
return uiReturnValue;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
void VersionCheck(const tstring strPackage, const tstring strPackageLocation, const tstring strPackageProperty)
|
||||
{
|
||||
HKEY hKey;
|
||||
TCHAR szVersion[128];
|
||||
DWORD dwBufLen = (sizeof(szVersion)/sizeof(TCHAR));
|
||||
LONG lRet;
|
||||
|
||||
lRet = RegOpenKeyEx(
|
||||
HKEY_LOCAL_MACHINE,
|
||||
_T("SOFTWARE\\Microsoft\\IntelliPoint"),
|
||||
0,
|
||||
KEY_QUERY_VALUE,
|
||||
&hKey
|
||||
);
|
||||
if ( lRet != ERROR_SUCCESS )
|
||||
{
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
_T("Microsoft IntelliPoint NOT Detected.")
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
_T("Microsoft IntelliPoint Detected.")
|
||||
);
|
||||
|
||||
lRet = RegQueryValueEx(
|
||||
hKey,
|
||||
"Version",
|
||||
NULL,
|
||||
NULL,
|
||||
(LPBYTE) szVersion,
|
||||
&dwBufLen
|
||||
);
|
||||
|
||||
if( (lRet != ERROR_SUCCESS) || (dwBufLen > BUFSIZE) )
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function: ValidateSetupType
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
UINT __stdcall SoftwareNeedsUpgrade(MSIHANDLE hInstall)
|
||||
{
|
||||
UINT uiReturnValue = 0;
|
||||
|
||||
CASoftwareNeedsUpgrade* pCA = new CASoftwareNeedsUpgrade(hInstall);
|
||||
uiReturnValue = pCA->Execute();
|
||||
delete pCA;
|
||||
|
||||
return uiReturnValue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const char *BOINC_RCSID_d533f80c52="$Id$";
|
|
@ -62,6 +62,7 @@ UINT CAVerifyServicePassword::OnExecution()
|
|||
{
|
||||
tstring strServicePassword;
|
||||
tstring strServicePasswordConfirmation;
|
||||
tstring strWindowsVersion;
|
||||
UINT uiReturnValue = 0;
|
||||
|
||||
|
||||
|
@ -71,6 +72,9 @@ UINT CAVerifyServicePassword::OnExecution()
|
|||
uiReturnValue = GetProperty( _T("SERVICE_CONFIRMPASSWORD"), strServicePasswordConfirmation, false );
|
||||
if ( uiReturnValue ) return uiReturnValue;
|
||||
|
||||
uiReturnValue = GetProperty( _T("VersionNT"), strWindowsVersion, false );
|
||||
if ( uiReturnValue ) return uiReturnValue;
|
||||
|
||||
|
||||
if ( strServicePassword != strServicePasswordConfirmation )
|
||||
{
|
||||
|
@ -84,7 +88,7 @@ UINT CAVerifyServicePassword::OnExecution()
|
|||
}
|
||||
else
|
||||
{
|
||||
if ( strServicePassword.empty() )
|
||||
if ( strServicePassword.empty() && ( strWindowsVersion.empty() || (strWindowsVersion < _T("501")) ))
|
||||
{
|
||||
DisplayMessage(
|
||||
MB_OK,
|
||||
|
|
|
@ -477,6 +477,156 @@ UINT BOINCCABase::SetProperty(
|
|||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function: GetRegistryValue
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
UINT BOINCCABase::GetRegistryValue(
|
||||
const tstring strName,
|
||||
tstring& strValue,
|
||||
bool bDisplayValue
|
||||
)
|
||||
{
|
||||
LONG lReturnValue;
|
||||
HKEY hkSetupHive;
|
||||
DWORD dwType = REG_SZ;
|
||||
DWORD dwSize = 0;
|
||||
LPTSTR lpszRegistryValue = NULL;
|
||||
tstring strMessage;
|
||||
|
||||
lReturnValue = RegOpenKeyEx(
|
||||
HKEY_LOCAL_MACHINE,
|
||||
_T("SOFTWARE\\Space Sciences Laboratory, U.C. Berkeley\\BOINC Setup"),
|
||||
0,
|
||||
KEY_READ,
|
||||
&hkSetupHive
|
||||
);
|
||||
if (lReturnValue != ERROR_SUCCESS) return ERROR_INSTALL_FAILURE;
|
||||
|
||||
// How large does our buffer need to be?
|
||||
RegQueryValueEx(
|
||||
hkSetupHive,
|
||||
strName.c_str(),
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
&dwSize
|
||||
);
|
||||
|
||||
// Allocate the buffer space.
|
||||
lpszRegistryValue = (LPTSTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize);
|
||||
if ( NULL == lpszRegistryValue ) {
|
||||
RegCloseKey(hkSetupHive);
|
||||
return ERROR_INSTALL_FAILURE;
|
||||
}
|
||||
|
||||
// Now get the data
|
||||
lReturnValue = RegQueryValueEx(
|
||||
hkSetupHive,
|
||||
strName.c_str(),
|
||||
NULL,
|
||||
&dwType,
|
||||
(LPBYTE)lpszRegistryValue,
|
||||
&dwSize
|
||||
);
|
||||
|
||||
// Cleanup
|
||||
RegCloseKey(hkSetupHive);
|
||||
HeapFree(GetProcessHeap(), NULL, lpszRegistryValue);
|
||||
|
||||
// One last check to make sure everything is on the up and up.
|
||||
if (lReturnValue != ERROR_SUCCESS) return ERROR_INSTALL_FAILURE;
|
||||
|
||||
// Send up the returned value.
|
||||
strValue = lpszRegistryValue;
|
||||
|
||||
strMessage = _T("Successfully retrieved registry value '") + strName;
|
||||
strMessage += _T("' with a value of '");
|
||||
if (bDisplayValue)
|
||||
strMessage += strValue;
|
||||
else
|
||||
strMessage += _T("<Value Hidden>");
|
||||
strMessage += _T("'");
|
||||
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
strMessage.c_str()
|
||||
);
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function: SetRegistryValue
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
UINT BOINCCABase::SetRegistryValue(
|
||||
const tstring strName,
|
||||
const tstring strValue,
|
||||
bool bDisplayValue
|
||||
)
|
||||
{
|
||||
LONG lReturnValue;
|
||||
HKEY hkSetupHive;
|
||||
tstring strMessage;
|
||||
|
||||
lReturnValue = RegCreateKeyEx(
|
||||
HKEY_LOCAL_MACHINE,
|
||||
_T("SOFTWARE\\Space Sciences Laboratory, U.C. Berkeley\\BOINC Setup"),
|
||||
0,
|
||||
NULL,
|
||||
REG_OPTION_NON_VOLATILE,
|
||||
KEY_READ | KEY_WRITE,
|
||||
NULL,
|
||||
&hkSetupHive,
|
||||
NULL
|
||||
);
|
||||
if (lReturnValue != ERROR_SUCCESS) return ERROR_INSTALL_FAILURE;
|
||||
|
||||
lReturnValue = RegSetValueEx(
|
||||
hkSetupHive,
|
||||
strName.c_str(),
|
||||
0,
|
||||
REG_SZ,
|
||||
(CONST BYTE *)strValue.c_str(),
|
||||
(DWORD)(strValue.size()*sizeof(TCHAR))
|
||||
);
|
||||
|
||||
RegCloseKey(hkSetupHive);
|
||||
if (lReturnValue != ERROR_SUCCESS) return ERROR_INSTALL_FAILURE;
|
||||
|
||||
strMessage = _T("Successfully set registry value '") + strName;
|
||||
strMessage += _T("' to a value of '");
|
||||
if (bDisplayValue)
|
||||
strMessage += strValue;
|
||||
else
|
||||
strMessage += _T("<Value Hidden>");
|
||||
strMessage += _T("'");
|
||||
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
strMessage.c_str()
|
||||
);
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function: DisplayMessage
|
||||
|
|
|
@ -63,8 +63,21 @@ public:
|
|||
);
|
||||
|
||||
UINT SetProperty(
|
||||
const tstring pszPropertyName,
|
||||
const tstring pszPropertyValue,
|
||||
const tstring strPropertyName,
|
||||
const tstring strPropertyValue,
|
||||
bool bDisplayValue = true
|
||||
);
|
||||
|
||||
// Registry Property Management
|
||||
UINT GetRegistryValue(
|
||||
const tstring strName,
|
||||
tstring& strValue,
|
||||
bool bDisplayValue = true
|
||||
);
|
||||
|
||||
UINT SetRegistryValue(
|
||||
const tstring strName,
|
||||
const tstring strValue,
|
||||
bool bDisplayValue = true
|
||||
);
|
||||
|
||||
|
|
|
@ -53,8 +53,8 @@ END
|
|||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,10
|
||||
PRODUCTVERSION 1,0,0,10
|
||||
FILEVERSION 1,0,0,11
|
||||
PRODUCTVERSION 1,0,0,11
|
||||
FILEFLAGSMASK 0x17L
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
@ -70,12 +70,12 @@ BEGIN
|
|||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "FileDescription", "BOINC Dynamic Link Library"
|
||||
VALUE "FileVersion", "1.0.0.10"
|
||||
VALUE "FileVersion", "1.0.0.11"
|
||||
VALUE "InternalName", "BOINC"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2005"
|
||||
VALUE "OriginalFilename", "BOINC.dll"
|
||||
VALUE "ProductName", " BOINC Dynamic Link Library"
|
||||
VALUE "ProductVersion", "1.0.0.10"
|
||||
VALUE "ProductVersion", "1.0.0.11"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
|
@ -10,3 +10,5 @@ EXPORTS
|
|||
ShutdownBOINCManager
|
||||
ValidateSetupType
|
||||
MigrateCPDNBBC
|
||||
RestoreSetupState
|
||||
SaveSetupState
|
||||
|
|
|
@ -135,6 +135,12 @@
|
|||
<File
|
||||
RelativePath=".\CAMigrateCPDNBBC.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CARestoreSetupState.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CASaveSetupState.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CAShutdownBOINC.cpp">
|
||||
</File>
|
||||
|
@ -172,6 +178,12 @@
|
|||
<File
|
||||
RelativePath=".\CAMigrateCPDNBBC.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CARestoreSetupState.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CASaveSetupState.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CAShutdownBOINC.h">
|
||||
</File>
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue