From 566361a5597c7003cbfa71a968f9e1b03d41ba56 Mon Sep 17 00:00:00 2001 From: Robert Klep Date: Thu, 15 Nov 2018 10:22:20 +0100 Subject: [PATCH] Added installer files and updated README --- READ-ME.html => README.html | 70 +++++---- README.md | 3 +- .../Install-or-Upgrade-or-Reenable.command | 134 ++++++++++++++++++ installer/Uninstall.command | 37 +++++ 4 files changed, 207 insertions(+), 37 deletions(-) rename READ-ME.html => README.html (91%) create mode 100755 installer/Install-or-Upgrade-or-Reenable.command create mode 100755 installer/Uninstall.command diff --git a/READ-ME.html b/README.html similarity index 91% rename from READ-ME.html rename to README.html index 1da5c3d..526ec99 100644 --- a/READ-ME.html +++ b/README.html @@ -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; @@ -98,8 +102,8 @@ } code - { - background: #ccc; + { + background: #ccc; font-size: 12px; } @@ -172,38 +176,32 @@

What is it?

It also provides customized attributions for replies and forwards.

Installing the plug-in

-

- 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: -

-

- - defaults write com.apple.mail EnableBundles -bool true
- defaults write com.apple.mail BundleCompatibilityVersion -string 3 -
-

-

- Next, perform the following steps: -

-

-

- Lastly, quit Mail.app if it's running, and start it up again. -

-

- In case you run into any problems, or want to - uninstall QuoteFix, just remove QuoteFix.mailbundle from - the bundle-folder and restart Mail.app. +

    +
  1. Provide permission to "Terminal.app" for installing the QuoteFix plugin: +
      +
    • Go to "System Preferences > Security & Privacy > Privacy" +
    • Unlock if needed via clicking lower left "Lock Icon" +
    • Select "Full Disk Access or Application Data" +
    • Click the "+" icon +
    • Select "Terminal.app" and click "Add" +
    • Note: The "Terminal.app" have to be restarted for changes to take effect (if its already open). +
    +
  2. +
  3. Double click or run Install-or-Upgrade-or-Reenable.command
  4. +
  5. Enable the QuoteFix plugin in Mail.app: +
      +
    • Go to "Mail > Preferences > General" +
    • Click "Manage Plug-ins" button +
    • Check mark the "QuoteFix.mailbundle" +
    • Click "Apply and Restart Mail.app" button +
    +
  6. +
+

+ In case you run into any problems, or want to + uninstall QuoteFix, just remove QuoteFix.mailbundle from + the bundle-folder and restart Mail.app. You can also double click or + run the Uninstall.command script.

Using the plug-in

diff --git a/README.md b/README.md index 498e961..4356fb7 100644 --- a/README.md +++ b/README.md @@ -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 @@ -334,4 +335,4 @@ See also [http://sparkle.andymatuschak.org/](http://sparkle.andymatuschak.org/). Consider making a donation: -ETH: 0x93eaE7ad708EF996bdd2d03d42D10dB278E29172 +ETH: 0x93eaE7ad708EF996bdd2d03d42D10dB278E29172 diff --git a/installer/Install-or-Upgrade-or-Reenable.command b/installer/Install-or-Upgrade-or-Reenable.command new file mode 100755 index 0000000..f833c8b --- /dev/null +++ b/installer/Install-or-Upgrade-or-Reenable.command @@ -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 + diff --git a/installer/Uninstall.command b/installer/Uninstall.command new file mode 100755 index 0000000..55d2507 --- /dev/null +++ b/installer/Uninstall.command @@ -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