- MGR: Add the ability for the manager to know the difference

between the executable directory and the data directory.
        (Windows Only)
    - TRAY: Update the tray code to what was used in 5.10.x
    - WINSETUP: Update for BOINCTray.exe
    
    clientgui/
        BOINCGUIApp.cpp, .h
        SkinManager.cpp
    clienttray/
        tray_win.cpp, .h
    win_build/
        boinc.sln
        boinctray.vcproj
    win_build/installerv2/
        BOINC.ism

svn path=/trunk/boinc/; revision=14335
This commit is contained in:
Rom Walton 2007-11-30 18:52:41 +00:00
parent af9e7833cd
commit 6b2c7f38a2
9 changed files with 93 additions and 9 deletions

View File

@ -11946,3 +11946,21 @@ Rom 30 Nov 2007
win_build/installerv2/redist/Windows/x64/
boinccas.dll
boinccas95.dll
Rom 30 Nov 2007
- MGR: Add the ability for the manager to know the difference
between the executable directory and the data directory.
(Windows Only)
- TRAY: Update the tray code to what was used in 5.10.x
- WINSETUP: Update for BOINCTray.exe
clientgui/
BOINCGUIApp.cpp, .h
SkinManager.cpp
clienttray/
tray_win.cpp, .h
win_build/
boinc.sln
boinctray.vcproj
win_build/installerv2/
BOINC.ism

View File

