mirror of https://github.com/BOINC/boinc.git
- WINSETUP: Store and cleanup a set of flags to avoid repeatedly
migrating data back and forth. - WINSETUP: If the migration uninstall routine detects a newer version of BOINC being installed, skip the uninstall process. win_build/installerv2/redist/Windows/src/boinccas/ boinccas.rc boinccas95.def boinccas95.vcproj CAMigrateBOINCData.cpp CAMigrateBOINCDataCleanup.cpp, .h (Added) CAMigrateBOINCDataVersion.cpp, .h (Added) CAValidateInstall.cpp win_build/installerv2/redist/Windows/Win32/ boinccas.dll boinccas95.dll win_build/installerv2/redist/Windows/x64/ boinccas.dll boinccas95.dll svn path=/trunk/boinc/; revision=15466
This commit is contained in:
parent
8062bc1bbd
commit
e3037aa5e2
|
@ -5107,3 +5107,24 @@ David 23 June 2008
|
|||
html/inc/
|
||||
user.inc
|
||||
team.inc
|
||||
|
||||
Rom 25 June 2008
|
||||
- WINSETUP: Store and cleanup a set of flags to avoid repeatedly
|
||||
migrating data back and forth.
|
||||
- WINSETUP: If the migration uninstall routine detects a newer
|
||||
version of BOINC being installed, skip the uninstall process.
|
||||
|
||||
win_build/installerv2/redist/Windows/src/boinccas/
|
||||
boinccas.rc
|
||||
boinccas95.def
|
||||
boinccas95.vcproj
|
||||
CAMigrateBOINCData.cpp
|
||||
CAMigrateBOINCDataCleanup.cpp, .h (Added)
|
||||
CAMigrateBOINCDataVersion.cpp, .h (Added)
|
||||
CAValidateInstall.cpp
|
||||
win_build/installerv2/redist/Windows/Win32/
|
||||
boinccas.dll
|
||||
boinccas95.dll
|
||||
win_build/installerv2/redist/Windows/x64/
|
||||
boinccas.dll
|
||||
boinccas95.dll
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -326,9 +326,12 @@ UINT CAMigrateBOINCData::OnExecution()
|
|||
tstring strCurrentDataDirectory;
|
||||
tstring strFutureDataDirectory;
|
||||
tstring strMigration;
|
||||
tstring strMigrationSkipped;
|
||||
tstring strMigrationVersion;
|
||||
tstring strMigrationDirectory;
|
||||
tstring strDestinationClientStateFile;
|
||||
tstring strRemove;
|
||||
tstring strProductVersion;
|
||||
struct _stat buf;
|
||||
ULONGLONG ullFileSize = 0;
|
||||
ULONGLONG ullDirectorySize = 0;
|
||||
|
@ -354,19 +357,35 @@ UINT CAMigrateBOINCData::OnExecution()
|
|||
if ( uiReturnValue ) return uiReturnValue;
|
||||
|
||||
uiReturnValue = GetRegistryValue( _T("MIGRATION"), strMigration );
|
||||
uiReturnValue = GetRegistryValue( _T("MIGRATIONVERSION"), strMigrationVersion );
|
||||
uiReturnValue = GetRegistryValue( _T("MIGRATIONDIR"), strMigrationDirectory );
|
||||
|
||||
uiReturnValue = GetProperty( _T("REMOVE"), strRemove );
|
||||
if ( uiReturnValue ) return uiReturnValue;
|
||||
|
||||
uiReturnValue = GetProperty( _T("ProductVersion"), strProductVersion );
|
||||
if ( uiReturnValue ) return uiReturnValue;
|
||||
|
||||
|
||||
// If the REMOVE property is specified, then we are uninstalling BOINC, and
|
||||
// need to move things back to their orginal location.
|
||||
if (strRemove.length())
|
||||
{
|
||||
strCustomActionData = strMigration + _T("|");
|
||||
strCustomActionData += strFutureDataDirectory + _T("|");
|
||||
strCustomActionData += strMigrationDirectory;
|
||||
if ( 0 <= _tcscmp(strProductVersion.c_str(), strMigrationVersion.c_str()) )
|
||||
{
|
||||
strCustomActionData = strMigration + _T("|");
|
||||
strCustomActionData += strFutureDataDirectory + _T("|");
|
||||
strCustomActionData += strMigrationDirectory;
|
||||
}
|
||||
else
|
||||
{
|
||||
// We are installing a new version, so skip the uninstall process
|
||||
//
|
||||
strMigrationSkipped = _T("1");
|
||||
strCustomActionData = _T("FALSE|");
|
||||
strCustomActionData += strFutureDataDirectory + _T("|");
|
||||
strCustomActionData += strMigrationDirectory;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -384,6 +403,12 @@ UINT CAMigrateBOINCData::OnExecution()
|
|||
|
||||
if ( bClientStateExists )
|
||||
{
|
||||
// If migration was done with a previous 6.x client then we don't need
|
||||
// to migrate, but we do need to preserve our migration settings
|
||||
if ((strProductVersion == strMigrationVersion) && (strMigration == _T("TRUE")))
|
||||
{
|
||||
strMigrationSkipped = _T("1");
|
||||
}
|
||||
strMigration = _T("FALSE");
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
|
@ -506,7 +531,10 @@ UINT CAMigrateBOINCData::OnExecution()
|
|||
strCustomActionData += strFutureDataDirectory;
|
||||
}
|
||||
|
||||
SetRegistryValue( _T("MIGRATION"), strMigration );
|
||||
if ( _T("1") != strMigrationSkipped )
|
||||
{
|
||||
SetRegistryValue( _T("MIGRATION"), strMigration );
|
||||
}
|
||||
SetRegistryValue( _T("MIGRATIONDIR"), strMigrationDirectory );
|
||||
SetProperty( _T("CAMigrateBOINCDataInstall"), strCustomActionData );
|
||||
SetProperty( _T("CAMigrateBOINCDataRollback"), strCustomActionData );
|
||||
|
|
|
@ -0,0 +1,111 @@
|
|||
// 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.,
|
||||
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "boinccas.h"
|
||||
#include "CAMigrateBOINCDataCleanup.h"
|
||||
#include "dirops.h"
|
||||
|
||||
#define CUSTOMACTION_NAME _T("CAMigrateBOINCDataCleanup")
|
||||
#define CUSTOMACTION_PROGRESSTITLE _T("Cleanup current installer's version.")
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
CAMigrateBOINCDataCleanup::CAMigrateBOINCDataCleanup(MSIHANDLE hMSIHandle) :
|
||||
BOINCCABase(hMSIHandle, CUSTOMACTION_NAME, CUSTOMACTION_PROGRESSTITLE)
|
||||
{}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
CAMigrateBOINCDataCleanup::~CAMigrateBOINCDataCleanup()
|
||||
{
|
||||
BOINCCABase::~BOINCCABase();
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
UINT CAMigrateBOINCDataCleanup::OnExecution()
|
||||
{
|
||||
tstring strMigrationVersion;
|
||||
UINT uiReturnValue = -1;
|
||||
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
_T("CAMigrateBOINCDataCleanup::OnExecution -- Function Begin")
|
||||
);
|
||||
|
||||
|
||||
uiReturnValue = SetRegistryValue( _T("MIGRATIONVERSION"), _T("") );
|
||||
if ( uiReturnValue ) return uiReturnValue;
|
||||
|
||||
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
_T("CAMigrateBOINCDataCleanup::OnExecution -- Function End")
|
||||
);
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function: MigrateBOINCDataCleanup
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
UINT __stdcall MigrateBOINCDataCleanup(MSIHANDLE hInstall)
|
||||
{
|
||||
UINT uiReturnValue = 0;
|
||||
|
||||
CAMigrateBOINCDataCleanup* pCA = new CAMigrateBOINCDataCleanup(hInstall);
|
||||
uiReturnValue = pCA->Execute();
|
||||
delete pCA;
|
||||
|
||||
return uiReturnValue;
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
// 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.,
|
||||
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
//
|
||||
|
||||
#ifndef _CAMIGRATEBOINCDATACLEANUP_H_
|
||||
#define _CAMIGRATEBOINCDATACLEANUP_H_
|
||||
|
||||
|
||||
class CAMigrateBOINCDataCleanup : public BOINCCABase
|
||||
{
|
||||
public:
|
||||
|
||||
CAMigrateBOINCDataCleanup(MSIHANDLE hMSIHandle);
|
||||
~CAMigrateBOINCDataCleanup();
|
||||
|
||||
virtual UINT OnExecution();
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
// 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.,
|
||||
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "boinccas.h"
|
||||
#include "CAMigrateBOINCDataVersion.h"
|
||||
#include "dirops.h"
|
||||
|
||||
#define CUSTOMACTION_NAME _T("CAMigrateBOINCDataVersion")
|
||||
#define CUSTOMACTION_PROGRESSTITLE _T("Store current installer's version.")
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
CAMigrateBOINCDataVersion::CAMigrateBOINCDataVersion(MSIHANDLE hMSIHandle) :
|
||||
BOINCCABase(hMSIHandle, CUSTOMACTION_NAME, CUSTOMACTION_PROGRESSTITLE)
|
||||
{}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
CAMigrateBOINCDataVersion::~CAMigrateBOINCDataVersion()
|
||||
{
|
||||
BOINCCABase::~BOINCCABase();
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
UINT CAMigrateBOINCDataVersion::OnExecution()
|
||||
{
|
||||
tstring strMigrationVersion;
|
||||
UINT uiReturnValue = -1;
|
||||
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
_T("CAMigrateBOINCDataVersion::OnExecution -- Function Begin")
|
||||
);
|
||||
|
||||
|
||||
uiReturnValue = GetProperty( _T("ProductVersion"), strMigrationVersion );
|
||||
if ( uiReturnValue ) return uiReturnValue;
|
||||
|
||||
uiReturnValue = SetRegistryValue( _T("MIGRATIONVERSION"), strMigrationVersion );
|
||||
if ( uiReturnValue ) return uiReturnValue;
|
||||
|
||||
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
_T("CAMigrateBOINCDataVersion::OnExecution -- Function End")
|
||||
);
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function: MigrateBOINCDataVersion
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
UINT __stdcall MigrateBOINCDataVersion(MSIHANDLE hInstall)
|
||||
{
|
||||
UINT uiReturnValue = 0;
|
||||
|
||||
CAMigrateBOINCDataVersion* pCA = new CAMigrateBOINCDataVersion(hInstall);
|
||||
uiReturnValue = pCA->Execute();
|
||||
delete pCA;
|
||||
|
||||
return uiReturnValue;
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
// 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.,
|
||||
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
//
|
||||
|
||||
#ifndef _CAMIGRATEBOINCDATAVERSION_H_
|
||||
#define _CAMIGRATEBOINCDATAVERSION_H_
|
||||
|
||||
|
||||
class CAMigrateBOINCDataVersion : public BOINCCABase
|
||||
{
|
||||
public:
|
||||
|
||||
CAMigrateBOINCDataVersion(MSIHANDLE hMSIHandle);
|
||||
~CAMigrateBOINCDataVersion();
|
||||
|
||||
virtual UINT OnExecution();
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -72,37 +72,37 @@ UINT CAValidateInstall::OnExecution()
|
|||
if ( uiReturnValue ) return uiReturnValue;
|
||||
|
||||
// Default to success
|
||||
SetProperty(_T("RETURN_VALIDATEINSTALL"), _T("1"));
|
||||
SetProperty(_T("RETURN_VALIDATEINSTALL"), _T("1"));
|
||||
|
||||
|
||||
strTemp = strInstallDirectory + _T("\\boinc.exe");
|
||||
if (!ValidateExecutable( strTemp, strProductVersion ))
|
||||
{
|
||||
SetProperty(_T("RETURN_VALIDATEINSTALL"), _T(""));
|
||||
SetProperty(_T("RETURN_VALIDATEINSTALL"), _T("0"));
|
||||
}
|
||||
|
||||
strTemp = strInstallDirectory + _T("\\boinc.dll");
|
||||
if (!ValidateExecutable( strTemp, strProductVersion ))
|
||||
{
|
||||
SetProperty(_T("RETURN_VALIDATEINSTALL"), _T(""));
|
||||
SetProperty(_T("RETURN_VALIDATEINSTALL"), _T("0"));
|
||||
}
|
||||
|
||||
strTemp = strInstallDirectory + _T("\\boincmgr.exe");
|
||||
if (!ValidateExecutable( strTemp, strProductVersion ))
|
||||
{
|
||||
SetProperty(_T("RETURN_VALIDATEINSTALL"), _T(""));
|
||||
SetProperty(_T("RETURN_VALIDATEINSTALL"), _T("0"));
|
||||
}
|
||||
|
||||
strTemp = strInstallDirectory + _T("\\boinccmd.exe");
|
||||
if (!ValidateExecutable( strTemp, strProductVersion ))
|
||||
{
|
||||
SetProperty(_T("RETURN_VALIDATEINSTALL"), _T(""));
|
||||
SetProperty(_T("RETURN_VALIDATEINSTALL"), _T("0"));
|
||||
}
|
||||
|
||||
strTemp = strInstallDirectory + _T("\\boinctray.exe");
|
||||
if (!ValidateExecutable( strTemp, strProductVersion ))
|
||||
{
|
||||
SetProperty(_T("RETURN_VALIDATEINSTALL"), _T(""));
|
||||
SetProperty(_T("RETURN_VALIDATEINSTALL"), _T("0"));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -53,8 +53,8 @@ END
|
|||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,90
|
||||
PRODUCTVERSION 1,0,0,90
|
||||
FILEVERSION 1,0,0,95
|
||||
PRODUCTVERSION 1,0,0,95
|
||||
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.90"
|
||||
VALUE "FileVersion", "1.0.0.95"
|
||||
VALUE "InternalName", "BOINC"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2005-2008"
|
||||
VALUE "OriginalFilename", "BOINC.dll"
|
||||
VALUE "ProductName", " BOINC Dynamic Link Library"
|
||||
VALUE "ProductVersion", "1.0.0.90"
|
||||
VALUE "ProductVersion", "1.0.0.95"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
|
@ -8,6 +8,8 @@ EXPORTS
|
|||
DllMain
|
||||
ValidateSetupType
|
||||
MigrateBOINCData
|
||||
MigrateBOINCDataVersion
|
||||
MigrateBOINCDataCleanup
|
||||
MigrateX86X64
|
||||
RestoreSetupState
|
||||
SaveSetupState
|
||||
|
|
|
@ -385,6 +385,14 @@
|
|||
RelativePath=".\CAMigrateBOINCData.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CAMigrateBOINCDataCleanup.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CAMigrateBOINCDataVersion.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CAMigratex86x64.cpp"
|
||||
>
|
||||
|
@ -482,6 +490,14 @@
|
|||
RelativePath=".\CAMigrateBOINCData.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CAMigrateBOINCDataCleanup.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CAMigrateBOINCDataVersion.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CAMigratex86x64.h"
|
||||
>
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue