PKG // Upgrade post-installation script to fix wrong installations.
This commit is contained in:
parent
db03d3b8a8
commit
cbe92d84f2
|
@ -1,2 +1,18 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
~/Library/Input\ Methods/vChewing.app/Contents/MacOS/vChewing install --all
|
loggedInUser=$(stat -f%Su /dev/console)
|
||||||
|
|
||||||
|
# First, copy the wrongfully installed contents to the right location:
|
||||||
|
cp -r /Library/Input\ Methods/vChewing.app /Users/$(stat -f%Su /dev/console)/Library/Input\ Methods/ || true
|
||||||
|
cp -r /Library/Keyboard\ Layouts/vChewing* /Users/$(stat -f%Su /dev/console)/Library/Keyboard\ Layouts/ || true
|
||||||
|
chown "$loggedInUser" /Users/$(stat -f%Su /dev/console)/Library/Input\ Methods/vChewing.app || true
|
||||||
|
chown "$loggedInUser" /Users/$(stat -f%Su /dev/console)/Library/Keyboard\ Layouts/vChewing* || true
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
# Second, clean the wrongfully installed contents:
|
||||||
|
rm -rf /Library/Input\ Methods/vChewing.app || true
|
||||||
|
rm -rf /Library/Keyboard\ Layouts/vChewing* || true
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
# Finally, register the input method:
|
||||||
|
/Users/$(stat -f%Su /dev/console)/Library/Input\ Methods/vChewing.app/Contents/MacOS/vChewing install --all || true
|
||||||
|
|
|
@ -1,5 +1,18 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
killall vChewing
|
loggedInUser=$(stat -f%Su /dev/console)
|
||||||
|
|
||||||
|
killall vChewing || true
|
||||||
|
|
||||||
|
if [ "$loggedInUser" = root ]; then
|
||||||
|
rm -rf /Library/Input\ Methods/vChewing.app || true
|
||||||
|
rm -rf /Library/Keyboard\ Layouts/vChewingKeyLayout.bundle || true
|
||||||
|
rm -rf /Library/Keyboard\ Layouts/vChewing\ Dachen.keylayout || true
|
||||||
|
rm -rf /Library/Keyboard\ Layouts/vChewing\ ETen.keylayout || true
|
||||||
|
rm -rf /Library/Keyboard\ Layouts/vChewing\ FakeSeigyou.keylayout || true
|
||||||
|
rm -rf /Library/Keyboard\ Layouts/vChewing\ IBM.keylayout || true
|
||||||
|
rm -rf /Library/Keyboard\ Layouts/vChewing\ MiTAC.keylayout || true
|
||||||
|
fi
|
||||||
|
|
||||||
rm -rf ~/Library/Input\ Methods/vChewing.app
|
rm -rf ~/Library/Input\ Methods/vChewing.app
|
||||||
rm -rf ~/Library/Keyboard\ Layouts/vChewingKeyLayout.bundle
|
rm -rf ~/Library/Keyboard\ Layouts/vChewingKeyLayout.bundle
|
||||||
rm -rf ~/Library/Keyboard\ Layouts/vChewing\ Dachen.keylayout
|
rm -rf ~/Library/Keyboard\ Layouts/vChewing\ Dachen.keylayout
|
||||||
|
|
Loading…
Reference in New Issue