Skip to content

Commit

Permalink
Added installer files and updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
robertklep committed Nov 15, 2018
1 parent ee8bdf1 commit 566361a
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 37 deletions.
70 changes: 34 additions & 36 deletions READ-ME.html → README.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,20 @@
a[name] { color: inherit !important }
a[name]:hover { text-decoration: none }

ul, p, table
ul, ol, p, table
{
width : 80%;
}

ul
ul, ol
{
margin : 1em auto;
}

ol ul {
margin-left : 0 !important;
}

ul.toc, ul.toc li
{
list-style : none;
Expand Down Expand Up @@ -98,8 +102,8 @@
}

code
{
background: #ccc;
{
background: #ccc;
font-size: 12px;
}

Expand Down Expand Up @@ -172,38 +176,32 @@ <h2><a name="what">What is it?</a></h2>
It also provides customized attributions for replies and forwards.
</p>
<h2><a name="installing">Installing the plug-in</a></h2>
<p>
Before installing the plug-in, you'll need to make sure that
Mail.app's plug-in support is turned on. For this, execute the
following two commands in Terminal.app:
</p>
<p>
<code>
defaults write com.apple.mail EnableBundles -bool true<br/>
defaults write com.apple.mail BundleCompatibilityVersion -string 3
</code>
</p>
<p>
Next, perform the following steps:
<ul>
<li>Download the plugin if you haven't done so already</li>
<li>Navigate in Finder to <code>~/Library/Mail/</code><br/>
<i>(where <b>~</b> means: your home directory)</i>
</li>
<li>
If a <code>Bundles</code> folder doesn't yet exist, create an
empty one
</li>
<li>Extract the downloaded ZIP file and copy <code>QuoteFix.mailbundle</code> into the <code>Bundles</code> folder</li>
</ul>
</p>
<p>
Lastly, quit Mail.app if it's running, and start it up again.
</p>
<p>
<a name="uninstall">In case you run into any problems</a>, or want to
uninstall QuoteFix, just remove <code>QuoteFix.mailbundle</code> from
the bundle-folder and restart Mail.app.
<ol>
<li> Provide permission to "Terminal.app" for installing the QuoteFix plugin:
<ul>
<li>Go to "System Preferences &gt; Security &amp; Privacy &gt; Privacy"
<li>Unlock if needed via clicking lower left "Lock Icon"
<li>Select "Full Disk Access or Application Data"
<li>Click the "+" icon
<li>Select "Terminal.app" and click "Add"
<li>Note: The "Terminal.app" have to be restarted for changes to take effect (if its already open).
</ul>
</li>
<li>Double click or run <code>Install-or-Upgrade-or-Reenable.command</code></li>
<li>Enable the QuoteFix plugin in Mail.app:
<ul>
<li>Go to "Mail &gt; Preferences &gt; General"
<li>Click "Manage Plug-ins" button
<li>Check mark the "QuoteFix.mailbundle"
<li>Click "Apply and Restart Mail.app" button
</ul>
</li>
</ol>
<p>
<a name="uninstall">In case you run into any problems</a>, or want to
uninstall QuoteFix, just remove <code>QuoteFix.mailbundle</code> from
the bundle-folder and restart Mail.app. You can also double click or
run the <code>Uninstall.command</code> script.
</p>
<h2><a name="using">Using the plug-in</a></h2>
<p>
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ However, do keep submitting bug reports. I'll try and fix them as fast as I can.

The latest release can always be found [here](https://github.com/robertklep/quotefixformac/releases/).

* [v2.10.0-alpha.1](https://github.com/robertklep/quotefixformac/releases/tag/v2.10.0-alpha.1): Mojave support
* [v2.9.0](https://github.com/robertklep/quotefixformac/releases/tag/v2.9.0): Official 2.9.0 release
* [v2.9.0-alpha.1](https://github.com/robertklep/quotefixformac/releases/tag/v2.9.0-alpha.1): High Sierra support
* [v2.8.0](https://github.com/robertklep/quotefixformac/releases/tag/v2.8.0): Official 2.8.0 release
Expand Down Expand Up @@ -334,4 +335,4 @@ See also [http://sparkle.andymatuschak.org/](http://sparkle.andymatuschak.org/).

Consider making a donation: <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4UF2KB2BTW6AC"><img style="vertical-align:middle" src="https://www.paypalobjects.com/en_GB/i/btn/btn_donate_SM.gif"></a>

ETH: 0x93eaE7ad708EF996bdd2d03d42D10dB278E29172
ETH: 0x93eaE7ad708EF996bdd2d03d42D10dB278E29172
134 changes: 134 additions & 0 deletions installer/Install-or-Upgrade-or-Reenable.command
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
#!/bin/sh

#
# Install-or-Upgrade-or-Reenable.command
# QuoteFix
#
# Created by Jeevanandam M. on 10/9/13.
# Modified by Robert Klep to work with QuoteFix on 15-11-2018
#
# Revision
# 1.0 Created an initial installer script
# 1.1 Added dynamic UUID processing and few enhancements
# 1.2 Revising enable plugin logic
# 1.3 Improved OS X version print and added color support to highlight text
# 1.4 Added support for Mac OS Sierra
# 1.5 Added support for Mac OS High Sierra
# 1.6 Added support for macOS Mojave
# 1.7 Install QuoteFix
#

mh_current_dir=`dirname "$0"`
mh_user=${USER}
mh_install_path=${HOME}/Library/Mail/Bundles
mh_plugin=${mh_install_path}/QuoteFix.mailbundle/
mh_plugin_plist=${mh_current_dir}/QuoteFix.mailbundle/Contents/Info.plist

CC='\033[00m'
RCB='\033[01;31m'
GCB='\033[01;32m'
RC='\033[31m'
GC='\033[32m'
WC='\033[37m'
RCWHB='\033[1;31;43;5m'
BOLD='\033[1m'

echo "\n\nQF:: Starting installation..."
echo "QF:: Mail Plugin - ${BOLD}QuoteFix${CC}"

mh_mac_osx_version_p=`sw_vers -productVersion | cut -d . -f 1,2,3`
mh_mac_osx_version=`sw_vers -productVersion | cut -d . -f 1,2`
echo "QF:: Mac OS X version: ${mh_mac_osx_version_p}"

mh_mail_version=$(defaults read /Applications/Mail.app/Contents/Info CFBundleShortVersionString)
mh_mail_build_version=$(defaults read /Applications/Mail.app/Contents/Info CFBundleVersion)
echo "QF:: Mail.app ${mh_mail_version} [Build ${mh_mail_build_version}]"

if [ ! -e ${mh_install_path} ]; then
echo "QF:: '${mh_install_path}' directory not exists, creating one"
mkdir -p "${mh_install_path}"
fi

mh_enable_plugin=1
mh_enb_success=0
if [ ${mh_user} == root ] ; then
echo "QF:: Root users is installing plugin"
domain=/Library/Preferences/com.apple.mail.plist
else
echo "QF:: user '${mh_user}' is installing plugin"
domain=/Users/${mh_user}/Library/Containers/com.apple.mail/Data/Library/Preferences/com.apple.mail.plist
fi

if [ ${mh_enable_plugin} -eq 1 ]; then
if [ -f ${domain} ]; then
echo "QF:: Enabling plugin support in Mail.app"
defaults write "${domain}" EnableBundles -bool true
mh_enb_success=1
fi

if [ ${mh_enb_success} -eq 0 ]; then
domain=/Users/${mh_user}/Library/Preferences/com.apple.mail.plist
defaults write "${domain}" EnableBundles -bool true
fi
echo "QF:: Domain is ${domain}"
fi

if [ -f /Applications/Mail.app/Contents/Info.plist ]; then
mh_mail_app_uuid=$(defaults read /Applications/Mail.app/Contents/Info.plist PluginCompatibilityUUID)
if [[ ! -z "${mh_mail_app_uuid}" ]]; then
echo "QF:: Adding UUID ${mh_mail_app_uuid}"
if [[ ${mh_mac_osx_version_p} == *"10.14"* ]]; then
defaults write "${mh_plugin_plist}" Supported10.14PluginCompatibilityUUIDs -array-add "${mh_mail_app_uuid}"
elif [[ ${mh_mac_osx_version_p} == *"10.13"* ]]; then
defaults write "${mh_plugin_plist}" Supported10.13PluginCompatibilityUUIDs -array-add "${mh_mail_app_uuid}"
elif [[ ${mh_mac_osx_version_p} == *"10.12"* ]]; then
defaults write "${mh_plugin_plist}" Supported10.12PluginCompatibilityUUIDs -array-add "${mh_mail_app_uuid}"
else
defaults write "${mh_plugin_plist}" SupportedPluginCompatibilityUUIDs -array-add "${mh_mail_app_uuid}"
fi
fi
fi

# for issue #66 - Version check condition updated
mh_ver_chk=$(echo "${mh_mac_osx_version} == 10.7 || ${mh_mac_osx_version} == 10.8" | bc)
if [ ${mh_ver_chk} -eq 1 ]; then
if [ -f /System/Library/Frameworks/Message.framework/Resources/Info.plist ]; then
mh_msg_frwk_uuid=$(defaults read /System/Library/Frameworks/Message.framework/Resources/Info.plist PluginCompatibilityUUID)
if [[ ! -z "${mh_msg_frwk_uuid}" ]]; then
echo "QF:: Adding UUID ${mh_msg_frwk_uuid}"
defaults write "${mh_plugin_plist}" SupportedPluginCompatibilityUUIDs -array-add "${mh_msg_frwk_uuid}"
fi
fi
fi

if [ -s ${mh_plugin} ]; then
# mh_enable_plugin=0
echo "\nQF:: Plugin is already installed, let's upgrade it"
rm -rf "${mh_plugin}"
else
echo "\nQF:: Installing QuoteFix Mail plugin"
fi

# copy the QF plugin
yes | cp -rf "${mh_current_dir}/QuoteFix.mailbundle" "${mh_install_path}"

# for issue #48 - Resolve Permission Issue while installed by Root user
if [ ${mh_user} == root ] ; then
mh_cur_user_name=${HOME##*/}
echo "QF:: Applying appropriate file permission for user '${mh_cur_user_name}'"
chown -R ${mh_cur_user_name} "${mh_install_path}"
chmod -R 755 "${mh_install_path}"
fi

yes | rm -rf "${HOME}/Library/Mail/Bundles (Disabled)/QuoteFix.mailbundle"

echo "QF:: Installation complete"

if [[ ${mh_mac_osx_version_p} == *"10.14"* ]]; then
echo "\nQF:: ${GCB}Plugin copied into '${HOME}/Library/Mail/Bundles'${CC}. Follow the \"Step 3\" from \"Install-Instructions-Mojave-OS-and-Above.txt\"\n\n"
else
echo "\n========================================================="
echo " ${GCB}QF Plugin successfully installed${CC}, ${RCWHB} restart Mail.app ${CC} "
echo "=========================================================\n\n"
fi

37 changes: 37 additions & 0 deletions installer/Uninstall.command
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh

# Uninstall.command
# QuoteFix
#
# Created by Jeevanandam M. on 10/9/13.
# Modified by Robert Klep to work with QuoteFix on 15-11-2018
#

mh_plugin=${HOME}/Library/Mail/Bundles/QuoteFix.mailbundle

echo "\n\nUninstalling QuoteFix plugin"
echo "==================================="
if [ -s ${mh_plugin} ]; then
confirm="input"
until [[ ${confirm} =~ (y|Y) || ${confirm} =~ (N) ]]
do
echo "\nAre you sure want to uninstall? [y/N]"
read confirm
done

case ${confirm} in
y|Y)
echo "Proceeding Uninstall of 'QuoteFix' plugin...";
rm -rf ${mh_plugin};
echo "\n====================================================="
echo " Plugin uninstallation completed, restart Mail.app "
echo "====================================================="
;;
N)
echo "Aborting operation as per user choice... see ya..." ;
exit 0
;;
esac
else
echo "\nQuoteFix plugin is not installed."
fi

0 comments on commit 566361a

Please sign in to comment.