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" > + + + + + + + +