Changes for Charity Engine Desktop

svn path=/branches/boinc_core_release_6_8/; revision=23949
This commit is contained in:
Charlie Fenton 2011-08-08 12:54:28 +00:00
parent 4af490349a
commit 0b6a67dc24
64 changed files with 886 additions and 17 deletions

View File

@ -6833,3 +6833,33 @@ Charlie 5 Aug 2011
release_boinc.sh
uninstall.cpp
WaitPermissions.cpp
Charlie 8 Aug 2011
- Changes for Charity Engine Desktop.
clientgui/
mac/
CE_ss_logo.tiff (new)
res/
CE_Install.icns (new)
CharityEngine.icns (new)
CE_Uninstall.icns (new)
MacCEPkgIcon.zip (new)
skins/
Charity Engine/ (new)
graphics/ (new)
(many new files)
skin.xml (new)
clientscr/
mac_saver_module.cpp
res/
CE_ss_logo.png (new)
CE_ss_logo.jpg (new)
ss_app.cpp
mac_installer/
CE-Branding (new)
CE-ReadMe.rtf (new)
CharityEngine/ (new)
acct_mgr_url.xml (new)
make_CharityEngine.sh (new)
PostInstall.cpp

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 901 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 901 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,264 @@
<?xml version="1.0" encoding="UTF-8"?>
<skin>
<en>
<simple>
<background_image>
<!-- Background Image for the Simple GUI-->
<!-- 410x540 -->
<image>
<imagesrc>graphic/simplegui_bg.png</imagesrc>
<background_color>153:153:153</background_color>
</image>
</background_image>
<spacer_image>
<image>
<imagesrc>graphic/spacer.png</imagesrc>
</image>
</spacer_image>
<static_line_color>51:51:51</static_line_color>
<state_indicator_background_image>
<image>
<imagesrc>graphic/state_ind_bg.png</imagesrc>
</image>
</state_indicator_background_image>
<connecting_indicator_image>
<image>
<imagesrc>graphic/conn_ind.png</imagesrc>
</image>
</connecting_indicator_image>
<error_indicator_image>
<image>
<imagesrc>graphic/error_image.png</imagesrc>
</image>
</error_indicator_image>
<workunit_active_tab>
<tab>
<imagesrc>graphic/ico_workWU.png</imagesrc>
<border_color>89:89:89</border_color>
<gradient_from_color>89:89:89</gradient_from_color>
<gradient_to_color>128:128:128</gradient_to_color>
</tab>
</workunit_active_tab>
<workunit_suspended_tab>
<tab>
<imagesrc>graphic/ico_workWU_sus.png</imagesrc>
<border_color>128:128:128</border_color>
<gradient_from_color>128:128:128</gradient_from_color>
<gradient_to_color>178:178:178</gradient_to_color>
</tab>
</workunit_suspended_tab>
<workunit_tab_area_background_image>
<image>
<imagesrc>graphic/tabArea_bg.png</imagesrc>
</image>
</workunit_tab_area_background_image>
<workunit_area_background_image>
<image>
<imagesrc>graphic/wu_bg.png</imagesrc>
</image>
</workunit_area_background_image>
<workunit_animation_background_image>
<image>
<imagesrc>graphic/project_image.png</imagesrc>
</image>
</workunit_animation_background_image>
<workunit_animation_image>
<image>
<imagesrc>graphic/ce_background.png</imagesrc>
</image>
</workunit_animation_image>
<workunit_gauge_background_image>
<image>
<imagesrc>graphic/gauge_bg.png</imagesrc>
</image>
</workunit_gauge_background_image>
<workunit_gauge_progress_indicator_image>
<image>
<imagesrc>graphic/gauge_progress_indicator.png</imagesrc>
</image>
</workunit_gauge_progress_indicator_image>
<project_area_background_image>
<image>
<imagesrc>graphic/proj_bg.png</imagesrc>
</image>
</project_area_background_image>
<project_image>
<image>
<imagesrc>graphic/default_stat_icon.png</imagesrc>
</image>
</project_image>
<syncronize_button>
<button>
<imagesrc>graphic/btnSynchronize.png</imagesrc>
<imagesrc_clicked>graphic/btnSynchronizeClick.png</imagesrc_clicked>
</button>
</syncronize_button>
<right_arrow_button>
<button>
<imagesrc>graphic/arwRight.png</imagesrc>
<imagesrc_clicked>graphic/arwRightClick.png</imagesrc_clicked>
</button>
</right_arrow_button>
<left_arrow_button>
<button>
<imagesrc>graphic/arwLeft.png</imagesrc>
<imagesrc_clicked>graphic/arwLeftClick.png</imagesrc_clicked>
</button>
</left_arrow_button>
<save_button>
<button>
<imagesrc>graphic/btnSave.png</imagesrc>
<imagesrc_clicked>graphic/btnSaveClick.png</imagesrc_clicked>
</button>
</save_button>
<cancel_button>
<button>
<imagesrc>graphic/btnCancel.png</imagesrc>
<imagesrc_clicked>graphic/btnCancelClick.png</imagesrc_clicked>
</button>
</cancel_button>
<change_button>
<button>
<imagesrc>graphic/btnChange.png</imagesrc>
<imagesrc_clicked>graphic/btnChangeClick.png</imagesrc_clicked>
</button>
</change_button>
<close_button>
<button>
<imagesrc>graphic/btnClose.png</imagesrc>
<imagesrc_clicked>graphic/btnCloseClick.png</imagesrc_clicked>
</button>
</close_button>
<help_button>
<button>
<imagesrc>graphic/btnHelp.png</imagesrc>
<imagesrc_clicked>graphic/btnHelpClicked.png</imagesrc_clicked>
</button>
</help_button>
<copy_button>
<button>
<imagesrc>graphic/btnCopy.png</imagesrc>
<imagesrc_clicked>graphic/btnCopyClicked.png</imagesrc_clicked>
</button>
</copy_button>
<copy_all_button>
<button>
<imagesrc>graphic/btnCopyAll.png</imagesrc>
<imagesrc_clicked>graphic/btnCopyAllClicked.png</imagesrc_clicked>
</button>
</copy_all_button>
<clear_button>
<button>
<imagesrc>graphic/btnClear.png</imagesrc>
<imagesrc_clicked>graphic/btnClearClick.png</imagesrc_clicked>
</button>
</clear_button>
<attach_project_button>
<button>
<imagesrc>graphic/btnAddProject.png</imagesrc>
<imagesrc_clicked>graphic/btnAddProjectClick.png</imagesrc_clicked>
</button>
</attach_project_button>
<synchronize_button>
<button>
<imagesrc>graphic/btnSynchronize.png</imagesrc>
<imagesrc_clicked>graphic/btnSynchronizeClick.png</imagesrc_clicked>
</button>
</synchronize_button>
<messages_link_image>
<image>
<imagesrc>graphic/btnMessages.png</imagesrc>
</image>
</messages_link_image>
<messages_alert_link_image>
<image>
<imagesrc>graphic/btnMessagesAlert.png</imagesrc>
</image>
</messages_alert_link_image>
<suspend_link_image>
<image>
<imagesrc>graphic/btnSnooze.png</imagesrc>
</image>
</suspend_link_image>
<resume_link_image>
<image>
<imagesrc>graphic/btnResume.png</imagesrc>
</image>
</resume_link_image>
<preferences_link_image>
<image>
<imagesrc>graphic/btnPreferences.png</imagesrc>
</image>
</preferences_link_image>
<advanced_link_image>
<image>
<imagesrc>graphic/btnAdvancedView.png</imagesrc>
</image>
</advanced_link_image>
<dialog_background_image>
<image>
<imagesrc>graphic/dlgBackground.png</imagesrc>
</image>
</dialog_background_image>
</simple>
<!-- this section can be omitted in which case it will use the BOINC defaults (shown below) -->
<advanced>
<!-- name displayed in application title bar -->
<application_name>Charity Engine Desktop</application_name>
<application_short_name>Charity Engine</application_short_name>
<application_icon>
<image>
<!-- Taskbar Icon -->
<imagesrc>graphic/ce_icon_play.png</imagesrc>
<transparency_mask>255:255:255</transparency_mask>
</image>
</application_icon>
<application_disconnected_icon>
<image>
<!-- Taskbar Icon when disconnected -->
<imagesrc>graphic/ce_stop.png</imagesrc>
<transparency_mask>255:255:255</transparency_mask>
</image>
</application_disconnected_icon>
<application_snooze_icon>
<image>
<!-- Taskbar Icon when snoozing -->
<imagesrc>graphic/ce_pause.png</imagesrc>
<transparency_mask>255:255:255</transparency_mask>
</image>
</application_snooze_icon>
<!-- logo displayed in about box -->
<application_logo>graphic/ce_about.ico</application_logo>
<!-- name displayed in about box -->
<organization_name>Charity Engine</organization_name>
<!-- web site displayed in about box -->
<organization_website>http://www.charityengine.org</organization_website>
<organization_help_url>mailto:support@charityengine.org</organization_help_url>
<!-- this setting makes the BOINC manager automatically open to a particular tab on the -->
<!-- advanced view, overriding a users last displayed view. 0 means use users last open tab -->
<open_tab>0</open_tab>
<exit_message>This will shut down Charity engine and its tasks entirely
until Charity Engine Desktop is run again.
In most cases, it is better to avoid exiting the program. Instead
simply close the Charity Engine Desktop Window.</exit_message>
</advanced>
<!-- this section can be omitted in which case it will use the BOINC defaults (shown below) -->
<wizards>
<attach_to_project>
<!-- title displayed on the attach to project wizard -->
<title>Charity Engine Desktop - Attach to Project</title>
<!-- logo displayed on the attach to project wizard -->
<logo>graphic/ce_wizard_bar.png</logo>
</attach_to_project>
<attach_to_account_manager>
<!-- title displayed on the attach to account manager wizard -->
<title></title>
<!-- logo displayed on the attach to account manager wizard -->
<logo>graphic/ce_wizard_bar.png</logo>
<!-- additional message to user about attaching to an account manager -->
<account_info_message></account_info_message>
</attach_to_account_manager>
</wizards>
</en>
</skin>

