diff --git a/clientgui/AdvancedFrame.cpp b/clientgui/AdvancedFrame.cpp index 190b2f572b..984dab146f 100644 --- a/clientgui/AdvancedFrame.cpp +++ b/clientgui/AdvancedFrame.cpp @@ -1709,17 +1709,32 @@ void CAdvancedFrame::OnConnect(CFrameEvent& WXUNUSED(event)) { pWizard = new CWizardAttach(this); if (pWizard->SyncToAccountManager()) { + // _GRIDREPUBLIC, _PROGRESSTHRUPROCESSORS and _CHARITYENGINE + // are defined for those branded builds on Windows only +#if defined(_GRIDREPUBLIC) || defined(_PROGRESSTHRUPROCESSORS) || defined(_CHARITYENGINE) || defined(__WXMAC__) +#ifdef __WXMAC__ + // For GridRepublic, Charity Engine or ProgressThruProcessors, + // the Mac installer put a branding file in our data directory + long iBrandID = 0; // 0 is unbranded (default) BOINC -#if defined(__WXMSW__) || defined(__WXMAC__) - // If successful, hide the main window if we showed it - if (!wasVisible) { - wxGetApp().ShowApplication(false); - } -#ifndef __WXMAC__ // See explanation in ShowApplication() - if (!wasShown) { - Hide(); + FILE *f = boinc_fopen("/Library/Application Support/BOINC Data/Branding", "r"); + if (f) { + fscanf(f, "BrandId=%ld\n", &iBrandID); + fclose(f); } + if ((iBrandID > 0) && (iBrandID < 4)) #endif + { + // If successful, hide the main window if we showed it + if (!wasVisible) { + wxGetApp().ShowApplication(false); + } +#ifndef __WXMAC__ // See explanation in ShowApplication() + if (!wasShown) { + Hide(); + } +#endif + } #endif // %s is the application name diff --git a/clientgui/sg_BoincSimpleFrame.cpp b/clientgui/sg_BoincSimpleFrame.cpp index 0ea6e46e31..5815c5d959 100755 --- a/clientgui/sg_BoincSimpleFrame.cpp +++ b/clientgui/sg_BoincSimpleFrame.cpp @@ -665,13 +665,31 @@ void CSimpleFrame::OnConnect(CFrameEvent& WXUNUSED(event)) { pWizard = new CWizardAttach(this); if (pWizard->SyncToAccountManager()) { - // If successful, hide the main window if we showed it - if (!wasVisible) { - wxGetApp().ShowApplication(false); + // _GRIDREPUBLIC, _PROGRESSTHRUPROCESSORS and _CHARITYENGINE + // are defined for those branded builds on Windows only +#if defined(_GRIDREPUBLIC) || defined(_PROGRESSTHRUPROCESSORS) || defined(_CHARITYENGINE) || defined(__WXMAC__) +#ifdef __WXMAC__ + // For GridRepublic, Charity Engine or ProgressThruProcessors, + // the Mac installer put a branding file in our data directory + long iBrandID = 0; // 0 is unbranded (default) BOINC + + FILE *f = boinc_fopen("/Library/Application Support/BOINC Data/Branding", "r"); + if (f) { + fscanf(f, "BrandId=%ld\n", &iBrandID); + fclose(f); } + if ((iBrandID > 0) && (iBrandID < 4)) +#endif + { + // If successful, hide the main window if we showed it + if (!wasVisible) { + wxGetApp().ShowApplication(false); + } #ifndef __WXMAC__ // See explanation in ShowApplication() - if (!wasShown) { - Hide(); + if (!wasShown) { + Hide(); + } +#endif } #endif }