head	1.20;
access;
symbols
	release-2-3-0-final:1.20
	release-2-2-6-final:1.16
	release-2-2-5-final:1.16
	release-2-2-4-final:1.16
	release-2-2-3-final:1.15
	release-2-2-2-final:1.15
	release-2-2-0-final:1.15
	release-2-1-0-rc3:1.15
	release-2-1-0-rc2:1.13
	release-2-1-0-rc1:1.7
	release-2-0-1-beta2:1.6
	release-2-0-1-beta1:1.6;
locks; strict;
comment	@# @;


1.20
date	2004.03.10.00.02.08;	author nwhitehorn;	state Exp;
branches;
next	1.19;

1.19
date	2004.03.09.23.11.04;	author nwhitehorn;	state Exp;
branches;
next	1.18;

1.18
date	2004.03.09.21.04.52;	author nwhitehorn;	state Exp;
branches;
next	1.17;

1.17
date	2004.03.09.20.31.40;	author nwhitehorn;	state Exp;
branches;
next	1.16;

1.16
date	2003.09.22.22.57.33;	author agmsmith;	state Exp;
branches;
next	1.15;

1.15
date	2003.07.11.13.21.20;	author agmsmith;	state Exp;
branches;
next	1.14;

1.14
date	2003.07.08.22.13.28;	author agmsmith;	state Exp;
branches;
next	1.13;

1.13
date	2003.07.07.18.03.23;	author agmsmith;	state Exp;
branches;
next	1.12;

1.12
date	2003.07.02.21.45.19;	author agmsmith;	state Exp;
branches;
next	1.11;

1.11
date	2003.07.02.20.37.41;	author agmsmith;	state Exp;
branches;
next	1.10;

1.10
date	2003.07.02.20.30.46;	author agmsmith;	state Exp;
branches;
next	1.9;

1.9
date	2003.07.02.20.02.28;	author agmsmith;	state Exp;
branches;
next	1.8;

1.8
date	2003.06.27.20.04.02;	author agmsmith;	state Exp;
branches;
next	1.7;

1.7
date	2003.06.26.18.10.46;	author nwhitehorn;	state Exp;
branches;
next	1.6;

1.6
date	2003.02.18.17.28.53;	author agmsmith;	state Exp;
branches;
next	1.5;

1.5
date	2003.02.17.14.44.21;	author agmsmith;	state Exp;
branches;
next	1.4;

1.4
date	2003.02.16.20.55.00;	author agmsmith;	state Exp;
branches;
next	1.3;

1.3
date	2003.02.14.19.40.49;	author agmsmith;	state Exp;
branches;
next	1.2;

1.2
date	2003.02.14.19.30.00;	author agmsmith;	state Exp;
branches;
next	1.1;

1.1
date	2003.02.14.18.32.08;	author agmsmith;	state Exp;
branches;
next	;


desc
@@


1.20
log
@FINALLY got the icon stuff working.
@
text
@#!/bin/sh

cd "$(dirname "$0")"

if pwd | grep " ";
  then alert "ディレクトリ名に空白を含めないでください。
インストールが正常にできません。
/boot/home/mydirectoryのように
空白を含まないディレクトリに
内容を移動してください。";
  exit 1;
fi

RETURN=`alert "Mail Daemon Replacementインストール

BeOSのメールデーモンは
システムに一つしか存在できません。
（理由はREADMEをお読みください）

「Purge」：
　保存しません
「Backup」：
　MDRを初めてインストールする時に、
　古いメールデーモン
　(mail_daemon/libmail.so/BeMail/E-mail)を
　保存します。
　（2回目以降は選択しないでください）
「Don't do anything!」：
　インストールを中止します。" "Purge" "Backup" "Abort - Don't do anything!"`

if [[ $RETURN = Purge ]]
then
	# note: we don't remove libmail.so, because it doesn't matter here, and there may be symlinks and things
	query -a 'BEOS:APP_SIG == "application/x-vnd.Be-POST" || BEOS:APP_SIG == "application/x-vnd.Be-mprf" || BEOS:APP_SIG == "application/x-vnd.Be-MAIL" || BEOS:APP_SIG == "application/x-vnd.agmsmith.AGMSBayesianSpamServer"' | grep -v "`/bin/pwd`" | xargs rm -f