View File

@ -256,10 +256,13 @@ OSStatus CScreensaver::initBOINCApp() {
brandId = GetBrandID();
switch(brandId) {
case 1:
m_BrandText = "GridRepublic";
m_BrandText = "GridRepublic Desktop";
break;
case 2:
m_BrandText = "Progress Thru Processors";
m_BrandText = "Progress Thru Processors Desktop";
break;
case 3:
m_BrandText = "Charity Engine Desktop";
break;
default:
m_BrandText = "BOINC";

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@ -66,6 +66,20 @@ double next_connect_time = 0.0;
CC_STATE cc_state;
CC_STATUS cc_status;
// Possible values of iBrandId:
#define BOINC_BRAND_ID 0
#define GRIDREPUBLIC_BRAND_ID 1
#define PROGRESSTHRUPROCESSORS_BRAND_ID 2
#define CHARITYENGINE_BRAND_ID 3
#ifdef _GRIDREPUBLIC
static long iBrandId = GRIDREPUBLIC_BRAND_ID;
#elif defined(_CHARITYENGINE)
static long iBrandId = CHARITYENGINE_BRAND_ID;
#else
static long iBrandId = BOINC_BRAND_ID; // Default value for BOINC
#endif
// set up lighting model
//
static void init_lights() {
@ -136,26 +150,32 @@ void show_project(unsigned int index, float alpha) {
void show_disconnected() {
float x=.3, y=.3;
#ifdef _GRIDREPUBLIC
if (iBrandId == GRIDREPUBLIC_BRAND_ID) {
txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "GridRepublic is not running.");
#else
} else if (iBrandId == CHARITYENGINE_BRAND_ID) {
txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "Charity Engine is not running.");
} else {
txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "BOINC is not running.");
#endif
}
}
void show_no_projects() {
float x=.2, y=.3;
#ifdef _GRIDREPUBLIC
if (iBrandId == GRIDREPUBLIC_BRAND_ID) {
txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "GridRepublic is not attached to any projects.");
#else
} else if (iBrandId == CHARITYENGINE_BRAND_ID) {
txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "Charity Engine is not attached to any projects.");
} else {
txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "BOINC is not attached to any projects.");
#endif
}
y = .25;
#ifdef _GRIDREPUBLIC
if (iBrandId == GRIDREPUBLIC_BRAND_ID) {
txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "Attach to projects using the GridRepublic Desktop.");
#else
} else if (iBrandId == CHARITYENGINE_BRAND_ID) {
txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "Attach to projects using the Charity Engine Desktop.");
} else {
txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "Attach to projects using the BOINC Manager.");
#endif
}
}
#define MAX_JOBS_DISPLAY 4
@ -204,11 +224,13 @@ void show_jobs(unsigned int index, double alpha) {
case SUSPEND_REASON_NO_RECENT_INPUT:
p = "Computing suspended while computer not in use"; break;
case SUSPEND_REASON_INITIAL_DELAY:
#ifdef _GRIDREPUBLIC
if (iBrandId == GRIDREPUBLIC_BRAND_ID) {
p = "Computing suspended while GridRepublic is starting up"; break;
#else
} else if (iBrandId == CHARITYENGINE_BRAND_ID) {
p = "Computing suspended while Charity Engine is starting up"; break;
} else {
p = "Computing suspended while BOINC is starting up"; break;
#endif
}
case SUSPEND_REASON_EXCLUSIVE_APP_RUNNING:
p = "Computing suspended while exclusive application running"; break;
}
@ -365,10 +387,16 @@ void boinc_app_key_release(int, int){}
void app_graphics_init() {
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
txf_load_fonts(".");
#ifdef _GRIDREPUBLIC
logo.load_image_file("gridrepublic_ss_logo.jpg");
#ifdef _WCG
logo.load_image_file("wcg.bmp");
#else
logo.load_image_file("boinc_logo_black.jpg");
if (iBrandId == GRIDREPUBLIC_BRAND_ID) {
logo.load_image_file("gridrepublic_ss_logo.jpg");
} else if (iBrandId == CHARITYENGINE_BRAND_ID) {
logo.load_image_file("CE_ss_logo.jpg");
} else {
logo.load_image_file("boinc_logo_black.jpg");
}
#endif
init_lights();
}
@ -396,6 +424,16 @@ int main(int argc, char** argv) {
}
exit(ERR_CONNECT);
}
#ifdef __APPLE__
// For GridRepublic, the installer put a branding file in our data directory
FILE *f = fopen("/Library/Application Support/BOINC Data/Branding", "r");
if (f) {
fscanf(f, "BrandId=%ld\n", &iBrandId);
fclose(f);
}
#else
#endif
boinc_graphics_loop(argc, argv, "BOINC screensaver");
boinc_finish_diag();