@ -133,6 +133,9 @@ bool CBOINCGUIApp::OnInit() {
#ifdef __WXMSW__
//
// Determine BOINCMgr Data Directory
//
LONG lReturnValue;
HKEY hkSetupHive;
LPTSTR lpszRegistryValue = NULL;
@ -174,7 +177,7 @@ bool CBOINCGUIApp::OnInit() {
SetCurrentDirectory(lpszRegistryValue);
// Store the root directory for later use.
m_strBOINCMGRRootDirectory = lpszRegistryValue;
m_strBOINCMGRDataDirectory = lpszRegistryValue;
}
}
@ -183,6 +186,22 @@ bool CBOINCGUIApp::OnInit() {
if (lpszRegistryValue) free(lpszRegistryValue);
//
// Determine BOINCMgr Root Directory
//
TCHAR szPath[MAX_PATH-1];
// change the current directory to the boinc install directory
GetModuleFileName(NULL, szPath, (sizeof(szPath)/sizeof(TCHAR)));
TCHAR *pszProg = strrchr(szPath, '\\');
if (pszProg) {
szPath[pszProg - szPath + 1] = 0;
}
// Store the root directory for later use.
m_strBOINCMGRRootDirectory = szPath;
#endif
#ifdef __WXMAC__

View File

@ -77,6 +77,7 @@ protected:
bool m_bBOINCStartedByManager;
wxString m_strBOINCMGRRootDirectory;
wxString m_strBOINCMGRDataDirectory;
wxString m_strBOINCArguments;
int m_iDisplayExitWarning;
@ -113,6 +114,8 @@ public:
CSkinManager* GetSkinManager() { return m_pSkinManager; }
CBOINCBaseFrame* GetFrame() { return m_pFrame; }
CMainDocument* GetDocument() { return m_pDocument; }
wxString GetRootDirectory() { return m_strBOINCMGRRootDirectory; }
wxString GetDataDirectory() { return m_strBOINCMGRDataDirectory; }
#if defined(__WXMSW__) || defined(__WXMAC__)
CTaskBarIcon* GetTaskBarIcon() { return m_pTaskBarIcon; }
#endif

View File

@ -1392,7 +1392,17 @@ wxString CSkinManager::GetSkinFileName() {
wxString CSkinManager::GetSkinsLocation() {
// Construct path to skins directory
return wxString(wxGetCwd() + wxString(wxFileName::GetPathSeparator()) + wxT("skins"));
wxString strSkinLocation = wxEmptyString;
#ifdef __WXMSW__
strSkinLocation = wxGetApp().GetRootDirectory();
strSkinLocation += wxFileName::GetPathSeparator();
strSkinLocation += wxT("skins");
#else
strSkinLocation = wxString(wxGetCwd() + wxString(wxFileName::GetPathSeparator()) + wxT("skins"));
#endif
return strSkinLocation;
}

View File

@ -24,8 +24,11 @@
#include "tray_win.h"
BOOL IdleTrackerStartup();
EXTERN_C DWORD BOINCGetIdleTickCount();
static CBOINCTray* gspBOINCTray = NULL;
void IdleTrackerShutdown();
HMODULE g_hModule = NULL;
static CBOINCTray* gspBOINCTray = NULL;
INT WINAPI WinMain(
@ -39,12 +42,17 @@ INT WINAPI WinMain(
CBOINCTray::CBOINCTray() {
gspBOINCTray = this;
m_hDataManagementThread = NULL;
m_bClientLibraryInitialized = FALSE;
}
// Starts main execution of BOINC Tray.
//
INT CBOINCTray::Run( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ) {
// Initialize the BOINC client library to setup the idle tracking system.
m_bClientLibraryInitialized = IdleTrackerStartup();
if (!hPrevInstance) {
// Register an appropriate window class for the primary window
WNDCLASS cls;
@ -79,6 +87,10 @@ INT CBOINCTray::Run( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
DispatchMessage( &msg );
}
// Cleanup and shutdown the BOINC client library idle tracking system.
IdleTrackerShutdown();
return msg.wParam;
}
@ -122,6 +134,14 @@ BOOL CBOINCTray::DestroyDataManagementThread() {
//
DWORD WINAPI CBOINCTray::DataManagementProc() {
while (true) {
if (!m_bClientLibraryInitialized) {
// On Vista systems, only elevated processes can create shared memory
// area's across various user sessions. In this case we need to wait
// for BOINC to create the shared memory area and then boinctray can
// successfully attach to it. What a PITA.
m_bClientLibraryInitialized = IdleTrackerStartup();
}
BOINCGetIdleTickCount();
Sleep(5000);
}

View File

@ -43,6 +43,7 @@ protected:
static LRESULT CALLBACK TrayProcStub( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
HANDLE m_hDataManagementThread;
BOOL m_bClientLibraryInitialized;
};
#endif

View File

@ -2,8 +2,8 @@ Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boinc", "boinc_cli_curl.vcproj", "{C04F0FCC-BB5D-4627-8656-6173B28BD69E}"
ProjectSection(ProjectDependencies) = postProject
{B06280CB-82A4-46DE-8956-602643078BDF} = {B06280CB-82A4-46DE-8956-602643078BDF}
{E8F6BD7E-461A-4733-B7D8-37B09A099ED8} = {E8F6BD7E-461A-4733-B7D8-37B09A099ED8}
{B06280CB-82A4-46DE-8956-602643078BDF} = {B06280CB-82A4-46DE-8956-602643078BDF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boinc_dll", "boinc_dll.vcproj", "{B06280CB-82A4-46DE-8956-602643078BDF}"
@ -12,14 +12,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boinc_ss", "boinc_ss.vcproj
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boinccmd", "boinccmd.vcproj", "{8F37E1F3-3A68-4A1D-9579-A1210BDD055E}"
ProjectSection(ProjectDependencies) = postProject
{C04F0FCC-BB5D-4627-8656-6173B28BD69E} = {C04F0FCC-BB5D-4627-8656-6173B28BD69E}
{E8F6BD7E-461A-4733-B7D8-37B09A099ED8} = {E8F6BD7E-461A-4733-B7D8-37B09A099ED8}
{C04F0FCC-BB5D-4627-8656-6173B28BD69E} = {C04F0FCC-BB5D-4627-8656-6173B28BD69E}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boincmgr", "boincmgr_curl.vcproj", "{06113715-AC51-4E91-8B9D-C987CABE0920}"
ProjectSection(ProjectDependencies) = postProject
{C04F0FCC-BB5D-4627-8656-6173B28BD69E} = {C04F0FCC-BB5D-4627-8656-6173B28BD69E}
{B06280CB-82A4-46DE-8956-602643078BDF} = {B06280CB-82A4-46DE-8956-602643078BDF}
{C04F0FCC-BB5D-4627-8656-6173B28BD69E} = {C04F0FCC-BB5D-4627-8656-6173B28BD69E}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libboinc", "libboinc.vcproj", "{E8F6BD7E-461A-4733-B7D8-37B09A099ED8}"
@ -32,9 +32,6 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boincsim", "sim.vcproj", "{B950E31B-C075-4F6D-8A2B-25EAE9D46C93}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boinctray", "boinctray.vcproj", "{4A2C5963-6A8D-4DA1-A312-C3D749B2EA81}"
ProjectSection(ProjectDependencies) = postProject
{B06280CB-82A4-46DE-8956-602643078BDF} = {B06280CB-82A4-46DE-8956-602643078BDF}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -679,10 +679,18 @@
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\clientlib\win\IdleTracker.cpp"
>
</File>
<File
RelativePath="..\clienttray\tray_win.cpp"
>
</File>
<File
RelativePath="..\lib\win_util.C"
>
</File>
</Filter>
<Filter
Name="Header Files"
@ -692,10 +700,18 @@
RelativePath="..\clienttray\boinc_tray.h"
>
</File>
<File
RelativePath="..\clientlib\win\IdleTracker.h"
>
</File>
<File
RelativePath="..\clienttray\tray_win.h"
>
</File>
<File
RelativePath="..\lib\win_util.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"

Binary file not shown.