From 6b2c7f38a28f1656e2bf10ea608c8b43e3e16bfa Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Fri, 30 Nov 2007 18:52:41 +0000 Subject: [PATCH] - 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 --- checkin_notes | 18 ++++++++++++++++++ clientgui/BOINCGUIApp.cpp | 21 ++++++++++++++++++++- clientgui/BOINCGUIApp.h | 3 +++ clientgui/SkinManager.cpp | 12 +++++++++++- clienttray/tray_win.cpp | 22 +++++++++++++++++++++- clienttray/tray_win.h | 1 + win_build/boinc.sln | 9 +++------ win_build/boinctray.vcproj | 16 ++++++++++++++++ win_build/installerv2/BOINC.ism | Bin 206532 -> 206532 bytes 9 files changed, 93 insertions(+), 9 deletions(-) diff --git a/checkin_notes b/checkin_notes index d5d2ecf7aa..21a950ec98 100644 --- a/checkin_notes +++ b/checkin_notes @@ -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 diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index b7f1b03326..da6447442d 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -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__ diff --git a/clientgui/BOINCGUIApp.h b/clientgui/BOINCGUIApp.h index 8922d582e0..a6d47f04f6 100644 --- a/clientgui/BOINCGUIApp.h +++ b/clientgui/BOINCGUIApp.h @@ -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 diff --git a/clientgui/SkinManager.cpp b/clientgui/SkinManager.cpp index f3db6bc431..9c2f262d7e 100644 --- a/clientgui/SkinManager.cpp +++ b/clientgui/SkinManager.cpp @@ -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; } diff --git a/clienttray/tray_win.cpp b/clienttray/tray_win.cpp index 67d24c7e0a..5a0b135f23 100644 --- a/clienttray/tray_win.cpp +++ b/clienttray/tray_win.cpp @@ -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); } diff --git a/clienttray/tray_win.h b/clienttray/tray_win.h index 2881fd7720..ce9ee4e73a 100644 --- a/clienttray/tray_win.h +++ b/clienttray/tray_win.h @@ -43,6 +43,7 @@ protected: static LRESULT CALLBACK TrayProcStub( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); HANDLE m_hDataManagementThread; + BOOL m_bClientLibraryInitialized; }; #endif diff --git a/win_build/boinc.sln b/win_build/boinc.sln index 715681bea8..3b0277d224 100644 --- a/win_build/boinc.sln +++ b/win_build/boinc.sln @@ -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 diff --git a/win_build/boinctray.vcproj b/win_build/boinctray.vcproj index db6c76135f..cc9fe2e2b0 100644 --- a/win_build/boinctray.vcproj +++ b/win_build/boinctray.vcproj @@ -679,10 +679,18 @@ Name="Source Files" Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" > + + + + + + + + w{Sl)+`pm!Wu!N zp%bS~l}INW_rz+PmRM3X9g%Ih?MzxtQP9LxseP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