diff --git a/clientgui/BOINCBaseFrame.cpp b/clientgui/BOINCBaseFrame.cpp
index 66523f4d81..45db23e9e4 100644
--- a/clientgui/BOINCBaseFrame.cpp
+++ b/clientgui/BOINCBaseFrame.cpp
@@ -556,6 +556,10 @@ void CBOINCBaseFrame::ShowConnectionFailedAlert() {
return;
}
}
+ } else {
+ // Don't ask whether to reconnect to remote client
+ pDoc->Reconnect();
+ return;
}
// %s is the application name
diff --git a/clientgui/BOINCTaskBar.cpp b/clientgui/BOINCTaskBar.cpp
index df045d0454..255766c61b 100644
--- a/clientgui/BOINCTaskBar.cpp
+++ b/clientgui/BOINCTaskBar.cpp
@@ -87,9 +87,24 @@ CTaskBarIcon::CTaskBarIcon(wxString title, wxIconBundle* icon, wxIconBundle* ico
wxTaskBarIconEx(wxT("BOINCManagerSystray"), 1)
#endif
{
- m_iconTaskBarNormal = icon->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);
- m_iconTaskBarDisconnected = iconDisconnected->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);
- m_iconTaskBarSnooze = iconSnooze->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);
+#ifdef __WXMAC__
+ m_iconType = iconType;
+ m_pNotificationRequest = NULL;
+ if (iconType == wxTBI_DOCK) {
+ // This code expects the wxTBI_CUSTOM_STATUSITEM CTaskBarIcon
+ // to be constructed before the wxTBI_DOCK CTaskBarIcon.
+ //
+ // Ensure that m_pTaskBarIcon and m_pMacDockIcon use same copy of each icon.
+ m_iconTaskBarNormal = wxGetApp().GetTaskBarIcon()->m_iconTaskBarNormal;
+ m_iconTaskBarDisconnected = wxGetApp().GetTaskBarIcon()->m_iconTaskBarDisconnected;
+ m_iconTaskBarSnooze = wxGetApp().GetTaskBarIcon()->m_iconTaskBarSnooze;
+ } else
+#endif
+ {
+ m_iconTaskBarNormal = icon->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);
+ m_iconTaskBarDisconnected = iconDisconnected->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);
+ m_iconTaskBarSnooze = iconSnooze->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);
+ }
m_SnoozeGPUMenuItem = NULL;
m_bTaskbarInitiatedShutdown = false;
@@ -98,10 +113,6 @@ CTaskBarIcon::CTaskBarIcon(wxString title, wxIconBundle* icon, wxIconBundle* ico
m_dtLastNotificationAlertExecuted = wxDateTime((time_t)0);
m_iLastNotificationUnreadMessageCount = 0;
-#ifdef __WXMAC__
- m_iconType = iconType;
- m_pNotificationRequest = NULL;
-#endif
}
@@ -348,6 +359,13 @@ void CTaskBarIcon::OnReloadSkin(CTaskbarEvent& WXUNUSED(event)) {
m_iconTaskBarNormal = pSkinAdvanced->GetApplicationIcon()->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);
m_iconTaskBarDisconnected = pSkinAdvanced->GetApplicationDisconnectedIcon()->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);
m_iconTaskBarSnooze = pSkinAdvanced->GetApplicationSnoozeIcon()->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);
+
+#ifdef __WXMAC__
+ // Ensure that m_pTaskBarIcon and m_pMacDockIcon use same copy of each icon.
+ wxGetApp().GetMacDockIcon()->m_iconTaskBarNormal = m_iconTaskBarNormal;
+ wxGetApp().GetMacDockIcon()->m_iconTaskBarDisconnected = m_iconTaskBarDisconnected;
+ wxGetApp().GetMacDockIcon()->m_iconTaskBarSnooze = m_iconTaskBarSnooze;
+#endif
}
diff --git a/clientgui/DlgAbout.cpp b/clientgui/DlgAbout.cpp
index 5ce22b3053..a711077a46 100644
--- a/clientgui/DlgAbout.cpp
+++ b/clientgui/DlgAbout.cpp
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// http://boinc.berkeley.edu
-// Copyright (C) 2017 University of California
+// Copyright (C) 2018 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
@@ -121,15 +121,14 @@ bool CDlgAbout::Create(wxWindow* parent, wxWindowID id, const wxString& caption,
);
m_AboutBOINCTitleCtrl->SetLabel(buf);
-#if 0
m_AboutBOINCLogoCtrl->SetBitmap(wxBitmap(*(pSkinAdvanced->GetApplicationLogo())));
- m_AboutBOINCSloganCtrl->SetLabel(wxEmptyString);
-
m_AboutBOINCURLCtrl->SetLabel(
pSkinAdvanced->GetOrganizationWebsite().c_str()
);
-#endif
+ m_AboutBOINCURLCtrl->SetURL(
+ pSkinAdvanced->GetOrganizationWebsite().c_str()
+ );
GetSizer()->Fit(this);
GetSizer()->SetSizeHints(this);
@@ -144,6 +143,10 @@ bool CDlgAbout::Create(wxWindow* parent, wxWindowID id, const wxString& caption,
void CDlgAbout::CreateControls() {
////@begin CDlgAbout content construction
+ CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
+ wxASSERT(pSkinAdvanced);
+ wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced));
+
CDlgAbout* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
@@ -192,8 +195,14 @@ void CDlgAbout::CreateControls() {
itemStaticText13->Create( itemDialog1, wxID_STATIC, _("(C) 2003-2018 University of California, Berkeley.\nAll Rights Reserved."), wxDefaultPosition, wxDefaultSize, 0 );
itemFlexGridSizer7->Add(itemStaticText13, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
+ wxString buf = wxEmptyString;
+ buf.Printf(
+ _("%s is distributed under the GNU Lesser General Public License v3.0."),
+ pSkinAdvanced->GetApplicationShortName().c_str()
+ );
+
wxStaticText* itemStaticText14 = new wxStaticText;
- itemStaticText14->Create( itemDialog1, wxID_STATIC, _("BOINC is distributed under the GNU Lesser General Public License v3.0."), wxDefaultPosition, wxDefaultSize, 0 );
+ itemStaticText14->Create( itemDialog1, wxID_STATIC, buf, wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer2->Add(itemStaticText14, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
diff --git a/clientgui/DlgAdvPreferences.cpp b/clientgui/DlgAdvPreferences.cpp
index 83ee5074b8..650e7590ff 100644
--- a/clientgui/DlgAdvPreferences.cpp
+++ b/clientgui/DlgAdvPreferences.cpp
@@ -1006,33 +1006,17 @@ bool CDlgAdvPreferences::IsValidFloatValueBetween(const wxString& value, double
/* checks if the value is a valid time */
bool CDlgAdvPreferences::IsValidTimeValue(const wxString& value) {
- for(unsigned int i=0; i < value.Length();i++) {
- if(!IsValidTimeChar(value[i])) {
+ for (unsigned int i = 0; i < value.Length(); i++) {
+ if (!IsValidTimeChar(value[i])) {
return false;
}
}
- //verify correct format and range of time values
- int h = -1, m = -1;
- //verify the format itself
- int parsed = sscanf(value.c_str(), "%d:%d", &h, &m);
- if (parsed != 2) {
- return false;
- }
- //verify hours
- if (h < 0 || h > 23) {
- return false;
- }
- //verify minutes
- if (m < 0 || m > 59) {
- return false;
- }
//all chars are valid, now what is with the value as a whole ?
+ if (value == wxT("24:00")) return true;
wxDateTime dt;
- const wxChar* stopChar = dt.ParseFormat(value,wxT("%H:%M"));
- if(stopChar==NULL && value != wxT("24:00")) {
- // conversion failed
- return false;
- }
+ const wxChar* stopChar = dt.ParseFormat(value, wxT("%H:%M"));
+ if (stopChar == NULL) return false; // conversion failed
+ if (*stopChar != '\0') return false; // conversion failed
return true;
}
diff --git a/clientgui/SkinManager.cpp b/clientgui/SkinManager.cpp
index e75e45a588..4fca4577e5 100644
--- a/clientgui/SkinManager.cpp
+++ b/clientgui/SkinManager.cpp
@@ -756,6 +756,7 @@ CSkinWizardATAM::~CSkinWizardATAM() {
void CSkinWizardATAM::Clear() {
+ m_strTitle = wxEmptyString;
m_strAccountInfoMessage = wxEmptyString;
}
@@ -770,6 +771,10 @@ int CSkinWizardATAM::Parse(MIOFILE& in) {
m_strAccountInfoMessage = wxString(strBuffer.c_str(), wxConvUTF8);
continue;
}
+ else if (parse_str(buf, "
", strBuffer)) {
+ m_strTitle = wxString(strBuffer.c_str(), wxConvUTF8);
+ continue;
+ }
}
InitializeDelayedValidation();
diff --git a/clientgui/SkinManager.h b/clientgui/SkinManager.h
index 905d0e091f..5ad6b9fb5a 100644
--- a/clientgui/SkinManager.h
+++ b/clientgui/SkinManager.h
@@ -254,8 +254,11 @@ public:
wxString GetAccountInfoMessage() { return m_strAccountInfoMessage; }
+ wxString GetWizardTitle() { return m_strTitle; }
+
private:
wxString m_strAccountInfoMessage;
+ wxString m_strTitle;
};
diff --git a/clientgui/WizardAttach.cpp b/clientgui/WizardAttach.cpp
index 4fb999fa10..9b9d28268d 100644
--- a/clientgui/WizardAttach.cpp
+++ b/clientgui/WizardAttach.cpp
@@ -309,11 +309,26 @@ bool CWizardAttach::SyncToAccountManager() {
ACCT_MGR_INFO ami;
CMainDocument* pDoc = wxGetApp().GetDocument();
- wxASSERT(pDoc);
- wxASSERT(wxDynamicCast(pDoc, CMainDocument));
+ CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
+ CSkinWizardATAM* pSkinWizardATAM = wxGetApp().GetSkinManager()->GetWizards()->GetWizardATAM();
+ wxASSERT(pDoc);
+ wxASSERT(wxDynamicCast(pDoc, CMainDocument));
+ wxASSERT(pSkinAdvanced);
+ wxASSERT(pSkinWizardATAM);
+ wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced));
+ wxASSERT(wxDynamicCast(pSkinWizardATAM, CSkinWizardATAM));
+
+
+ if (!pSkinWizardATAM->GetWizardTitle().IsEmpty()) {
+ SetTitle(pSkinWizardATAM->GetWizardTitle());
+ } else {
+ SetTitle(pSkinAdvanced->GetApplicationName());
+ }
+
IsAttachToProjectWizard = false;
IsAccountManagerWizard = true;
+
pDoc->rpc.acct_mgr_info(ami);
diff --git a/clientgui/res/WCGrid.icns b/clientgui/res/WCGrid.icns
new file mode 100644
index 0000000000..a3f2e346a8
Binary files /dev/null and b/clientgui/res/WCGrid.icns differ
diff --git a/clientgui/skins/World Community Grid/skin.xml b/clientgui/skins/World Community Grid/skin.xml
index 2d4234df01..e9878af393 100644
--- a/clientgui/skins/World Community Grid/skin.xml
+++ b/clientgui/skins/World Community Grid/skin.xml
@@ -27,11 +27,44 @@
0:100:157
- World Community Grid - BOINC Manager
+ World Community Grid
World Community Grid
World Community Grid
https://www.worldcommunitygrid.org
https://www.worldcommunitygrid.org/boinc.do
+ wcg_about.ico
+
+
+ wcg_play.png
+
+
+
+
+
+ wcg_32.png
+
+
+
+
+
+ wcg_stop.png
+
+
+
+
+
+ wcg_pause.png
+
+
+ 1
+
+
+ World Community Grid - Add Project
+
+
+ World Community Grid - Use Account Manager
+
+
diff --git a/clientgui/skins/World Community Grid/wcg_about.ico b/clientgui/skins/World Community Grid/wcg_about.ico
new file mode 100644
index 0000000000..4a78a950fd
Binary files /dev/null and b/clientgui/skins/World Community Grid/wcg_about.ico differ
diff --git a/html/inc/host.inc b/html/inc/host.inc
index de0133e592..a9701fd73c 100644
--- a/html/inc/host.inc
+++ b/html/inc/host.inc
@@ -122,6 +122,7 @@ function show_host($host, $user, $ipprivate) {
if ($host->serialnum) {
row2(tra("Coprocessors"), gpu_desc($host->serialnum));
}
+ row2(tra("Virtualization"), vbox_desc($host->serialnum));
row2(tra("Operating System"), "$host->os_name
$host->os_version");
$v = boinc_version($host->serialnum);
if ($v) {
@@ -250,6 +251,32 @@ function host_nresults($host) {
return BoincResult::count("hostid=$host->id");
}
+
+// Parse the Virtualbox version information from inside the serialnum field.
+// Prior to BOINC commit 6121ce1, the DB entry looked like e.g. "[vbox|5.0.0]"
+// where 5.0.0 gave the Virtualbox version number. After 6121ce1, the entry was
+// "[vbox|5.0.0|1|1]", where now two additional flags give information about
+// hardware virtualization support. Older clients may have the old-style
+// serialnum in the DB despite the server being upgraded.
+function vbox_desc($x){
+ if (preg_match("/\[vbox\|(.*?)(\|([01])\|([01]))?\]/",$x,$matches)){
+ $desc = "Virtualbox (".$matches[1].") ".tra("installed");
+ if (sizeof($matches)>2){
+ if ($matches[3]=="1" and $matches[4]=="1") {
+ return $desc.tra(", CPU has hardware virtualization support and it is enabled");
+ } elseif ($matches[3]=="1" and $matches[4]=="0") {
+ return $desc.tra(", CPU has hardware virtualization support but it is disabled");
+ } elseif ($matches[3]=="0") {
+ return $desc.tra(", CPU does not have hardware virtualization support");
+ }
+ } else {
+ return $desc;
+ }
+ } else {
+ return tra("None");
+ }
+}
+
// Given string of the form [BOINC|vers][type|model|count|RAM|driver-vers][vbox|vers],
// return a human-readable version of the GPU info
//
diff --git a/lib/procinfo_mac.cpp b/lib/procinfo_mac.cpp
index 5c7c9bc359..6c68aa1045 100644
--- a/lib/procinfo_mac.cpp
+++ b/lib/procinfo_mac.cpp
@@ -41,6 +41,7 @@ using std::vector;
#define GRIDREPUBLIC_BRAND_ID 1
#define PROGRESSTHRUPROCESSORS_BRAND_ID 2
#define CHARITYENGINE_BRAND_ID 3
+#define WORLDCOMMUNITYGRID_BRAND_ID 4
// build table of all processes in system
@@ -164,6 +165,11 @@ int procinfo_setup(PROC_MAP& pm) {
p.is_boinc_app = true;
}
break;
+ case WORLDCOMMUNITYGRID_BRAND_ID:
+ if (!strcasestr(p.command, "World Community Grid")) {
+ p.is_boinc_app = true;
+ }
+ break;
}
pm.insert(std::pair(p.id, p));
}
diff --git a/lib/win_util.cpp b/lib/win_util.cpp
index 28253c55df..33d02a1193 100644
--- a/lib/win_util.cpp
+++ b/lib/win_util.cpp
@@ -125,7 +125,7 @@ std::wstring boinc_ascii_to_wide(const std::string& str) {
int length_wide = MultiByteToWideChar(CP_ACP, 0, str.data(), -1, NULL, 0);
wchar_t *string_wide = static_cast(_alloca((length_wide * sizeof(wchar_t)) + sizeof(wchar_t)));
MultiByteToWideChar(CP_ACP, 0, str.data(), -1, string_wide, length_wide);
- std::wstring result(string_wide, length_wide);
+ std::wstring result(string_wide, length_wide - 1);
return result;
}
@@ -133,7 +133,7 @@ std::string boinc_wide_to_ascii(const std::wstring& str) {
int length_ansi = WideCharToMultiByte(CP_UTF8, 0, str.data(), -1, NULL, 0, NULL, NULL);
char* string_ansi = static_cast(_alloca(length_ansi + sizeof(char)));
WideCharToMultiByte(CP_UTF8, 0, str.data(), -1, string_ansi, length_ansi, NULL, NULL);
- std::string result(string_ansi, length_ansi);
+ std::string result(string_ansi, length_ansi - 1);
return result;
}
diff --git a/mac_installer/WCGridInstaller.environment b/mac_installer/WCGridInstaller.environment
new file mode 100644
index 0000000000..5820fea45d
--- /dev/null
+++ b/mac_installer/WCGridInstaller.environment
@@ -0,0 +1,21 @@
+SHORTBRANDNAME="wcgrid"
+LONGBRANDNAME="World Community Grid"
+
+MANAGERAPPNAME="World Community Grid"
+MANAGERICON="WCGrid"
+
+SSAVERAPPNAME="World Community Grid"
+SSAVERPREVIEW="wcgrid.jpg"
+SSAVERTHUMBNAIL="wcgrid-thumbnail"
+SSAVERLOGO="wcg_ss_logo.jpg"
+SKINDIR="World Community Grid"
+
+UNINSTALLERAPPNAME="Uninstall World Community Grid"
+UNINSTALLERICON="WCGrid"
+UNINSTALLERTRASHICON="WCGrid"
+
+INSTALLERAPPNAME="World Community Grid Installer"
+INSTALLERICON="WCGrid"
+
+READMEFILE="WCGrid-ReadMe.rtf"
+BRANDING_INFO="BrandId=4"
diff --git a/mac_installer/release_brand.sh b/mac_installer/release_brand.sh
new file mode 100755
index 0000000000..189bb38941
--- /dev/null
+++ b/mac_installer/release_brand.sh
@@ -0,0 +1,406 @@
+#!/bin/bash
+
+# This file is part of BOINC.
+# http://boinc.berkeley.edu
+# Copyright (C) 2018 University of California
+#
+# BOINC is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation,
+# either version 3 of the License, or (at your option) any later version.
+#
+# BOINC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with BOINC. If not, see .
+
+##
+# Script to create a branded installer such as World Community Grid
+#
+## Note 1: This script currently does not have support for "BOINC+VirtualBox.mpkg"
+## and "BOINC + VirtualBox.mpkg"
+##
+
+## Usage:
+## First a brand description file must be created for the desired brand with the variable below defined
+## SHORTBRANDNAME="wcgrid" ##Used to name the branded files and directories in the BOINC_Installer directory
+## LONGBRANDNAME="World Community Grid" ##Used to name the installer package
+## MANAGERAPPNAME="World Community Grid" ##The name of the branded manager, replaces BOINC Manager
+## MANAGERICON="WCGridMgr" ##The icon for the branded manager, replaces BOINCMgr.icns
+## SSAVERAPPNAME="World Community Grid" ##The branded screen saver name
+## SSAVERPREVIEW="wcgrid.jpg" ##The image used as the preview for the screen saver in system preferences
+## SSAVERTHUMBNAIL="wcgrid-thumbnail" ##The image used as the thumbnail for the screen saver in system preferences
+## SSAVERLOGO="wcg_ss_logo.jpg" ##The image used in the generic screen saver
+## SKINDIR="World Community Grid" ##The branded skin name to use
+## UNINSTALLERAPPNAME="Uninstall World Community Grid" ##The name of the uninstaller app
+## UNINSTALLERICON="WCGridUninstaller.icns" ##The icon for the branded uninstaller
+## UNINSTALLERTRASHICON="WCGridUninstaller.icns" ##The icon for uninstaller PutInTrash
+## INSTALLERAPPNAME="World Community Grid Installer" ##The name of the installer app
+## INSTALLERICON="WCGridInstaller.icns" ##The icon for the branded installer
+## READMEFILE="WCGrid-ReadMe.rtf" ##The branded readme file
+## BRANDING_INFO="BrandId=4" ##Info to write into the branding file
+##
+## NOTE: This script requires Mac OS 10.6 or later, and uses XCode developer
+## tools. So you must have installed XCode Developer Tools on the Mac
+## before running this script.
+##
+## If you wish to code sign the installer and uninstaller, create a file
+## ~/BOINCCodeSignIdentity.txt whose first line is the code signing identity
+##
+## cd to the root directory of the boinc tree, for example:
+## cd /boinc
+##
+## Then invoke this script with the three parts of version number as arguments and the full path
+## to the brand description file. For example, if the version is 3.2.1:
+## source ./mac_installer/release_brand.sh 3 2 1 ./mac_installer/WCGridInstaller.environment
+##
+## This will create a directory "BOINC_Installer" in the parent directory of
+## the current directory
+##
+## For testing only, you can use the development build by adding a fifth argument -dev
+## For example, if the version is 3.2.1:
+## source /mac_installer/release_brand.sh 3 2 1 ./mac_installer/WCGridInstaller.environment -dev
+
+if [ $# -lt 4 ]; then
+echo "Usage:"
+echo " cd /boinc"
+echo " source path_to_this_script major_version minor_version revision_number brand_description_file [-dev]"
+echo "example:"
+echo " source ./mac_installer/release_brand.sh 7 11 0 ./mac_installer/WCGridInstaller.environment"
+return 1
+fi
+
+#source brand description file
+if [ ! -f ${4} ]; then
+ echo Brand description file ${4} not found
+ return 1
+fi
+. ${4}
+
+BOINCPath=$PWD
+
+DarwinVersion=`uname -r`;
+DarwinMajorVersion=`echo $DarwinVersion | sed 's/\([0-9]*\)[.].*/\1/' `;
+# DarwinMinorVersion=`echo $version | sed 's/[0-9]*[.]\([0-9]*\).*/\1/' `;
+#
+# echo "major = $DarwinMajorVersion"
+# echo "minor = $DarwinMinorVersion"
+#
+# Darwin version 11.x.y corresponds to OS 10.7.x
+# Darwin version 10.x.y corresponds to OS 10.6.x
+# Darwin version 8.x.y corresponds to OS 10.4.x
+# Darwin version 7.x.y corresponds to OS 10.3.x
+# Darwin version 6.x corresponds to OS 10.2.x
+
+if [ "$DarwinMajorVersion" -gt 10 ]; then
+ # XCode 4.1 on OS 10.7 builds only Intel binaries
+ arch="x86_64"
+
+ # XCode 3.x and 4.x use different paths for their build products.
+ # Our scripts in XCode's script build phase write those paths to
+ # files to help this release script find the build products.
+ if [ "$5" = "-dev" ]; then
+ exec 7<"mac_build/Build_Development_Dir"
+ read -u 7 BUILDPATH
+ else
+ exec 7<"mac_build/Build_Deployment_Dir"
+ read -u 7 BUILDPATH
+ fi
+
+else
+ # XCode 3.2 on OS 10.6 does build Intel and PowerPC Universal binaries
+ arch="universal"
+
+ # XCode 3.x and 4.x use different paths for their build products.
+ if [ "$5" = "-dev" ]; then
+ if [ -d mac_build/build/Development/ ]; then
+ BUILDPATH="mac_build/build/Development"
+ else
+ BUILDPATH="mac_build/build"
+ fi
+ else
+ if [ -d mac_build/build/Deployment/ ]; then
+ BUILDPATH="mac_build/build/Deployment"
+ else
+ BUILDPATH="mac_build/build"
+ fi
+ fi
+fi
+
+sudo rm -dfR ../BOINC_Installer/Installer\ Resources/
+sudo rm -dfR ../BOINC_Installer/Installer\ Scripts/
+sudo rm -dfR ../BOINC_Installer/Pkg_Root
+sudo rm -dfR ../BOINC_Installer/locale
+sudo rm -dfR ../BOINC_Installer/Installer\ templates
+sudo rm -dfR ../BOINC_Installer/expandedVBox
+
+mkdir -p ../BOINC_Installer/Installer\ Resources/
+mkdir -p ../BOINC_Installer/Installer\ Scripts/
+mkdir -p ../BOINC_Installer/Installer\ templates
+
+cp -fp mac_installer/License.rtf ../BOINC_Installer/Installer\ Resources/
+cp -fp mac_installer/${READMEFILE} ../BOINC_Installer/Installer\ Resources/ReadMe.rtf
+
+cp -fp mac_installer/complist.plist ../BOINC_Installer/Installer\ templates/complist.plist
+sed -i "" s/BOINCManager.app/"${MANAGERAPPNAME}.app"/g ../BOINC_Installer/Installer\ templates/complist.plist
+sed -i "" s/BOINCSaver.saver/"${SSAVERAPPNAME}.saver"/g ../BOINC_Installer/Installer\ templates/complist.plist
+
+
+cp -fp mac_installer/myDistribution ../BOINC_Installer/Installer\ templates/myDistribution
+sed -i "" s/BOINCManager.app/"${MANAGERAPPNAME}.app"/g ../BOINC_Installer/Installer\ templates/myDistribution
+sed -i "" s/BOINCSaver.saver/"${SSAVERAPPNAME}.saver"/g ../BOINC_Installer/Installer\ templates/myDistribution
+sed -i "" s/"BOINC Manager"/"${MANAGERAPPNAME}"/g ../BOINC_Installer/Installer\ templates/myDistribution
+
+
+# Update version number
+sed -i "" s/""/"$1.$2.$3"/g ../BOINC_Installer/Installer\ Resources/ReadMe.rtf
+sed -i "" s/"x.y.z"/"$1.$2.$3"/g ../BOINC_Installer/Installer\ templates/myDistribution
+
+#### We don't customize BOINC Data directory name for branding
+cp -fp mac_installer/preinstall ../BOINC_Installer/Installer\ Scripts/
+cp -fp mac_installer/preinstall ../BOINC_Installer/Installer\ Scripts/preupgrade
+cp -fp mac_installer/postinstall ../BOINC_Installer/Installer\ Scripts/
+cp -fp mac_installer/postupgrade ../BOINC_Installer/Installer\ Scripts/
+mkdir -p ../BOINC_Installer/Pkg_Root
+mkdir -p ../BOINC_Installer/Pkg_Root/Applications
+mkdir -p ../BOINC_Installer/Pkg_Root/Library
+mkdir -p ../BOINC_Installer/Pkg_Root/Library/Screen\ Savers
+mkdir -p ../BOINC_Installer/Pkg_Root/Library/Application\ Support
+mkdir -p ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data
+mkdir -p ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/locale
+mkdir -p ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/switcher
+mkdir -p ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/skins
+
+# We must create virtualbox directory so installer will set up its
+# ownership and permissions correctly, because vboxwrapper won't
+# have permission to set owner to boinc_master.
+#mkdir -p ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/projects/virtualbox
+
+cp -fpRL "${BUILDPATH}/switcher" ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/switcher/
+cp -fpRL "${BUILDPATH}/setprojectgrp" ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/switcher/
+
+cd "${BOINCPath}/clientgui/skins"
+cp -fpRL Default ../../../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/skins/
+cp -fpRL "${SKINDIR}" ../../../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/skins/
+cd "${BOINCPath}"
+
+cp -fp curl/ca-bundle.crt ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/
+
+cp -fp win_build/installerv2/redist/all_projects_list.xml ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/installer_projects_list.xml
+
+cp -fp clientscr/res/boinc_logo_black.jpg ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/
+cp -fp api/ttf/liberation-fonts-ttf-2.00.0/LiberationSans-Regular.ttf ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/LiberationSans-Regular.ttf
+cp -fp clientscr/ss_config.xml ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/
+cp -fpRL "${BUILDPATH}/boincscr" ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/
+
+cp -fpRL "${BUILDPATH}/BOINCManager.app/." "../BOINC_Installer/Pkg_Root/Applications/${MANAGERAPPNAME}.app/"
+sed -i "" s/BOINCManager/"${MANAGERAPPNAME}"/g "../BOINC_Installer/Pkg_Root/Applications/${MANAGERAPPNAME}.app/Contents/Info.plist"
+sed -i "" s/BOINCMgr/"${MANAGERICON}"/g "../BOINC_Installer/Pkg_Root/Applications/${MANAGERAPPNAME}.app/Contents/Info.plist"
+mv "../BOINC_Installer/Pkg_Root/Applications/${MANAGERAPPNAME}.app/Contents/MacOS/BOINCManager" "../BOINC_Installer/Pkg_Root/Applications/${MANAGERAPPNAME}.app/Contents/MacOS/${MANAGERAPPNAME}"
+cp -fpRL clientgui/res/${MANAGERICON}.icns "../BOINC_Installer/Pkg_Root/Applications/${MANAGERAPPNAME}.app/Contents/Resources/"
+rm -rf "../BOINC_Installer/Pkg_Root/Applications/${MANAGERAPPNAME}.app/Contents/Resources/BOINCMgr.icns"
+sed -i "" s/"BOINC Manager"/"${MANAGERAPPNAME}"/g "../BOINC_Installer/Pkg_Root/Applications/${MANAGERAPPNAME}.app/Contents/Resources/English.lproj/InfoPlist.strings"
+
+echo ${BRANDING_INFO} > "../BOINC_Installer/Pkg_Root/Applications/${MANAGERAPPNAME}.app/Contents/Resources/Branding"
+echo ${BRANDING_INFO} > ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/Branding
+
+
+
+## OS 10.6 and OS10.7 require screensavers built with Garbage Collection, but Xcode 5.0.2
+## was the last version of Xcode which supported building with Garbage Collection, so we
+## have saved the screensaver executable with GC as a binary. Add it to the screen saver
+## passed to the BOINC installer. At install time, he BOINC installer will select the
+## correct binary for the version of OS X and delete the other one. This scripy assumes
+## that $BUILDPATH/BOINCSaver.saver was built to use Automatic Reference Counting (ARC)
+## and not built to use GC.
+
+cp -fpRL "${BUILDPATH}/BOINCSaver.saver/." "../BOINC_Installer/Pkg_Root/Library/Screen Savers/${SSAVERAPPNAME}.saver/"
+ditto -xk ./clientscr/BOINCSaver_MacOS10_6_7.zip "../BOINC_Installer/Pkg_Root/Library/Screen Savers/${SSAVERAPPNAME}.saver/Contents/MacOS"
+mv "../BOINC_Installer/Pkg_Root/Library/Screen Savers/${SSAVERAPPNAME}.saver/Contents/MacOS/BOINCSaver" "../BOINC_Installer/Pkg_Root/Library/Screen Savers/${SSAVERAPPNAME}.saver/Contents/MacOS/${SSAVERAPPNAME}"
+
+sed -i "" s/BOINCSaver/"${SSAVERAPPNAME}"/g "../BOINC_Installer/Pkg_Root/Library/Screen Savers/${SSAVERAPPNAME}.saver/Contents/Info.plist"
+cp -fpRL clientscr/res/${SSAVERPREVIEW} "../BOINC_Installer/Pkg_Root/Library/Screen Savers/${SSAVERAPPNAME}.saver/Contents/Resources/boinc.jpg"
+cp -fpRL clientscr/res/${SSAVERTHUMBNAIL}.png "../BOINC_Installer/Pkg_Root/Library/Screen Savers/${SSAVERAPPNAME}.saver/Contents/Resources/thumbnail.png"
+cp -fpRL clientscr/res/${SSAVERTHUMBNAIL}\@2x.png "../BOINC_Installer/Pkg_Root/Library/Screen Savers/${SSAVERAPPNAME}.saver/Contents/Resources/thumbnail@2x.png"
+cp -fpRL clientscr/res/${SSAVERLOGO} "../BOINC_Installer/Pkg_Root/Library/Screen Savers/${SSAVERAPPNAME}.saver/Contents/Resources/boinc_ss_logo.png"
+cp -fpRL clientscr/res/${SSAVERLOGO} ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/
+sed -i "" s/BOINC/"${SSAVERAPPNAME}"/g "../BOINC_Installer/Pkg_Root/Library/Screen Savers/${SSAVERAPPNAME}.saver/Contents/Resources/English.lproj/InfoPlist.strings"
+
+
+## Copy the localization files into the installer tree
+## Old way copies CVS and *.po files which are not needed
+## cp -fpRL locale/ ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/locale
+## sudo rm -dfR ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/locale/CVS
+## New way copies only *.mo files (adapted from boinc/sea/make-tar.sh)
+find locale -name '*.mo' | cut -d '/' -f 2 | awk '{print "\"../BOINC_Installer/Pkg_Root/Library/Application Support/BOINC Data/locale/"$0"\""}' | xargs mkdir -p
+find locale -name '*.mo' | cut -d '/' -f 2,3 | awk '{print "cp \"locale/"$0"\" \"../BOINC_Installer/Pkg_Root/Library/Application Support/BOINC Data/locale/"$0"\""}' | bash
+
+## Fix up ownership and permissions
+sudo chown -R root:admin ../BOINC_Installer/Pkg_Root/*
+sudo chmod -R u+rw,g+rw,o+r-w ../BOINC_Installer/Pkg_Root/*
+sudo chmod 1775 ../BOINC_Installer/Pkg_Root/Library
+
+sudo chown -R 501:admin ../BOINC_Installer/Pkg_Root/Library/Application\ Support/*
+sudo chmod -R u+rw,g+r-w,o+r-w ../BOINC_Installer/Pkg_Root/Library/Application\ Support/*
+
+sudo chown -R root:admin ../BOINC_Installer/Installer\ Resources/*
+sudo chown -R root:admin ../BOINC_Installer/Installer\ Scripts/*
+sudo chmod -R u+rw,g+r-w,o+r-w ../BOINC_Installer/Installer\ Resources/*
+sudo chmod -R u+rw,g+r-w,o+r-w ../BOINC_Installer/Installer\ Scripts/*
+
+
+## If you wish to code sign the client, manager, installer and uninstaller,
+## create a file ~/BOINCCodeSignIdentities.txt whose first line is the
+## application code signing identity and whose second line is the installer
+## code signing identity.
+## If you wish to also code sign the installer package, add a second line
+## to ~/BOINCCodeSignIdentities.txt with the installer code signing identity.
+##
+## Code signing using a registered Apple Developer ID is necessary for GateKeeper
+## with default settings to allow running downloaded applications under OS 10.8
+## Although code signing the installer application is sufficient to satisfy
+## GateKeeper, OS X's software firewall can interfere with RPCs between the
+## client and manager. Signing them may make this less likely to be a problem.
+if [ -e "${HOME}/BOINCCodeSignIdentities.txt" ]; then
+ exec 8<"${HOME}/BOINCCodeSignIdentities.txt"
+ read APPSIGNINGIDENTITY <&8
+ read INSTALLERSIGNINGIDENTITY <&8
+
+ # Code Sign the BOINC client if we have a signing identity
+ sudo codesign -f -s "${APPSIGNINGIDENTITY}" "../BOINC_Installer/Pkg_Root/Applications/${MANAGERAPPNAME}.app/Contents/Resources/boinc"
+
+ # Code Sign the BOINC Manager if we have a signing identity
+ sudo codesign -f -s "${APPSIGNINGIDENTITY}" "../BOINC_Installer/Pkg_Root/Applications/${MANAGERAPPNAME}.app"
+fi
+
+sudo rm -dfR ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/
+
+mkdir -p ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/
+mkdir -p ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch
+mkdir -p ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras
+mkdir -p ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin
+mkdir -p ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_SymbolTables
+
+cp -fp ../BOINC_Installer/Installer\ Resources/ReadMe.rtf ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch
+sudo chown -R 501:admin ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/ReadMe.rtf
+sudo chmod -R 644 ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/ReadMe.rtf
+
+cp -fp COPYING ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/COPYING.txt
+sudo chown -R 501:admin ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/COPYING.txt
+sudo chmod -R 644 ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/COPYING.txt
+
+cp -fp COPYING.LESSER ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/COPYING.LESSER.txt
+sudo chown -R 501:admin ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/COPYING.LESSER.txt
+sudo chmod -R 644 ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/COPYING.LESSER.txt
+
+cp -fp COPYRIGHT ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/COPYRIGHT.txt
+sudo chown -R 501:admin ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/COPYRIGHT.txt
+sudo chmod -R 644 ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/COPYRIGHT.txt
+
+cp -fpRL "${BUILDPATH}/Uninstall BOINC.app/." "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/${UNINSTALLERAPPNAME}.app/"
+# Copy the localization files for the uninstaller into its bundle
+find locale -name 'BOINC-Setup.mo' | cut -d '/' -f 2 | awk '{print "\"../BOINC_Installer/locale/"$0"\""}' | xargs mkdir -p
+
+find locale -name 'BOINC-Setup.mo' | cut -d '/' -f 2,3 | awk '{print "cp \"locale/"$0"\" \"../BOINC_Installer/locale/"$0"\""}' | bash
+
+sudo cp -fpRL ../BOINC_Installer/locale "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/${UNINSTALLERAPPNAME}.app/Contents/Resources"
+sed -i "" s/"Uninstall BOINC"/"${UNINSTALLERAPPNAME}"/g "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/${UNINSTALLERAPPNAME}.app/Contents/Info.plist"
+sed -i "" s/"MacUninstaller"/"${UNINSTALLERICON}"/g "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/${UNINSTALLERAPPNAME}.app/Contents/Info.plist"
+mv "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/${UNINSTALLERAPPNAME}.app/Contents/MacOS/Uninstall BOINC" "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/${UNINSTALLERAPPNAME}.app/Contents/MacOS/${UNINSTALLERAPPNAME}"
+sed -i "" s/"Uninstall BOINC"/"${UNINSTALLERAPPNAME}"/g "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/${UNINSTALLERAPPNAME}.app/Contents/Resources/English.lproj/InfoPlist.strings"
+cp -fpRL ./clientgui/res/${UNINSTALLERICON}.icns "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/${UNINSTALLERAPPNAME}.app/Contents/Resources/"
+rm -rf "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/${UNINSTALLERAPPNAME}.app/Contents/Resources/MacUninstaller.icns"
+cp -fpRL ./clientgui/res/${UNINSTALLERTRASHICON}.icns "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/${UNINSTALLERAPPNAME}.app/Contents/Resources/PutInTrash.icns"
+
+sudo chown -R root:admin "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/${UNINSTALLERAPPNAME}.app"
+sudo chmod -R u+r-w,g+r-w,o+r-w "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/${UNINSTALLERAPPNAME}.app"
+
+# Copy the installer wrapper application "BOINC Installer.app"
+cp -fpRL "${BUILDPATH}/BOINC Installer.app/." "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/${INSTALLERAPPNAME}.app/"
+sed -i "" s/"BOINC Installer"/"${INSTALLERAPPNAME}"/g "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/${INSTALLERAPPNAME}.app/Contents/Info.plist"
+sed -i "" s/"MacInstaller"/"${INSTALLERICON}"/g "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/${INSTALLERAPPNAME}.app/Contents/Info.plist"
+cp -fpRL ./clientgui/res/${INSTALLERICON}.icns "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/${INSTALLERAPPNAME}.app/Contents/Resources/"
+rm -rf "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/${INSTALLERAPPNAME}.app/Contents/Resources/MacInstaller.icns"
+mv "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/${INSTALLERAPPNAME}.app/Contents/MacOS/BOINC Installer" "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/${INSTALLERAPPNAME}.app/Contents/MacOS/${INSTALLERAPPNAME}"
+sed -i "" s/"BOINC Installer"/"${INSTALLERAPPNAME}"/g "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/${INSTALLERAPPNAME}.app/Contents/Resources/English.lproj/InfoPlist.strings"
+
+cp -fpR "${BUILDPATH}/PostInstall.app" "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/${INSTALLERAPPNAME}.app/Contents/Resources"
+
+echo ${BRANDING_INFO} > "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/${INSTALLERAPPNAME}.app/Contents/Resources/PostInstall.app/Contents/Resources/Branding"
+cp -fpRL ./clientgui/res/${INSTALLERICON}.icns "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/${INSTALLERAPPNAME}.app/Contents/Resources/PostInstall.app/Contents/Resources/MacInstaller.icns"
+
+# Build the installer package inside the wrapper application's bundle
+
+cd "../BOINC_Installer/Installer templates"
+
+pkgbuild --quiet --scripts "../Installer Scripts" --ownership recommended --identifier edu.berkeley.boinc --root "../Pkg_Root" --component-plist "./complist.plist" "./BOINC.pkg"
+
+if [ -n "${INSTALLERSIGNINGIDENTITY}" ]; then
+ productbuild --sign "${INSTALLERSIGNINGIDENTITY}" --quiet --resources "../Installer Resources/" --version "${MANAGERAPPNAME} $1.$2.$3" --distribution "./myDistribution" "../New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/${INSTALLERAPPNAME}.app/Contents/Resources/${LONGBRANDNAME}.pkg"
+else
+ productbuild --quiet --resources "../Installer Resources/" --version "${MANAGERAPPNAME} $1.$2.$3" --distribution "./myDistribution" "../New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/${INSTALLERAPPNAME}.app/Contents/Resources/${LONGBRANDNAME}.pkg"
+fi
+cd "${BOINCPath}"
+
+# Build the stand-alone client distribution
+cp -fpRL mac_build/Mac_SA_Insecure.sh ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin/
+cp -fpRL mac_build/Mac_SA_Secure.sh ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin/
+cp -fpRL COPYING ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin/COPYING.txt
+cp -fpRL COPYING.LESSER ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin/COPYING.LESSER.txt
+cp -fpRL COPYRIGHT ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin/COPYRIGHT.txt
+cp -fp mac_installer/License.rtf ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin/
+sudo chown -R 501:admin ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin/*
+sudo chmod -R 644 ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin/*
+
+mkdir -p ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin/move_to_boinc_dir
+cp -fpRL "${BUILDPATH}/boinc" ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin/move_to_boinc_dir/
+cp -fpRL "${BUILDPATH}/boinccmd" ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin/move_to_boinc_dir/
+cp -fpRL curl/ca-bundle.crt ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin/move_to_boinc_dir/
+
+mkdir -p ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin/move_to_boinc_dir/switcher
+cp -fpRL "${BUILDPATH}/switcher" ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin/move_to_boinc_dir/switcher/
+cp -fpRL "${BUILDPATH}/setprojectgrp" ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin/move_to_boinc_dir/switcher/
+
+sudo chown -R root:admin ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin/move_to_boinc_dir/*
+sudo chmod -R u+rw-s,g+r-ws,o+r-w ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin/move_to_boinc_dir/*
+
+cp -fpRL "${BUILDPATH}/SymbolTables/" ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_SymbolTables/
+
+## If you wish to code sign the installer and uninstaller, create a file
+## ~/BOINCCodeSignIdentities.txt whose first line is the code signing identity
+##
+## Code signing using a registered Apple Developer ID is necessary for GateKeeper
+## with default settings to allow running downloaded applications under OS 10.8
+if [ -n "${APPSIGNINGIDENTITY}" ]; then
+ # Code Sign the BOINC installer application if we have a signing identity
+ sudo codesign -f -s "${APPSIGNINGIDENTITY}" "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/${INSTALLERAPPNAME}.app"
+
+ # Code Sign the BOINC uninstaller application if we have a signing identity
+ sudo codesign -f -s "${APPSIGNINGIDENTITY}" "../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3/${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch/extras/${UNINSTALLERAPPNAME}.app"
+fi
+
+cd ../BOINC_Installer/New_Release_${SHORTBRANDNAME}_$1_$2_$3
+
+## Make everything in directory user-writable so project web code using auto-attach
+## can delete it after inflating, modifying installer name and recompressing it.
+sudo chmod -R u+w ./${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch
+
+## Use ditto instead of zip utility to preserve resource forks and Finder attributes (custom icon, hide extension)
+ditto -ck --sequesterRsrc --keepParent ${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch ${SHORTBRANDNAME}_$1.$2.$3_macOSX_$arch.zip
+ditto -ck --sequesterRsrc --keepParent ${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin ${SHORTBRANDNAME}_$1.$2.$3_$arch-apple-darwin.zip
+ditto -ck --sequesterRsrc --keepParent ${SHORTBRANDNAME}_$1.$2.$3_macOSX_SymbolTables ${SHORTBRANDNAME}_$1.$2.$3_macOSX_SymbolTables.zip
+
+#popd
+cd "${BOINCPath}"
+
+sudo rm -dfR ../BOINC_Installer/Installer\ Resources/
+sudo rm -dfR ../BOINC_Installer/Installer\ Scripts/
+sudo rm -dfR ../BOINC_Installer/Pkg_Root
+sudo rm -dfR ../BOINC_Installer/locale
+sudo rm -dfR ../BOINC_Installer/Installer\ templates
+sudo rm -dfR ../BOINC_Installer/expandedVBox
+
+return 0