diff --git a/checkin_notes b/checkin_notes index 497d7fadb6..52d1e2423a 100755 --- a/checkin_notes +++ b/checkin_notes @@ -297,3 +297,8 @@ Bruce 11 Jan 2006 sched/ handle_request.C +Charlie 10 Jan 2006 + -Mac: Get BrandID from file put inside application bundle by installer. + + clientgui/ + BOINCGUIApp.cpp diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index bb792f5a7f..da8c96a192 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -57,10 +57,35 @@ bool CBrandingScheme::OnInit( wxConfigBase *pConfig ) { wxASSERT(pConfig); +#ifdef __WXMAC__ + wxChar buf[1024]; + ProcessSerialNumber ourPSN; + FSRef ourFSRef; + OSErr err; + + iBrandId = 0; // Default value + // Get the full path to core client inside this application's bundle + err = GetCurrentProcess (&ourPSN); + if (err == noErr) { + err = GetProcessBundleLocation(&ourPSN, &ourFSRef); + } + if (err == noErr) { + err = FSRefMakePath (&ourFSRef, (UInt8*)buf, sizeof(buf)); + } + if (err == noErr) { + strcat(buf, "/Contents/Resources/Branding"); + FILE *f = fopen(buf, "r"); + if (f) { + fscanf(f, "BrandId=%d\n", &iBrandId); + fclose(f); + } + } +#else strBaseConfigLocation = pConfig->GetPath(); pConfig->SetPath(strBaseConfigLocation + wxT("Branding")); pConfig->Read(wxT("BrandId"), &iBrandId, 0); pConfig->SetPath(strBaseConfigLocation); +#endif // If the BrandId is greater than 0 then we are running in // branded mode diff --git a/mac_build/boinc.xcodeproj/project.pbxproj b/mac_build/boinc.xcodeproj/project.pbxproj index 1ef54315ce..a0d138d0e3 100755 --- a/mac_build/boinc.xcodeproj/project.pbxproj +++ b/mac_build/boinc.xcodeproj/project.pbxproj @@ -864,7 +864,7 @@ DDB506F80958446900181B75 /* ProxyInfoPage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ProxyInfoPage.cpp; path = ../clientgui/ProxyInfoPage.cpp; sourceTree = SOURCE_ROOT; }; DDB506F90958446900181B75 /* ProxyInfoPage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ProxyInfoPage.h; path = ../clientgui/ProxyInfoPage.h; sourceTree = SOURCE_ROOT; }; DDB8D5A5081FC8C700A5A1E8 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.csh; name = postinstall; path = ../mac_installer/postinstall; sourceTree = SOURCE_ROOT; }; - DDD74D8707CF482E0065AC9D /* boinc */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = boinc; sourceTree = BUILT_PRODUCTS_DIR; }; + DDD74D8707CF482E0065AC9D /* boinc */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = boinc; sourceTree = BUILT_PRODUCTS_DIR; }; DDE2552B07C62F3E008E7D6E /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; DDEF388E0802B73500E87552 /* ViewStatistics.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ViewStatistics.cpp; path = ../clientgui/ViewStatistics.cpp; sourceTree = SOURCE_ROOT; }; DDEF388F0802B73500E87552 /* ViewStatistics.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ViewStatistics.h; path = ../clientgui/ViewStatistics.h; sourceTree = SOURCE_ROOT; };