elif [[ $RETURN = Backup ]]
then
	query -a 'BEOS:APP_SIG == "application/x-vnd.Be-POST" || BEOS:APP_SIG == "application/x-vnd.Be-mprf" || BEOS:APP_SIG == "application/x-vnd.Be-MAIL" || BEOS:APP_SIG == "application/x-vnd.agmsmith.AGMSBayesianSpamServer" || name == libmail.so' | grep -v "`/bin/pwd`" | xargs zip -ym /boot/home/maildaemon.zip
else
	alert "Mail Daemon Replacementインストール
	
　バックアップを作成しませんでした。
　現在のバージョンが唯一のメールデーモンとなります。"
	exit -1
fi

# This should be translated
if [[ `uname -m` == BePC ]] && test ! -e ~/config/lib/libssl.so; then

RETURN=`alert "You don't seem to have OpenSSL installed, which is required for IMAP." "Get OpenSSL" "I Don't Care"`

if [[ $RETURN = "Get OpenSSL" ]]
then
	NetPositive http://www.bebits.com/app/1020 &
fi

fi

quit "application/x-vnd.Be-POST"
quit "application/x-vnd.Be-TSKB"
quit "application/x-vnd.agmsmith.AGMSBayesianSpamServer"

rm -rf ~/config/add-ons/mail_daemon/*
rm -f /system/servers/mail_daemon /boot/beos/preferences/E-mail /boot/beos/apps/BeMail
rm -f ~/config/lib/libmail2.so ~/config/lib/libnumail2.so /system/lib/libmail.so
rm -f "${HOME}/config/settings/Mail/New E-mail"
rm -f "${HOME}/config/settings/Mail/Menu Links/T) 本日のメール"

mkdir -p ~/config/add-ons/mail_daemon

copyattr -d -m bin/libmail.so /boot/beos/system/lib/libmail.so
copyattr -d -m bin/libcrypto.so /boot/home/config/lib/libcrypto.so
copyattr -d -m bin/libssl.so /boot/home/config/lib/libssl.so
copyattr -d -m -r bin/addons/* ~/config/add-ons/mail_daemon
copyattr -d -m bin/mail_daemon /system/servers/mail_daemon
copyattr -d -m bin/E-mail /boot/beos/preferences/E-mail
copyattr -d -m bin/BeMail /boot/beos/apps/BeMail

# Set up the files in the Menu Links directory.  They will appear in the pop-up
# menu in the deskbar.  Overwrite existing ones, and remove ones in the wrong
# language (left over from previous installs).  But don't delete any other ones
# that the user may have custom made.
mkdir -p ~/config/settings/Mail/Menu\ Links
unzip -o bin/ExtraMenuLinksForR5Tracker.zip -d ~/config/settings/Mail/Menu\ Links
rm bin/ExtraMenuLinksForR5Tracker.zip
mv -f -v "${HOME}/config/settings/Mail/Menu Links/E-Mail From…" "${HOME}/config/settings/Mail/Menu Links/F) 送信者を検索…"
mv -f -v "${HOME}/config/settings/Mail/Menu Links/Open Draft" "${HOME}/config/settings/Mail/Menu Links/D) ドラフトを開く…"
mv -f -v "${HOME}/config/settings/Mail/Menu Links/Open Inbox Folder" "${HOME}/config/settings/Mail/Menu Links/I) 受信箱を開く"
mv -f -v "${HOME}/config/settings/Mail/Menu Links/Open Mail Folder" "${HOME}/config/settings/Mail/Menu Links/M) 郵便箱を開く"
mv -f -v "${HOME}/config/settings/Mail/Menu Links/Subject Contains…" "${HOME}/config/settings/Mail/Menu Links/S) 見出しで検索…"
mv -f -v "${HOME}/config/settings/Mail/Menu Links/Received Today" "${HOME}/config/settings/Mail/Menu Links/R) 本日受信したメール"
mv -f -v "${HOME}/config/settings/Mail/Menu Links/Sent Today" "${HOME}/config/settings/Mail/Menu Links/T) 本日送信したメール"

# Set up the spam classifier server.
copyattr -d -m bin/AGMSBayesianSpamServer ~/config/bin/AGMSBayesianSpamServer
mkdir -p ~/config/settings/AGMSBayesianSpam
if test ! -e "${HOME}/config/settings/AGMSBayesianSpam/AGMSBayesianSpam Database"; then
    cp bin/SampleSpamDatabase "${HOME}/config/settings/AGMSBayesianSpam/AGMSBayesianSpam Database";
fi
copyattr -d -m bin/SoundGenuine "${HOME}/config/settings/AGMSBayesianSpam/SoundGenuine"
copyattr -d -m bin/SoundSpam "${HOME}/config/settings/AGMSBayesianSpam/SoundSpam"
copyattr -d -m bin/SoundUncertain "${HOME}/config/settings/AGMSBayesianSpam/SoundUncertain"

# Patch up things that need Japanese names.  Do it here before the daemon is
# started.  A link (rather than renaming) is done so that saved chain settings,
# which use the file names of the add-ons, will still work if they were made in
# English mode.  Also done in the English version, in case someone was using
# Japanese and switched back to English.
ln -f -s -v "${HOME}/config/add-ons/mail_daemon/system_filters/Inbox" "${HOME}/config/add-ons/mail_daemon/system_filters/受信箱"
ln -f -s -v "${HOME}/config/add-ons/mail_daemon/system_filters/Outbox" "${HOME}/config/add-ons/mail_daemon/system_filters/送信箱"
ln -f -s -v "${HOME}/config/add-ons/mail_daemon/system_filters/New Mail Notification" "${HOME}/config/add-ons/mail_daemon/system_filters/着信通知方法"

# Various fixups...

# The word index files sometimes go corrupt.  Since they are regenerated if
# they aren't there, this is fixed by just deleting the whole annoying
# directory.
rm -r /boot/beos/etc/word_index/

# The old installer used to delete the developer's link to the libmail.so
# library, so put it back.  Do for x86 and ppc, will do nothing if you don't
# have that development system installed (ln will fail harmlessly).  Won't work
# if you have both PPC and x86 development systems.
if test -e "/boot/develop/lib/x86/libmail.so";	then
	echo "/boot/develop/lib/x86/libmail.so already exists, no need to fix.";
else
	ln -s /boot/beos/system/lib/libmail.so /boot/develop/lib/x86/libmail.so
fi
if test -e "/boot/develop/lib/ppc/libmail.so";	then
	echo "/boot/develop/lib/ppc/libmail.so already exists, no need to fix.";
else
	ln -s /boot/beos/system/lib/libmail.so /boot/develop/lib/ppc/libmail.so
fi

# Force the MIME database to reload the icons and other application info, since
# it doesn't do it automatically and we sometimes add new icons.
setmime -remove application/x-vnd.Be-POST; mimeset /system/servers/mail_daemon
setmime -remove application/x-vnd.Be-MAIL; mimeset /boot/beos/apps/BeMail
mimeset ~/config/bin/AGMSBayesianSpamServer

setmime -set text/x-email -preferredApp /boot/beos/apps/BeMail -preferredAppSig application/x-vnd.Be-MAIL
setmime -set text/x-vnd.be-maildraft -preferredApp /boot/beos/apps/BeMail -preferredAppSig application/x-vnd.Be-MAIL
setmime -set text/x-partial-email -preferredApp /boot/beos/system/servers/mail_daemon -preferredAppSig application/x-vnd.Be-POST

sleep 1
/system/Deskbar &
sleep 1
/system/servers/mail_daemon -M &
sleep 2

# Create the MIME types and indices needed by the spam server.  Note that it
# modifies the e-mail type by adding attributes to it, so we have to wait until
# the daemon has started and created the text/x-email MIME type entry.
~/config/bin/AGMSBayesianSpamServer InstallThings

sync
alert "Mail Daemon Replacementインストール

　インストールが完了しました。
　再インストールする際は再度
　パッケージの解凍から行ってください。"

# Launch prefs if this is a new install of MDR
if test !  -e "/boot/home/config/settings/Mail/chains";	then
	/boot/beos/preferences/E-mail &
fi

# Prevent a second attempt to install since all our source files have been moved / deleted.
echo "This one use install script will now self destruct..."
rm install.japanese.sh
@


1.19
log
@Finished removing OpenSSL dependence. Added alert box if people don't have OpenSSL, with a button to take them to OpenSSL's BeBits page.
@
text
@d136 2
a137 4
rm ~/config/settings/beos_mime/text/x-partial-email ~/config/settings/beos_mime/text/x-email ~/config/settings/beos_mime/text/x-vnd.be-maildraft
# Remove this to deal with previous misconfiguration of the filetype
mimeset /system/servers/mail_daemon
mimeset /boot/beos/apps/BeMail
d140 4
@


1.18
log
@Fixed a bug with icons
@
text
@d46 12
@


1.17
log
@Updated install scripts to include OpenSSL in the package, changed version number to 2.3.0, included Stefano's new icons, because they rock, updated the install script to not prevent the creation of the x-partial-email type with an icon, and added in some relevant copyright notices.
@
text
@d124 1
a124 1
rm ~/config/settings/beos_mime/text/x-partial-email
d126 3
a128 3
mimeset -F -apps /system/servers/mail_daemon
mimeset -F -apps /boot/beos/apps/BeMail
mimeset -F -apps ~/config/bin/AGMSBayesianSpamServer
@


1.16
log
@Change Don't do Anything wording to make it more obvious.
@
text
@d59 2
d124 2
@


1.15
log
@Updated to use new Japanese wording for the menu link queries.
@
text
@d29 1
a29 1
　インストールを中止します。" "Purge" "Backup" "Don't do anything!"`
@


1.14
log
@Split the Today's Mail query into two parts, Received Today and
Sent Today.  The date also changed from %today% to %last day%.
@
text
@d53 2
a54 1
rm -f "/boot/home/config/settings/Mail/New E-mail"
d76 2
a77 1
mv -f -v "${HOME}/config/settings/Mail/Menu Links/Received Today" "${HOME}/config/settings/Mail/Menu Links/R) 本日のメール"
@


1.13
log
@Keep self destruct last in file.
@
text
@d75 1
a75 1
mv -f -v "${HOME}/config/settings/Mail/Menu Links/Today's E-Mail" "${HOME}/config/settings/Mail/Menu Links/T) 本日のメール"
@


1.12
log
@After much hacking around, with the BMimeType IsInstalled() not working
right (says it is but it isn't), we now use a command line argument and
the BMimeType.Delete function to wipe out the old MIME types rather than
trying to fiddle with files in the mime database.
@
text
@d142 5
@


1.11
log
@Oops, forgot the Spam database type, can be reset too.
@
text
@a123 8
# The daemon will reinstall the MIME type correctly if it isn't there.  This
# also removes some cruft that accumulates in the MIME database - the related
# attributes to display list sometimes gets a bit large and out of sync in the
# different columns.
rm ~/config/settings/beos_mime/text/x-email
rm ~/config/settings/beos_mime/text/x-partial-email
rm ~/config/settings/beos_mime/text/x-vnd.agmsmith.spam_probability_database

d127 1
a127 1
/system/servers/mail_daemon &
@


1.10
log
@Also refresh the text/x-email MIME type.
@
text
@d130 1
@


1.9
log
@Fix up MIME database to show new icons etc.
@
text
@a85 2
# Create the MIME types and indices needed by the spam server.
~/config/bin/AGMSBayesianSpamServer InstallThings
d97 1
d102 2
a103 1
# And the old installer used to delete the developer's link to the libmail.so
d105 2
a106 1
# have that development system installed (ln will fail harmlessly).
d124 5
a128 1
# The daemon will reinstall the MIME type correctly if it isn't there.
d135 6
@


1.8
log
@Have installer wipe out the word index directory and create the
symbolic link to the library for developers.
@
text
@d109 1
a109 1
	ln -v -s /boot/beos/system/lib/libmail.so /boot/develop/lib/x86/libmail.so
d114 1
a114 1
	ln -v -s /boot/beos/system/lib/libmail.so /boot/develop/lib/ppc/libmail.so
d116 9
@


1.7
log
@Fixed the partial message query bug on update installs.
@
text
@d98 19
@


1.6
log
@Remove menu links left over from previous installs in other languages.
@
text
@d53 1
@


1.5
log
@Japanese translations for Menu Links entries.
@
text
@d62 4
d67 1
a67 1
unzip -n bin/ExtraMenuLinksForR5Tracker.zip -d ~/config/settings/Mail/Menu\ Links
@


1.4
log
@More Japanese translations.
@
text
@d65 6
@


1.3
log
@Also include Japanese symbolic links in English version, just in case.
@
text
@d85 1
a85 1
ln -f -s -v "${HOME}/config/add-ons/mail_daemon/system_filters/New Mail Notification" "${HOME}/config/add-ons/mail_daemon/system_filters/郵便通告方法"
@


1.2
log
@Now with Japanese system filter names.
@
text
@d81 2
a82 1
# English mode.
@


1.1
log
@Japanese language version of the install script.
@
text
@d43 1
d77 8
@

