Skip to content

Commit

Permalink
[macos] improve installer for backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
thantthet committed Sep 27, 2019
1 parent 0f46fdd commit d19099c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
2 changes: 1 addition & 1 deletion OSX/package/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
IDENTITY_APP = "Developer ID Application: H T KHIN ZAW (YQ4W4QMX9D)"
IDENTITY_INSTALLER = "Developer ID Installer: H T KHIN ZAW (YQ4W4QMX9D)"
ROOT_DIR = "/tmp/KeyMagic.dst"
VERSION = "1.5.3"
VERSION = "1.5.4"
all: clean copy
pkgbuild \
--root $(ROOT_DIR) \
Expand Down
37 changes: 34 additions & 3 deletions OSX/package/distribution.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,39 @@
<license file="gpl-2.0.txt" mime-type="text/plain"></license>
<conclusion file="summary.txt" mime-type="text/plain"></conclusion>

<domains enable_anywhere="false" enable_currentUserHome="true" enable_localSystem="false"></domains>

<domains enable_anywhere="false" enable_currentUserHome="true" enable_localSystem="isNotCatalina();"></domains>
<installation-check script="installationCheck();"></installation-check>
<localization>
<strings language="en">
<![CDATA[
"SU_ERROR" = "Error";
"SYSTEM_KEYMAGIC" = "Catalina no longer support installing in system volume and previous version of KeyMagic is found in system volume. Please run this command in Terminal: \n\nsudo rm -rf /Library/Input\\ Methods/KeyMagic.app\n\n Then run this installer again.";
]]>
</strings>
</localization>
<script>
<![CDATA[
function isCatalina() {
return system.compareVersions(system.version.ProductVersion, '10.15') >= 0;
}
function isNotCatalina() {
return !isCatalina();
}
function installationCheck() {
if (isNotCatalina()) { return true; }
if (systemKeyMagicExists()) {
my.result.title = system.localizedString('SU_ERROR');
my.result.message = system.localizedString('SYSTEM_KEYMAGIC');
my.result.type = 'Fatal';
return false;
}
return true;
}
function systemKeyMagicExists() {
return system.files.fileExistsAtPath('/Library/Input Methods/KeyMagic.app');
}
]]>
</script>

<allowed-os-versions>
<os-version min="10.7"></os-version>
Expand All @@ -24,7 +55,7 @@
<choice id="org.keymagic.pkg.app" visible="false">
<pkg-ref id="org.keymagic.pkg.app"/>
</choice>
<pkg-ref id="org.keymagic.pkg.app" version="1.5.3" onConclusion="RequireLogout">app.pkg</pkg-ref>
<pkg-ref id="org.keymagic.pkg.app" version="1.5.4" onConclusion="RequireLogout">app.pkg</pkg-ref>
<pkg-ref id="org.keymagic.pkg.app">
<must-close>
<app id="org.keymagic.inputmethod.KeyMagic"/>
Expand Down
4 changes: 2 additions & 2 deletions OSX/package/readme.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
What's new in Version 1.5.2 -
1. Minor fixes
What's new in Version 1.5.4 -
1. Improved Installer

Included Keyboard Layouts -
1. Pyidaungsu MM
Expand Down

0 comments on commit d19099c

Please sign in to comment.