View File

@ -0,0 +1 @@
BrandId=3

165
mac_installer/CE-ReadMe.rtf Normal file
View File

@ -0,0 +1,165 @@
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;\red2\green87\blue173;}
\margl1440\margr1440\vieww9000\viewh9000\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc
\f0\b\fs28 \cf0 Macintosh Charity Engine Desktop Version <VER_NUM> Release Notes\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
\b0\fs24 \cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc
\cf0 http://gridrepublic.org\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
\cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
\b \cf0 Installing
\fs28 Charity Engine
\fs24 Desktop may take several minutes; please be patient.
\b0 \
\
\b Dual GPU Macbook Pros:
\b0 Some newer Macbook Pros have dual graphics processors, one that is more powerful and another that is more energy-efficient, and they switch between them automatically. This can cause your screensaver to flash on and off frequently, and can prevent Charity Engine Desktop from detecting the more powerful GPU which is needed to process some applications. You can force selection either {\field{\*\fldinst{HYPERLINK "http://support.apple.com/kb/HT4110"}}{\fldrslt \cf2 permanently}} or temporarily using a {\field{\*\fldinst{HYPERLINK "http://codykrieger.com/gfxCardStatus/"}}{\fldrslt \cf2 third-party utility}}. But be aware that forcing the use of the NVIDIA GPU may cause faster battery drain; this of course is not an issue when running on AC power.\
\
If you are upgrading from a version earlier than 6.8.0, you may see a message "Failed to convert file Charity Engine Desktop Preferences to Unicode." This is due to our addition of full Unicode support to the Charity Engine Desktop. If you get this message, you may need to readjust your column widths and other Charity Engine Desktop view options, but no other problems will result. When you quit Charity Engine Desktop, these settings will be saved in the new Unicode format.\
\
Due to new restrictions imposed by OS 10.6 Snow Leopard, there has been a change in Charity Engine Desktop's security implementation. Non-administrative users can no longer run Charity Engine Desktop unless they are added to group boinc_master. As of Charity Engine Desktop 6.8.29, the Charity Engine Desktop installer asks whether or not you wish to allow this.\
\
For more options, please see the BOINC Macintosh administrator tools at:\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
{\field{\*\fldinst{HYPERLINK "http://boinc.berkeley.edu/wiki/Tools_for_Mac_OS_X"}}{\fldrslt \cf0 http://boinc.berkeley.edu/wiki/Tools_for_Mac_OS_X}}\
\
Charity Engine Desktop on the Mac now supports processing with your graphics card, or GPU. Please see {\field{\*\fldinst{HYPERLINK "http://boinc.berkeley.edu/gpu.php"}}{\fldrslt http://boinc.berkeley.edu/gpu.php}} for more information. If you have a CUDA-capable NVIDIA GPU, you will need to download and install the CUDA driver and libraries for your system from {\field{\*\fldinst{HYPERLINK "http://www.nvidia.com/object/mac-driver-archive.html"}}{\fldrslt http://www.nvidia.com/object/mac-driver-archive.html}}.\
\
Starting with version 5.5.4, this software features new, stricter security measures. See the
\b Security
\b0 section below for important information.\
\
This is a
\b universal binary
\b0 which will run natively on both Intel and PowerPC Macs. Charity Engine Desktop requires Macintosh OS X version 10.3.9 or greater. \
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
\b \cf0 Upgrade warning: You may lose unreported results
\b0 if you are running on an
\b Intel Mac
\b0 and upgrading from a version of Charity Engine or BOINC earlier than 5.3.21 on an Intel Mac, or if you are transferring Charity Engine or BOINC Data from a PowerPC Mac to an Intel Mac, or from an Intel Mac to a PowerPC Mac. To prevent this, open Charity Engine Desktop's window, select the
\i Projects
\i0 tab, select each project and press the
\i Update
\i0 button. Then select the
\i Tasks
\i0 tab and make sure there are no tasks "Ready to report."\
\
\b Setting Charity Engine as your screen saver:
\b0 This installer adds the Charity Engine screen saver to your system, and optionally changes your screen saver settings to use the Charity Engine screen saver. You can also select Charity Engine as your screen saver later, using the Screen Saver or Screen Effects panel in the System Preferences (accessible from the Apple menu). \
\
It may take a minute after the screen saver starts before the science application graphics appear. \
\
Note: on some versions of the Mac OS, you may not be able to exit the Charity Engine screen saver by moving the mouse; you may need to press the mouse button or press any key on the keyboard to exit. \
\
\b Security:\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
\b0 \cf0 Version 5.5.4 of Charity Engine Desktop for the Macintosh features new, stricter security measures. This additional security helps protect your computer data from potential theft or accidental or malicious damage by limiting Charity Engine projects' access to your system and data. \
\
If you experience problems with this software, you can re-install a version of Charity Engine or BOINC prior to 5.5.4; this will automatically revert ownership and permissions to the earlier implementation.\
\
Once we have tested this security implementation on the Mac, we plan to extend it to other computer platforms, including Linux and Windows.\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
\cf0 The installer sets special permission for the Charity Engine Desktop and Client, which allows them to write to the shared BOINC Data regardless of which user is logged in. If you
\b copy
\b0 Charity Engine Desktop or the Charity Engine core client without using the installer, it will not run properly. \
\
However, you can safely
\b move
\b0 the Charity Engine Desktop within the same disk drive or partition. If you need multiple copies, run the installer again after moving Charity Engine Desktop; this will create a fresh copy in the
\b /Applications
\b0 folder.\
\
Charity Engine verifies that ownership and permissions are set properly each time it is launched. It will tell you to re-install Charity Engine if there is a problem.\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
\cf0 \
The new safeguards use the basic security protections built into UNIX (the base underlying Mac OS X): permissions and ownership.\
\
The administrator (usually the owner) of each computer creates one or more users who can log in, can create private files, and can share other files. Some of these users are given administrative privileges, some may not have these privileges.\
\
There are also groups, which have one or more users as members. For example, users with administrative privileges are usually members of the "admin" group.\
\
In addition to these "visible" users and groups, the operating system contains a number of "hidden" users and groups which are used for various purposes. A person cannot log in as one of these "hidden" users. \
\
This structure of users and groups is used to provide security by restricting what data and operations each person or application can use. For example, many files belong to user "system" (also called "root") and group "wheel" so that non-privileged users can't modify them, thus protecting the computer system from accidental or malicious harm.\
\
Starting with version 5.5.4 of the Charity Engine Desktop for the Macintosh, the Charity Engine installer creates 2 new "hidden" users
\b boinc_master
\b0 and
\b boinc_project
\b0 , and two new "hidden" groups, also named
\b boinc_master
\b0 and
\b boinc_project
\b0 (unless they were created by a previous installation of Charity Engine or BOINC.)\
\
The installer automatically gives administrators (users who are members of the "admin" group) membership in the two new groups, so that they can easily manipulate Charity Engine files. Non-admin users are denied direct access to these files (except through Charity Engine Desktop), protecting Charity Engine and its projects files. This is particularly useful where many people have access to the computer, as in a school computer lab.\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
\cf0 Charity Engine projects are given permission to access only project files, protecting your computer in the event someone downloads bad software from a bogus project, or in the unlikely case that a legitimate project's server is infiltrated by a cracker.\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
\cf0 \
The Charity Engine Desktop also blocks non-admin users' access to certain functions, such as Attach, Detach, Reset Project. Charity Engine permits a non-admin user to override this restriction by entering an administrator user name and password.\
\
For technical details of the implementation, please see {\field{\*\fldinst{HYPERLINK "http://boinc.berkeley.edu/trac/wiki/SandboxUser"}}{\fldrslt http://boinc.berkeley.edu/trac/wiki/SandboxUser}} and {\field{\*\fldinst{HYPERLINK "http://boinc.berkeley.edu/sandbox.php"}}{\fldrslt http://boinc.berkeley.edu/sandbox.php}}\
\
\
As of Version 5.5.4, the installer now sets Charity Engine Desktop as a Login item for
\b all
\b0 users, not just the user who ran the installer. You can add or remove Login Items by using the Accounts Pane in the System Preferences (accessible from the Apple menu). (These items are called "Login Items" in OS 10.4 or "Startup Items" in OS 10.3.)\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
\cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
\b \cf0 Other useful information:
\b0 \
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
\b \cf0 Troubleshooting tip:
\b0 If you are upgrading from a version of Charity Engine or BOINC prior to 5.5.4 and the installer refuses to let you install, trash the file
\b /Library/Receipts/Charity Engine.pkg
\b0 or
\b /Library/Receipts/BOINC.pkg
\b0 and try again.\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
\cf0 \
The installer places two items onto your hard drive: Charity Engine Desktop.app in your
\b /Applications
\b0 folder and Charity Engine.saver in your
\b /Library/Screen Savers
\b0 folder. \
\
The installer creates the BOINC Data folder in your
\b /Library/Application Support
\b0 folder. If you have previously been running Charity Engine or BOINC in a different folder, copy your data into this folder. \
\
All users who log in on the same Macintosh will share one set of BOINC data, ensuring that work units are processed in the most timely manner. \
\
You can move (
\b not
\b0 copy) Charity Engine Desktop to any folder you wish on the same disk drive or partition. If you do so, you will need to update the information in each user's Login Items. In most cases, the Charity Engine screen saver should still work properly. If it does not, move Charity Engine Desktop back to the
\b /Applications
\b0 folder.\
\
\pard\pardeftab720\ql\qnatural
\cf0 To completely remove (
\b uninstall
\b0 ) Charity Engine Desktop from your Macintosh, run the
\b Uninstall Charity Engine
\b0 application which is included with the installer.\
}

View File

@ -0,0 +1,18 @@
<acct_mgr>
<name>Charity Engine</name>
<url>http://www.charityengine.com/</url>
<cookie_required/>
<cookie_failure_url>http://www.charityengine.com/forgot</cookie_failure_url>
<signing_key>
1024
9c3af22a230f1eb122b8eab256e5e46b49f6d357e65d00e414cf6af105aef217
1de0793353097bbbb918413f79cb5bfaa4532daf061ece07b63f209690a3e1b1
8906a9ae4f521ec25e6fb79b8679dd4c18c0f022dcb95baefeca091d572c7738
e1b1d542bbec94552e0e37c698427f4538b947b79072d112ebcf4d9c509b16d9
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000010001
.
</signing_key>
</acct_mgr>

View File

@ -0,0 +1,350 @@
#!/bin/csh
# This file is part of BOINC.
# http://boinc.berkeley.edu
# Copyright (C) 2008 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 <http://www.gnu.org/licenses/>.
##
# Script to convert Macintosh BOINC installer to Charity Engine Desktop installer
# updated 8/8/11 by Charlie Fenton for BOINC 6.8.29 and later
##
## Usage:
## First put the following files into a working directory:
## the BOINC installer to be converted
## the Uninstall BOINC application to be converted
## CE_ReadMe.rtf
## CharityEngine.icns
## MacCEPkgIcon.zip
## CE_uninstall.icns
## COPYING
## COPYING.LESSER
## COPYRIGHT
## skins directory containing Charity Engine skin (optional)
## acct_mgr_url.xml (to have BOINC automatically connect to Account Manager)
## CE_ss_logo.png (for screensaver coordinator)
## CE_ss_logo.tiff (for screensaver coordinator)
## CE_saver directory containing Charity Engine default screensaver (if non-standard)
## and associated files, including:
## CE_ss_logo.png
##
## NOTE: This script uses PackageMaker, which is installed as part of the
## XCode developer tools. So you must have installed XCode Developer
## Tools on the Mac before running this script.
##
## NOTE: PackageMaker may write 3 lines to the terminal with "Setting to : 0 (null)"
## and "relocate: (null) 0". This is normal and does not indicate a problem.
##
## cd to the working directory:
##
## Invoke this script with the three parts of version number as arguments.
## For example, if the version is 3.2.1:
## sh [path_to_this_script] 3 2 1
##
## This will create a directory "BOINC_Installer" in the parent directory of
## the current directory
##
## For different branding, modify the following 9 variables:
PR_PATH="CE_Pkg_Root"
IR_PATH="CE_Installer_Resources"
SCRIPTS_PATH="CE_Installer_Scripts"
NEW_DIR_PATH="New_Release_CE_$1_$2_$3"
README_FILE="CE-ReadMe.rtf"
## BRANDING_FILE="CE-Branding"
BRANDING_INFO="BrandId=3"
ICNS_FILE="CharityEngine.icns"
INSTALLER_ICNS_FILE="MacCEPkgIcon.zip"
UNINSTALLER_ICNS_FILE="CE_uninstall.icns"
SAVER_DIR="CE_saver"
SAVER_SYSPREF_ICON="CE_ss_logo.tiff"
SAVER_LOGO="CE_ss_logo.png"
BRAND_NAME="Charity Engine"
MANAGER_NAME="Charity Engine Desktop"
LC_BRAND_NAME="Charity Engine"
SOURCE_PKG_PATH="BOINC Installer.pkg/Contents"
if [ $# -lt 3 ]; then
echo "Usage:"
echo " cd working_directory"
echo " sh [path_to_this_script] major_version minor_version revision_number"
echo ""
echo "See comments at start of script for more info."
echo ""
exit 1
fi
pushd ./
## Make sure sed uses UTF-8 text encoding
unset LC_CTYPE
unset LC_MESSAGES
unset __CF_USER_TEXT_ENCODING
export LANG=en_US.UTF-8
if [ -f /Developer/usr/bin/packagemaker ]; then
PACKAGEMAKER_VERSION=3
else
PACKAGEMAKER_VERSION=2
fi
sudo rm -dfR "${IR_PATH}"
sudo rm -dfR "${PR_PATH}"
sudo rm -dfR "${SCRIPTS_PATH}"
mkdir -p "${IR_PATH}"
mkdir -p "${PR_PATH}"
sudo rm -dfR "${NEW_DIR_PATH}/"
mkdir -p "${NEW_DIR_PATH}/"
mkdir -p "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal"
mkdir -p "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras"
cp -fp "${SOURCE_PKG_PATH}/Archive.pax.gz" "${PR_PATH}/"
cd "${PR_PATH}"
sudo gunzip ./Archive.pax.gz
sudo pax -r -pe -f Archive.pax
rm -df "Archive.pax"
cd ..
cp -fp "${SOURCE_PKG_PATH}/Resources/License.rtf" "${IR_PATH}/"
cp -fp "${README_FILE}" "${IR_PATH}/ReadMe.rtf"
# Update version number
sed -i "" s/"<VER_NUM>"/"$1.$2.$3"/g "${IR_PATH}/ReadMe.rtf"
if [ "$PACKAGEMAKER_VERSION" = "3" ]; then
mkdir -p "${SCRIPTS_PATH}"
else
SCRIPTS_PATH=${IR_PATH}
fi
# Create the installer's preinstall and preupgrade scripts from the standard preinstall script
cp -fp "${SOURCE_PKG_PATH}/Resources/preinstall" "${SCRIPTS_PATH}/"
sed -i "" s/BOINCManager/"${MANAGER_NAME}"/g "${SCRIPTS_PATH}/preinstall"
sed -i "" s/BOINCSaver/"${BRAND_NAME}"/g "${SCRIPTS_PATH}/preinstall"
cp -fp "${SCRIPTS_PATH}/preinstall" "${SCRIPTS_PATH}/preupgrade"
cp -fp "${SOURCE_PKG_PATH}/Resources/postinstall" "${SCRIPTS_PATH}/"
cp -fp "${SOURCE_PKG_PATH}/Resources/postupgrade" "${SCRIPTS_PATH}/"
cp -fpR "${SOURCE_PKG_PATH}/Resources/PostInstall.app" "${IR_PATH}/"
cp -fp "${SOURCE_PKG_PATH}/Resources/all_projects_list.xml" "${IR_PATH}/"
##### We've decided not to customize BOINC Data directory name for branding
#### mkdir -p "${PR_PATH}/Library/Application Support/${BRAND_NAME} Data"
#### mkdir -p "${PR_PATH}/Library/Application Support/${BRAND_NAME} Data/locale"
mkdir -p "${PR_PATH}/Library/Application Support/BOINC Data"
## If skins folder is present. copy it into BOINC Data folder
if [ -d "skins" ]; then
sudo cp -fR "skins" "${PR_PATH}/Library/Application Support/BOINC Data/"
fi
## Normally, we would put the account manager URL file into the Package Root folder
## for delivery to the BOINC Data folder. But if the user later installs standard
## BOINC (without this file), the Apple installer would then delete the file.
## So we "hide" it in the installer's resources, and have the PostInstall script copy
## it into the BOINC Data folder
##
## If account manager URL file is present, copy it into installer resources for
## eventual delivery into the BOINC Data folder
if [ -f "acct_mgr_url.xml" ]; then
## sudo cp -fR "acct_mgr_url.xml" "${PR_PATH}/Library/Application Support/BOINC Data/acct_mgr_url.xml"
sudo cp -fR "acct_mgr_url.xml" "${IR_PATH}/"
fi
## Modify for Charity Engine
# Rename the Manager's bundle and its executable inside the bundle
sudo mv -f "${PR_PATH}/Applications/BOINCManager.app/" "${PR_PATH}/Applications/${MANAGER_NAME}.app/"
sudo mv -f "${PR_PATH}/Applications/${MANAGER_NAME}.app/Contents/MacOS/BOINCManager" "${PR_PATH}/Applications/${MANAGER_NAME}.app/Contents/MacOS/${MANAGER_NAME}"
# Update the Manager's info.plist, InfoPlist.strings files
sudo sed -i "" s/BOINCManager/"${MANAGER_NAME}"/g "${PR_PATH}/Applications/${MANAGER_NAME}.app/Contents/Info.plist"
sudo sed -i "" s/BOINCMgr.icns/"${ICNS_FILE}"/g "${PR_PATH}/Applications/${MANAGER_NAME}.app/Contents/Info.plist"
# InfoPlist.strings file uses UTF-16 encoding
sudo chmod a+w "${PR_PATH}/Applications/${MANAGER_NAME}.app/Contents/Resources/English.lproj/InfoPlist.strings"
sudo iconv -f UTF-16 -t UTF-8 "${PR_PATH}/Applications/${MANAGER_NAME}.app/Contents/Resources/English.lproj/InfoPlist.strings" > "${PR_PATH}/tempUTF81"
sudo sed -i "" s/BOINC/"${MANAGER_NAME}"/g "${PR_PATH}/tempUTF81"
sudo iconv -f UTF-8 -t UTF-16 "${PR_PATH}/tempUTF81" > "${PR_PATH}/Applications/${MANAGER_NAME}.app/Contents/Resources/English.lproj/InfoPlist.strings"
sudo rm -f "${PR_PATH}/tempUTF81"
# Replace the Manager's BOINCMgr.icns file
sudo cp -fp "${ICNS_FILE}" "${PR_PATH}/Applications/${MANAGER_NAME}.app/Contents/Resources/${ICNS_FILE}"
sudo rm -f "${PR_PATH}/Applications/${MANAGER_NAME}.app/Contents/Resources/BOINCMgr.icns"
# Put Branding file in both Installer Package and Application Bundle
sudo echo ${BRANDING_INFO} > "${IR_PATH}/Branding"
sudo cp -fp "${IR_PATH}/Branding" "${PR_PATH}/Applications/${MANAGER_NAME}.app/Contents/Resources/Branding"
## Put Branding file into BOINC Data folder to make it available to screensaver coordinator
sudo cp -fp "${IR_PATH}/Branding" "${PR_PATH}/Library/Application Support/BOINC Data/Branding"
# Rename the screensaver coordinator bundle and its executable inside the bundle
sudo mv -f "${PR_PATH}/Library/Screen Savers/BOINCSaver.saver" "${PR_PATH}/Library/Screen Savers/${BRAND_NAME}.saver"
sudo mv -f "${PR_PATH}/Library/Screen Savers/${BRAND_NAME}.saver/Contents/MacOS/BOINCSaver" "${PR_PATH}/Library/Screen Savers/${BRAND_NAME}.saver/Contents/MacOS/${BRAND_NAME}"
# Update screensaver coordinator's info.plist, InfoPlist.strings files
sudo sed -i "" s/BOINCSaver/"${BRAND_NAME}"/g "${PR_PATH}/Library/Screen Savers/${BRAND_NAME}.saver/Contents/Info.plist"
# InfoPlist.strings file uses UTF-16 encoding
sudo chmod a+w "${PR_PATH}/Library/Screen Savers/${BRAND_NAME}.saver/Contents/Resources/English.lproj/InfoPlist.strings"
sudo iconv -f UTF-16 -t UTF-8 "${PR_PATH}/Library/Screen Savers/${BRAND_NAME}.saver/Contents/Resources/English.lproj/InfoPlist.strings" > "${PR_PATH}/tempUTF82"
sudo sed -i "" s/BOINC/"${BRAND_NAME}"/g "${PR_PATH}/tempUTF82"
sudo iconv -f UTF-8 -t UTF-16 "${PR_PATH}/tempUTF82" > "${PR_PATH}/Library/Screen Savers/${BRAND_NAME}.saver/Contents/Resources/English.lproj/InfoPlist.strings"
sudo rm -f "${PR_PATH}/tempUTF82"
# Replace screensaver coordinator's boinc.tiff or boinc.jpg file
sudo rm -f "${PR_PATH}/Library/Screen Savers/${BRAND_NAME}.saver/Contents/Resources/boinc.jpg"
sudo cp -fp "${SAVER_SYSPREF_ICON}" "${PR_PATH}/Library/Screen Savers/${BRAND_NAME}.saver/Contents/Resources/boinc.tiff"
# Replace screensaver coordinator's boinc_ss_logo.png file
sudo rm -f "${PR_PATH}/Library/Screen Savers/${BRAND_NAME}.saver/Contents/Resources/boinc_ss_logo.png"
sudo cp -fp "${SAVER_LOGO}" "${PR_PATH}/Library/Screen Savers/${BRAND_NAME}.saver/Contents/Resources/boinc_ss_logo.png"
# Delete the BOINC default screensaver and its associated files
sudo rm -f "${PR_PATH}/Library/Application Support/BOINC Data/boinc_logo_black.jpg"
# Copy the Charity Engine default screensaver files into BOINC Data folder
sudo cp -fR "${SAVER_DIR}/" "${PR_PATH}/Library/Application Support/BOINC Data/"
# Copy and rename the Uninstall application's bundle and rename its executable inside the bundle
sudo cp -fpR "Uninstall BOINC.app" "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/Uninstall ${BRAND_NAME}.app"
sudo mv -f "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/Uninstall ${BRAND_NAME}.app/Contents/MacOS/Uninstall BOINC" "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/Uninstall ${BRAND_NAME}.app/Contents/MacOS/Uninstall ${BRAND_NAME}"
# Update Uninstall application's info.plist, InfoPlist.strings files
sudo sed -i "" s/BOINC/"${BRAND_NAME}"/g "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/Uninstall ${BRAND_NAME}.app/Contents/Info.plist"
sudo sed -i "" s/MacUninstaller.icns/"${UNINSTALLER_ICNS_FILE}"/g "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/Uninstall ${BRAND_NAME}.app/Contents/Info.plist"
# InfoPlist.strings file uses UTF-16 encoding
sudo chmod a+w "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/Uninstall ${BRAND_NAME}.app/Contents/Resources/English.lproj/InfoPlist.strings"
sudo iconv -f UTF-16 -t UTF-8 "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/Uninstall ${BRAND_NAME}.app/Contents/Resources/English.lproj/InfoPlist.strings" > "${PR_PATH}/tempUTF83"
sudo sed -i "" s/BOINC/"${BRAND_NAME}"/g "${PR_PATH}/tempUTF83"
sudo iconv -f UTF-8 -t UTF-16 "${PR_PATH}/tempUTF83" > "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/Uninstall ${BRAND_NAME}.app/Contents/Resources/English.lproj/InfoPlist.strings"
sudo rm -f "${PR_PATH}/tempUTF83"
# Replace the Uninstall application's MacUninstaller.icns file
sudo cp -fp "${UNINSTALLER_ICNS_FILE}" "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/Uninstall ${BRAND_NAME}.app/Contents/Resources/${UNINSTALLER_ICNS_FILE}"
sudo rm -f "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/Uninstall ${BRAND_NAME}.app/Contents/Resources/MacUninstaller.icns"
# Remove the Uninstall application's resource file so it will show generic "Are you sure?" dialog
sudo rm -f "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/Uninstall ${BRAND_NAME}.app/Contents/Resources/Uninstall BOINC.rsrc"
sudo chown -R root:admin "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/Uninstall ${BRAND_NAME}.app"
sudo chmod -R 755 "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/Uninstall ${BRAND_NAME}.app"
## Fix up ownership and permissions
sudo chown -R root:admin "${PR_PATH}"/*
sudo chmod -R u+rw,g+rw,o+r-w "${PR_PATH}"/*
sudo chmod 1775 "${PR_PATH}/Library"
sudo chown -R 501:admin "${PR_PATH}/Library/Application Support"/*
sudo chmod -R u+rw,g+r-w,o+r-w "${PR_PATH}/Library/Application Support"/*
sudo chown -R root:admin "${IR_PATH}"/*
sudo chmod -R u+rw,g+r-w,o+r-w "${IR_PATH}"/*
sudo chown -R root:admin "${SCRIPTS_PATH}"/*
sudo chmod -R u+rw,g+r-w,o+r-w "${SCRIPTS_PATH}"/*
sudo cp -fp "${IR_PATH}/ReadMe.rtf" "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/ReadMe.rtf"
sudo chown -R 501:admin "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/ReadMe.rtf"
sudo chmod -R 644 "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/ReadMe.rtf"
sudo cp -fp "COPYING" "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/COPYING.txt"
sudo chown -R 501:admin "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/COPYING.txt"
sudo chmod -R 644 "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/COPYING.txt"
sudo cp -fp "COPYRIGHT" "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/COPYRIGHT.txt"
sudo chown -R 501:admin "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/COPYRIGHT.txt"
sudo chmod -R 644 "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/COPYRIGHT.txt"
# COPYING.LESSER is part of GNU License v3
sudo cp -fp "COPYING.LESSER" "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/COPYING.LESSER.txt"
sudo chown -R 501:admin "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/COPYING.LESSER.txt"
sudo chmod -R 644 "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/COPYING.LESSER.txt"
# Make temporary copies of Pkg-Info.plist and Description.plist for PackageMaker and update for this branding
sudo cp -fp "${SOURCE_PKG_PATH}/Info.plist" "${NEW_DIR_PATH}/Pkg-Info.plist"
sudo chown -R 501:admin "${NEW_DIR_PATH}/Pkg-Info.plist"
sudo chmod -R 666 "${NEW_DIR_PATH}/Pkg-Info.plist"
if [ -f "${SOURCE_PKG_PATH}/Resources/English.lproj/Description.plist" ]; then
sudo cp -fp "${SOURCE_PKG_PATH}/Resources/English.lproj/Description.plist" "${NEW_DIR_PATH}"
else
sudo cp -fp "${SOURCE_PKG_PATH}/Resources/en.lproj/Description.plist" "${NEW_DIR_PATH}"
fi
sudo chown -R 501:admin "${NEW_DIR_PATH}/Description.plist"
sudo chmod -R 666 "${NEW_DIR_PATH}/Description.plist"
# Update Pkg-Info.plist name and ensure it is in XML format
defaults write "`pwd`/${NEW_DIR_PATH}/Pkg-Info" "CFBundleGetInfoString" "$BRAND_NAME $1.$2.$3"
plutil -convert xml1 "`pwd`/${NEW_DIR_PATH}/Pkg-Info.plist"
# Update Description.plist name and ensure it is in XML format
defaults write "`pwd`/${NEW_DIR_PATH}/Description" "IFPkgDescriptionTitle" "$MANAGER_NAME"
plutil -convert xml1 "`pwd`/${NEW_DIR_PATH}/Description.plist"
# Build the installer package
if [ "$PACKAGEMAKER_VERSION" = "3" ]; then
# Packagemaker Version 3
## /Developer/usr/bin/packagemaker -r ../BOINC_Installer/Pkg_Root -e ../BOINC_Installer/Installer\ Resources/ -s ../BOINC_Installer/Installer\ Scripts/ -f mac_build/Pkg-Info.plist -t "BOINC Manager" -n "$1.$2.$3" -b -o ../BOINC_Installer/New_Release_$1_$2_$3/boinc_$1.$2.$3_macOSX_universal/BOINC\ Installer.pkg
/Developer/usr/bin/packagemaker -r "${PR_PATH}" -e "${IR_PATH}" -s "${SCRIPTS_PATH}" -f "${NEW_DIR_PATH}/Pkg-Info.plist" -t "${MANAGER_NAME}" -n "$1.$2.$3" -b -o "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/${BRAND_NAME} Installer.pkg"
# Remove TokenDefinitions.plist and IFPkgPathMappings in Info.plist, which would cause installer to find a previous copy of ${MANAGER_NAME} and install there
sudo rm -f "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/${BRAND_NAME} Installer.pkg/Contents/Resources/TokenDefinitions.plist"
defaults delete "`pwd`/${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/${BRAND_NAME} Installer.pkg/Contents/Info" IFPkgPathMappings
else
# Packagemaker Version 2
## /Developer/Tools/packagemaker -build -p ../BOINC_Installer/New_Release_$1_$2_$3/boinc_$1.$2.$3_macOSX_universal/BOINC\ Installer.pkg -f ../BOINC_Installer/Pkg_Root -r ../BOINC_Installer/Installer\ Resources/ -i mac_build/Pkg-Info.plist -d mac_Installer/Description.plist -ds
/Developer/Tools/packagemaker -build -p "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/${BRAND_NAME} Installer.pkg" -f "${PR_PATH}" -r "${IR_PATH}" -i "${NEW_DIR_PATH}/Pkg-Info.plist" -d "${NEW_DIR_PATH}/Description.plist" -ds
fi
# Add our custom icon to installer package
ditto -xk "${INSTALLER_ICNS_FILE}" "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/${BRAND_NAME} Installer.pkg"
SetFile -a CE "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/${BRAND_NAME} Installer.pkg"
SetFile -a V "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/${BRAND_NAME} Installer.pkg/"Icon*
## for debugging
## if [ $? -ne 0 ]; then
## echo ""
## echo "********** /Pkg-Info.plist File contents: *************"
## echo ""
## cp "${NEW_DIR_PATH}/Pkg-Info.plist" /dev/stdout
## echo ""
## echo "********** End /Pkg-Info.plist File contents *************"
## echo ""
## fi
# Remove temporary copies of Pkg-Info.plist and Description.plist
sudo rm ${NEW_DIR_PATH}/Pkg-Info.plist
sudo rm ${NEW_DIR_PATH}/Description.plist
# Remove temporary directories
sudo rm -dfR "${IR_PATH}"
sudo rm -dfR "${PR_PATH}"
sudo rm -dfR "${SCRIPTS_PATH}"
# Compress the products
cd ${NEW_DIR_PATH}
## Use ditto instead of zip utility to preserve resource forks and Finder attributes (custom icon, hide extension)
ditto -ck --sequesterRsrc --keepParent "${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal" "${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal.zip"
##### We've decided not to create branded command-line executables; they are identical to standard ones
#### ditto -ck --sequesterRsrc --keepParent "${LC_BRAND_NAME}_$1.$2.$3_universal-apple-darwin" "${LC_BRAND_NAME}_$1.$2.$3_universal-apple-darwin.zip"
##### We've decided not to create branded symbol table file; it is identical to standard one
#### ditto -ck --sequesterRsrc --keepParent "${LC_BRAND_NAME}_$1.$2.$3_macOSX_SymbolTables" "${LC_BRAND_NAME}_$1.$2.$3_macOSX_SymbolTables.zip"
# Force Finder to recognize changed icons by deleting the uncompressed products and expanding the zip file
sudo rm -dfR "${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal"
open "${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal.zip"
popd
exit 0