diff --git a/checkin_notes b/checkin_notes index 01162f9ed7..402f7519fd 100755 --- a/checkin_notes +++ b/checkin_notes @@ -9017,3 +9017,32 @@ David 2 Oct 2007 gui_http.h lib/ util.C + +Kevin 2 Oct 2007 + - Screen Saver (merge from 5.10): Add additional information about the work + running when no graphics are available. Increased the size to the box + displaying the message to accommodate larger image sizes. Add code to + center images if less then the allowed max size of 450x166 + - Screen Saver (merge from 5.10): If graphics are not available, then rotate + through the currently running results (it will change every 10 seconds) + for display so that all are presented + - Manager (merge from 5.10): During an auto-attach initiated by a project_init.xml file, Mozilla + based browsers are checking cookies in the domain (ex: worldcommunitygrid.org) + for a project while IE cookies were only being checked for the full project + dns (www.worldcommunitygrid.org). IE has been changed so that it will also + check the domain. This mechanism is generic and can be used by any project or + account manager. + - Manager (merge from 5.10): During an auto-attach initiated by a project_init.xml file, + the code to check for the Setup cookie within an IE browser would fail and cause + the attach to project dialogue to close with no warning in the event that there + is a cookie set for the project but there is not a Setup cookie. + - WCG files: Updated image, icon and installer files for WCG + + clientgui/ + browser.C + clientscr/ + screensaver_win.cpp + screensaver_win.h + + + diff --git a/client/win/res/wcg.ico b/client/win/res/wcg.ico index 6aae432493..b2683b6ad4 100644 Binary files a/client/win/res/wcg.ico and b/client/win/res/wcg.ico differ diff --git a/clientgui/browser.C b/clientgui/browser.C index 0cbdbdc641..737f1f9ae5 100644 --- a/clientgui/browser.C +++ b/clientgui/browser.C @@ -427,7 +427,7 @@ bool detect_setup_authenticator_firefox( // bool detect_setup_authenticator_ie(std::string& project_url, std::string& authenticator) { - bool bReturnValue = FALSE; + bool bReturnValue = false; char szCookieBuffer[2048]; char* pszCookieFragment = NULL; DWORD dwSize = sizeof(szCookieBuffer)/sizeof(char); @@ -435,10 +435,21 @@ bool detect_setup_authenticator_ie(std::string& project_url, std::string& authen std::string strCookieName; std::string strCookieValue; size_t uiDelimeterLocation; + std::string hostname; + + + // if we don't find the cookie at the exact project dns name, check one higher (i.e. www.worldcommunitygrid.org becomes + // worldcommunitygrid.org + parse_hostname(project_url, hostname); bReturnValue = InternetGetCookie(project_url.c_str(), NULL, szCookieBuffer, &dwSize) == TRUE; + if (!bReturnValue) bReturnValue = InternetGetCookie(hostname.c_str(), NULL, szCookieBuffer, &dwSize) == TRUE; if (bReturnValue) { + // reset this becuase at this point we just know that we found some cookies for the website. We don't + // know if we actually found the Setup cookie + // + bReturnValue = false; // Format of cookie buffer: // 'cookie1=value1; cookie2=value2; cookie3=value3; // @@ -460,7 +471,9 @@ bool detect_setup_authenticator_ie(std::string& project_url, std::string& authen if (!is_authenticator_valid(strCookieValue)) { authenticator = ""; } else { + // Now we found it! Yea - auto attach! authenticator = strCookieValue; + bReturnValue = true; } } diff --git a/clientgui/res/wcg.ico b/clientgui/res/wcg.ico index 6aae432493..b2683b6ad4 100644 Binary files a/clientgui/res/wcg.ico and b/clientgui/res/wcg.ico differ diff --git a/clientscr/res/wcg.bmp b/clientscr/res/wcg.bmp new file mode 100644 index 0000000000..f6707724f9 Binary files /dev/null and b/clientscr/res/wcg.bmp differ diff --git a/clientscr/res/wcg.ico b/clientscr/res/wcg.ico index 6aae432493..b2683b6ad4 100644 Binary files a/clientscr/res/wcg.ico and b/clientscr/res/wcg.ico differ diff --git a/clientscr/screensaver_win.cpp b/clientscr/screensaver_win.cpp index 8fc7658feb..ede88f7ba6 100755 --- a/clientscr/screensaver_win.cpp +++ b/clientscr/screensaver_win.cpp @@ -862,8 +862,12 @@ BOOL CScreensaver::SetError(BOOL bErrorMode, HRESULT hrError) { // Update the error message // VOID CScreensaver::UpdateErrorBoxText() { + RESULTS results; PROJECT* pProject; TCHAR szBuffer[256]; + bool bIsActive = false; + bool bIsExecuting = false; + bool bIsDownloaded = false; size_t iResultCount = 0; size_t iIndex = 0; @@ -872,18 +876,38 @@ VOID CScreensaver::UpdateErrorBoxText() { GetTextForError(m_hrError, m_szError, sizeof(m_szError) / sizeof(TCHAR)); if (SCRAPPERR_BOINCNOGRAPHICSAPPSEXECUTING == m_hrError) { iResultCount = results.results.size(); + int iModIndex; for (iIndex = 0; iIndex < iResultCount; iIndex++) { + // cycle through the active results starting from the last one + iModIndex = (iIndex + m_iLastResultShown+1) % iResultCount; + bIsDownloaded = (RESULT_FILES_DOWNLOADED == results.results.at(iModIndex)->state); + bIsActive = (results.results.at(iModIndex)->active_task); + bIsExecuting = (CPU_SCHED_SCHEDULED == results.results.at(iModIndex)->scheduler_state); + if (!(bIsActive) || !(bIsDownloaded) || !(bIsExecuting)) continue; pProject = state.lookup_project(results.results.at(iIndex)->project_url); if (NULL != pProject) { - StringCbPrintf(szBuffer, sizeof(szBuffer) / sizeof(TCHAR), - _T("%s: %.2f%%\n"), - pProject->project_name.c_str(), - results.results.at(iIndex)->fraction_done * 100 - ); - - StringCbCat(m_szError, sizeof(m_szError) / sizeof(TCHAR), szBuffer); + RESULT* pResult = state.lookup_result(pProject, results.results.at(iModIndex)->name); + if ( pResult != NULL ) { + BOINCTRACE(_T("CScreensaver::UpdateErrorBoxText - Display result. iIndex=%d, iModIndex=%d, lastResult=%d\n"), iIndex, iModIndex, m_iLastResultShown); + StringCbPrintf(m_szError, sizeof(m_szError) / sizeof(TCHAR), + _T("\nRunning research for %s\nApplication: %s\nWorkunit: %s\n%.2f%% complete\n"), + pProject->project_name.c_str(), + pResult->app->user_friendly_name.c_str(), + pResult->wu_name.c_str(), + results.results.at(iModIndex)->fraction_done*100 + ); + if ( m_tLastResultChangeTime+10 < time(0) ) { + m_iLastResultShown = iModIndex; + m_tLastResultChangeTime = time(0); + } + break; + } else { + m_bResetCoreState = TRUE; + GetTextForError(IDS_ERR_GENERIC, m_szError, sizeof(m_szError) / sizeof(TCHAR)); + } } else { m_bResetCoreState = TRUE; + GetTextForError(IDS_ERR_GENERIC, m_szError, sizeof(m_szError) / sizeof(TCHAR)); } } m_szError[ sizeof(m_szError) -1 ] = '\0'; @@ -1001,6 +1025,10 @@ DWORD WINAPI CScreensaver::DataManagementProc() { SetError(TRUE, SCRAPPERR_BOINCSCREENSAVERLOADING); tThreadCreateTime = time(0); + // Set the starting point for iterating through the results + m_iLastResultShown = 0; + m_tLastResultChangeTime = 0; + while(1) { bScreenSaverStarting = (3 >= (time(0) - tThreadCreateTime)); @@ -1666,8 +1694,8 @@ VOID CScreensaver::UpdateErrorBox() { InvalidateRect(hwnd, NULL, FALSE); // Invalidate the hwnd so it gets drawn UpdateWindow(hwnd); } else { - pMonitorInfo->widthError = 500; - pMonitorInfo->heightError = 154; + pMonitorInfo->widthError = 454; + pMonitorInfo->heightError = 320; pMonitorInfo->xError = (rcBounds.right + rcBounds.left - pMonitorInfo->widthError) / 2.0f; pMonitorInfo->yError = (rcBounds.bottom + rcBounds.top - pMonitorInfo->heightError) / 2.0f; pMonitorInfo->xVelError = (rcBounds.right - rcBounds.left) / 10.0f; @@ -1768,6 +1796,8 @@ VOID CScreensaver::DoPaint(HWND hwnd, HDC hdc, LPPAINTSTRUCT lpps) { (INT)(pMonitorInfo->xError + pMonitorInfo->widthError), (INT)(pMonitorInfo->yError + pMonitorInfo->heightError) ); +// This fill rect is useful when testing +// FillRect(hdc, &rc, hbrushRed); rcOrginal = rc; @@ -1775,17 +1805,29 @@ VOID CScreensaver::DoPaint(HWND hwnd, HDC hdc, LPPAINTSTRUCT lpps) { // it. the bitmap is centered in the rectangle by adding 2 // to the left and top coordinates of the bitmap rectangle, // and subtracting 4 from the right and bottom coordinates. - DrawTransparentBitmap(hdc, hbmp, (rc.left + 2), (rc.top + 2), RGB(255, 0, 255)); - rc.left += 166; + BITMAP bm; + GetObject(hbmp, sizeof(BITMAP), (LPSTR)&bm); + + long left = rc.left + (pMonitorInfo->widthError - 4 - bm.bmWidth)/2; + long top = rc.top + 2; + DrawTransparentBitmap(hdc, hbmp, left, top, RGB(255, 0, 255)); // Draw text in the center of the frame SetBkColor(hdc, RGB(0,0,0)); // Black SetTextColor(hdc, RGB(255,255,255)); // Red - + + // Set font + HFONT hf; + hf = CreateFont(0, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, "Arial Narrow"); + + if(hf) + { + SelectObject(hdc, hf); + } rc2 = rc; iTextHeight = DrawText(hdc, szError, -1, &rc, DT_CENTER | DT_CALCRECT); rc = rc2; - rc2.top = (rc.bottom + rc.top - iTextHeight) / 2; + rc2.top+=bm.bmHeight+20; DrawText(hdc, szError, -1, &rc2, DT_CENTER); } diff --git a/clientscr/screensaver_win.h b/clientscr/screensaver_win.h index 9cb77b937b..bea548b1b4 100644 --- a/clientscr/screensaver_win.h +++ b/clientscr/screensaver_win.h @@ -183,6 +183,8 @@ protected: HANDLE m_hGraphicsApplication; BOOL m_bScreensaverStarted; BOOL m_bResetCoreState; + int m_iLastResultShown; + time_t m_tLastResultChangeTime; // diff --git a/win_build/installerv2/WCG.ism b/win_build/installerv2/WCG.ism index c4bfdd86eb..88e2df97c5 100644 Binary files a/win_build/installerv2/WCG.ism and b/win_build/installerv2/WCG.ism differ diff --git a/win_build/installerv2/redist/WCG/BOINCGUIApp.ico b/win_build/installerv2/redist/WCG/BOINCGUIApp.ico new file mode 100644 index 0000000000..b2683b6ad4 Binary files /dev/null and b/win_build/installerv2/redist/WCG/BOINCGUIApp.ico differ diff --git a/win_build/installerv2/redist/WCG/DeletesUnitedDevice.isd b/win_build/installerv2/redist/WCG/DeletesUnitedDevice.isd new file mode 100644 index 0000000000..ff5383551d Binary files /dev/null and b/win_build/installerv2/redist/WCG/DeletesUnitedDevice.isd differ diff --git a/win_build/installerv2/redist/WCG/account_www.worldcommunitygrid.org.xml b/win_build/installerv2/redist/WCG/account_www.worldcommunitygrid.org.xml new file mode 100644 index 0000000000..d9c4f10b5b --- /dev/null +++ b/win_build/installerv2/redist/WCG/account_www.worldcommunitygrid.org.xml @@ -0,0 +1,5 @@ + + http://www.worldcommunitygrid.org/ + + World Community Grid + diff --git a/win_build/installerv2/redist/WCG/cc_config.xml b/win_build/installerv2/redist/WCG/cc_config.xml new file mode 100644 index 0000000000..62a5c7bfeb --- /dev/null +++ b/win_build/installerv2/redist/WCG/cc_config.xml @@ -0,0 +1,7 @@ + + + + + 1 + + \ No newline at end of file diff --git a/win_build/installerv2/redist/WCG/scripts/Setup.rul b/win_build/installerv2/redist/WCG/scripts/Setup.rul new file mode 100644 index 0000000000..b454b7fe7f --- /dev/null +++ b/win_build/installerv2/redist/WCG/scripts/Setup.rul @@ -0,0 +1,152 @@ +// +// IIIIIII SSSSSS +// II SS InstallShield (R) +// II SSSSSS (c) 1996-2002, InstallShield Software Corporation +// II SS All rights reserved. +// IIIIIII SSSSSS +// +// +// This template script provides the code necessary to build an entry-point +// function to be called in an InstallScript custom action. +// Two major functions: +// CheckUnitedDevices: Check whether there is a previous World Community Agent ( United Devices) +// DeleteUnitedDevices: Delete United Devices +// +// +// File Name: Setup.rul +// +// Description: InstallShield script +// +//////////////////////////////////////////////////////////////////////////////// + + +// Include Ifx.h for built-in InstallScript function prototypes, for Windows +// Installer API function prototypes and constants, and to declare code for +// the OnBegin and OnEnd events. +#include "ifx.h" + +//including constants +#include "constants.rul" + +// Include header file for built-in functions +#include "isrt.h" +// Include header file for MSI API functions and constants +#include "iswi.h" + + + // The keyword export identifies the function as an entry-point function. + // The argument it accepts must be a handle to the Installer database. + export prototype DeleteUnitedDevices(HWND); + export prototype CheckUnitedDevices(HWND); + // To Do: Declare global variables, define constants, and prototype user- + // defined and DLL functions here. + + +// To Do: Create a custom action for this entry-point function: +// 1. Right-click on "Custom Actions" in the Sequences/Actions view. +// 2. Select "Custom Action Wizard" from the context menu. +// 3. Proceed through the wizard and give the custom action a unique name. +// 4. Select "Run InstallScript code" for the custom action type, and in +// the next panel select "DeleteUnitedDevices" (or the new name of the entry- +// point function) for the source. +// 5. Click Next, accepting the default selections until the wizard +// creates the custom action. +// +// Once you have made a custom action, you must execute it in your setup by +// inserting it into a sequence or making it the result of a dialog's +// control event. + +/////////////////////////////////////////////////////////////////////////////// +// +// Function: DeleteUnitedDevices +// +// Purpose: This function will be called by the script engine when +// Windows(TM) Installer executes your custom action (see the "To +// Do," above). +// This Script is used to delete United Devices +// +/////////////////////////////////////////////////////////////////////////////// +function DeleteUnitedDevices(hMSI) + // To Do: Declare local variables. + STRING svName; + NUMBER nvSize; + +begin + // MsiSetProperty(hMSI, "UDProcess", "NotDoneUD"); + RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE ); + + // Script that will be executed when DeleteUnitedDevices is called. + //////////////////////////////////////////////////////////////////////////////// + nvSize = 256; + +// if (RegDBKeyExist (WCG_UD_KEY) < 0) then +// MessageBox (NO_UD_MSG+"ininstallscriptsetup", SEVERE); +// else + + // LaunchApp(KILL_UD_PROCESS, KILL_UD_PROCESS_PARAM); + if (LaunchAppAndWait ("MsiExec.exe ", UD_UNINSTALL_PARAM,LAAW_OPTION_WAIT) < 0) then + MessageBox (UD_UNABLE_UNINSTALL_MSG, SEVERE); + else + MsiSetProperty(hMSI, "UDAVAILABLE", "No"); + endif; + +// endif; + + // MsiSetProperty(hMSI, "UDProcess", "DoneUD"); +// MsiGetProperty(hMSI, "UDProcess",svName, nvSize); +// MessageBox ("the value of the UDPRocess in checkud function is "+svName+" for testing", INFORMATION); + + +end; + + + +// To Do: Create a custom action for this entry-point function: +// 1. Right-click on "Custom Actions" in the Sequences/Actions view. +// 2. Select "Custom Action Wizard" from the context menu. +// 3. Proceed through the wizard and give the custom action a unique name. +// 4. Select "Run InstallScript code" for the custom action type, and in +// the next panel select "checkUnitedDevices" (or the new name of the entry- +// point function) for the source. +// 5. Click Next, accepting the default selections until the wizard +// creates the custom action. +// +// Once you have made a custom action, you must execute it in your setup by +// inserting it into a sequence or making it the result of a dialog's +// control event. + +/////////////////////////////////////////////////////////////////////////////// +// +// Function: CheckUnitedDevices +// +// Purpose: This function will be called by the script engine when +// Windows(TM) Installer executes your custom action (see the "To +// Do," above). +// This Script is used to check whether United Devices is present +// +////////////////////////////////////////////////////////////////////////////// +function CheckUnitedDevices(hMSI) + // To Do: Declare local variables. + STRING svName1; + NUMBER nvSize; + +begin + + RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE ); + nvSize = 256; + // Script that will be executed when CheckUnitedDevices is called. + //////////////////////////////////////////////////////////////////////////////// + MsiSetProperty(hMSI, "UDAVAILABLE", "dontknow"); + if (RegDBKeyExist (WCG_UD_KEY) < 0) then + // MessageBox (NO_UD_MSG, SEVERE); + MsiSetProperty(hMSI, "UDAVAILABLE", "No"); + else + MsiSetProperty(hMSI, "UDAVAILABLE", "Yes"); + endif; + MsiGetProperty(hMSI, "UDAVAILABLE",svName1, nvSize); + //MessageBox ("the value of the CheckedUD is "+svName1+" for testing", INFORMATION); + // MsiSetProperty(hMSI, "UDProcess", "DoneUD"); + // MsiGetProperty(hMSI, "UDProcess",svName1, nvSize); + // MessageBox ("the value of the UDPRocess in checkud function is "+svName1+" for testing", INFORMATION); +end; + \ No newline at end of file diff --git a/win_build/installerv2/redist/WCG/scripts/constants.rul b/win_build/installerv2/redist/WCG/scripts/constants.rul new file mode 100644 index 0000000000..6d9a3f9d70 --- /dev/null +++ b/win_build/installerv2/redist/WCG/scripts/constants.rul @@ -0,0 +1,17 @@ + + #define TITLE_TEXT "RegDBKeyExist" + #define NO_UD_MSG "cool UD Doesn't exist" + // #define UD_ASK_UNISTALL "There is Previous World Community Group Agent(United Devices) on your pc , it is highly recommended to delete it before installing the Latest BOINC Client, click on yes if you want to remove it" + #define UD_UNABLE_UNINSTALL_MSG "Unable to unistall UD" + + #define KILL_UD_PROCESS "taskkill" + #define KILL_UD_PROCESS_PARAM "/t /f /im UD.exe" + + #define WCG_UD_GID "{3CEA3FEC-1AF5-4818-89D5-406F627E7337}" + // The SUB KEY PATH OF UD SOFTWARE + #define WCG_UD_KEY_PATH "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + // The SUB KEY PATH INCLUDING THE GID OF UD SOFTWARE + #define WCG_UD_KEY WCG_UD_KEY_PATH+WCG_UD_GID + + //THE CMD LINE PARAM FOR UNINSTALLING UD + #define UD_UNINSTALL_PARAM "/quiet /X"+WCG_UD_GID \ No newline at end of file diff --git a/win_build/installerv2/redist/WCG/setup.ico b/win_build/installerv2/redist/WCG/setup.ico new file mode 100644 index 0000000000..b2683b6ad4 Binary files /dev/null and b/win_build/installerv2/redist/WCG/setup.ico differ