From c777c8d9aa7cd5c2e9a399727a7fa9985a77fb1c Mon Sep 17 00:00:00 2001 From: sjaz Date: Thu, 1 Jan 2009 12:00:20 +0000 Subject: Anope Stable Branch git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1902 5417fbe8-f217-4b02-8779-1006273d7864 --- src/tools/Anope_Install_Script.nsi | 540 ++++++++ src/tools/Anope_MySQL_Install_Script.nsi | 542 ++++++++ src/tools/Makefile | 39 + src/tools/Makefile.win32 | 29 + src/tools/README | 58 + src/tools/anopesmtp.c | 604 +++++++++ src/tools/db-merger.c | 2031 ++++++++++++++++++++++++++++++ src/tools/epona2anope.c | 856 +++++++++++++ src/tools/smtp.h | 130 ++ 9 files changed, 4829 insertions(+) create mode 100644 src/tools/Anope_Install_Script.nsi create mode 100644 src/tools/Anope_MySQL_Install_Script.nsi create mode 100644 src/tools/Makefile create mode 100644 src/tools/Makefile.win32 create mode 100644 src/tools/README create mode 100644 src/tools/anopesmtp.c create mode 100644 src/tools/db-merger.c create mode 100644 src/tools/epona2anope.c create mode 100644 src/tools/smtp.h (limited to 'src/tools') diff --git a/src/tools/Anope_Install_Script.nsi b/src/tools/Anope_Install_Script.nsi new file mode 100644 index 000000000..633a4aa19 --- /dev/null +++ b/src/tools/Anope_Install_Script.nsi @@ -0,0 +1,540 @@ +; Script generated by the HM NIS Edit Script Wizard. + +; HM NIS Edit Wizard helper defines +!define PRODUCT_NAME "Anope IRC Services" +!define PRODUCT_VERSION "1.8.0" +!define PRODUCT_PUBLISHER "Anope" +!define PRODUCT_WEB_SITE "http://www.anope.org" +!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\anope.exe" +!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" +!define PRODUCT_UNINST_ROOT_KEY "HKLM" + +; MUI 1.67 compatible ------ +!include "MUI.nsh" + +; MUI Settings +!define MUI_ABORTWARNING +!define MUI_ICON "anope-icon.ico" +!define MUI_UNICON "anope-icon.ico" + +; Language Selection Dialog Settings +!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}" +!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}" +!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language" + +; Welcome page +!insertmacro MUI_PAGE_WELCOME +; License page +!define MUI_LICENSEPAGE_RADIOBUTTONS +!insertmacro MUI_PAGE_LICENSE "anope-1.8.0\docs\COPYING.txt" +; Directory page +!insertmacro MUI_PAGE_DIRECTORY +; Instfiles page +!insertmacro MUI_PAGE_INSTFILES +; Finish page +!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\docs\README.txt" +!insertmacro MUI_PAGE_FINISH + +; Uninstaller pages +!insertmacro MUI_UNPAGE_INSTFILES + +; Language files +!insertmacro MUI_LANGUAGE "Dutch" +!insertmacro MUI_LANGUAGE "English" +!insertmacro MUI_LANGUAGE "French" +!insertmacro MUI_LANGUAGE "German" +!insertmacro MUI_LANGUAGE "Italian" +!insertmacro MUI_LANGUAGE "Portuguese" +!insertmacro MUI_LANGUAGE "Spanish" + +; MUI end ------ + +Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" +OutFile "Anope-1.8.0.exe" +InstallDir "$PROGRAMFILES\Anope" +InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" +ShowInstDetails show +ShowUnInstDetails show + +Function .onInit + !insertmacro MUI_LANGDLL_DISPLAY +FunctionEnd + +Section "MainSection" SEC01 + SetOutPath "$INSTDIR" + File "anope-1.8.0\anope.exe" +File "anope-1.8.0\anope.bat" + SetShellVarContext all + CreateDirectory "$SMPROGRAMS\Anope" + CreateShortCut "$SMPROGRAMS\Anope\Anope IRC Services.lnk" "$INSTDIR\anope.exe" + CreateDirectory "$SMPROGRAMS\Anope\Advanced" + CreateShortCut "$SMPROGRAMS\Anope\Advanced\Anope IRC Services (Debug and Window Logging).lnk" "$INSTDIR\anope.bat" "-debug -nofork" + CreateShortCut "$SMPROGRAMS\Anope\Advanced\Anope IRC Services (Window Logging).lnk" "$INSTDIR\anope.bat" "-nofork" + CreateShortCut "$SMPROGRAMS\Anope\Advanced\Anope IRC Services (No Third Party Modules).lnk" "$INSTDIR\anope.bat" "-nothird" + CreateShortCut "$DESKTOP\Anope IRC Services.lnk" "$INSTDIR\anope.exe" + File "anope-1.8.0\anope.exe.manifest" + File "anope-1.8.0\Changes.conf.txt" + File "anope-1.8.0\Changes.lang.txt" + File "anope-1.8.0\Changes.mysql.txt" + File "anope-1.8.0\Changes.txt" + SetOutPath "$INSTDIR\data" + File "anope-1.8.0\data\anopesmtp.exe" + File "anope-1.8.0\data\anopesmtp.exe.manifest" + SetOutPath "$INSTDIR\data\bin" + File "anope-1.8.0\data\bin\am" + File "anope-1.8.0\data\bin\anoperc.in" + File "anope-1.8.0\data\bin\cp-recursive" + File "anope-1.8.0\data\bin\langtool" + File "anope-1.8.0\data\bin\mydbgen" + File "anope-1.8.0\data\bin\register" + SetOutPath "$INSTDIR\data" + File "anope-1.8.0\data\db-merger.exe" + File "anope-1.8.0\data\db-merger.exe.manifest" + File "anope-1.8.0\data\epona2anope.exe" + File "anope-1.8.0\data\epona2anope.exe.manifest" + File "anope-1.8.0\data\example.conf" + SetOutPath "$INSTDIR\data\languages" + File "anope-1.8.0\data\languages\cat" + File "anope-1.8.0\data\languages\de" + File "anope-1.8.0\data\languages\en_us" + File "anope-1.8.0\data\languages\es" + File "anope-1.8.0\data\languages\fr" + File "anope-1.8.0\data\languages\gr" + File "anope-1.8.0\data\languages\hun" + File "anope-1.8.0\data\languages\it" + File "anope-1.8.0\data\languages\nl" + File "anope-1.8.0\data\languages\pl" + File "anope-1.8.0\data\languages\pt" + File "anope-1.8.0\data\languages\ru" + File "anope-1.8.0\data\languages\tr" + SetOutPath "$INSTDIR\data\logs" + SetOutPath "$INSTDIR\data\backups" + SetOutPath "$INSTDIR\data\modules" + File "anope-1.8.0\data\modules\bahamut.dll" + File "anope-1.8.0\data\modules\bs_act.dll" + File "anope-1.8.0\data\modules\bs_assign.dll" + File "anope-1.8.0\data\modules\bs_badwords.dll" + File "anope-1.8.0\data\modules\bs_bot.dll" + File "anope-1.8.0\data\modules\bs_botlist.dll" + File "anope-1.8.0\data\modules\bs_fantasy.dll" + File "anope-1.8.0\data\modules\bs_fantasy_kick.dll" + File "anope-1.8.0\data\modules\bs_fantasy_kickban.dll" + File "anope-1.8.0\data\modules\bs_fantasy_owner.dll" + File "anope-1.8.0\data\modules\bs_fantasy_seen.dll" + File "anope-1.8.0\data\modules\bs_fantasy_unban.dll" + File "anope-1.8.0\data\modules\bs_help.dll" + File "anope-1.8.0\data\modules\bs_info.dll" + File "anope-1.8.0\data\modules\bs_kick.dll" + File "anope-1.8.0\data\modules\bs_say.dll" + File "anope-1.8.0\data\modules\bs_set.dll" + File "anope-1.8.0\data\modules\bs_unassign.dll" + File "anope-1.8.0\data\modules\charybdis.dll" + File "anope-1.8.0\data\modules\cs_access.dll" + File "anope-1.8.0\data\modules\cs_akick.dll" + File "anope-1.8.0\data\modules\cs_appendtopic.dll" + File "anope-1.8.0\data\modules\cs_ban.dll" + File "anope-1.8.0\data\modules\cs_clear.dll" + File "anope-1.8.0\data\modules\cs_drop.dll" + File "anope-1.8.0\data\modules\cs_enforce.dll" + File "anope-1.8.0\data\modules\cs_forbid.dll" + File "anope-1.8.0\data\modules\cs_getkey.dll" + File "anope-1.8.0\data\modules\cs_getpass.dll" + File "anope-1.8.0\data\modules\cs_help.dll" + File "anope-1.8.0\data\modules\cs_identify.dll" + File "anope-1.8.0\data\modules\cs_info.dll" + File "anope-1.8.0\data\modules\cs_invite.dll" + File "anope-1.8.0\data\modules\cs_kick.dll" + File "anope-1.8.0\data\modules\cs_list.dll" + File "anope-1.8.0\data\modules\cs_logout.dll" + File "anope-1.8.0\data\modules\cs_modes.dll" + File "anope-1.8.0\data\modules\cs_register.dll" + File "anope-1.8.0\data\modules\cs_sendpass.dll" + File "anope-1.8.0\data\modules\cs_set.dll" + File "anope-1.8.0\data\modules\cs_status.dll" + File "anope-1.8.0\data\modules\cs_suspend.dll" + File "anope-1.8.0\data\modules\cs_tban.dll" + File "anope-1.8.0\data\modules\cs_topic.dll" + File "anope-1.8.0\data\modules\cs_xop.dll" + File "anope-1.8.0\data\modules\dreamforge.dll" + File "anope-1.8.0\data\modules\enc_md5.dll" + File "anope-1.8.0\data\modules\enc_sha1.dll" + File "anope-1.8.0\data\modules\enc_none.dll" + File "anope-1.8.0\data\modules\enc_old.dll" + File "anope-1.8.0\data\modules\he_help.dll" + File "anope-1.8.0\data\modules\hs_del.dll" + File "anope-1.8.0\data\modules\hs_delall.dll" + File "anope-1.8.0\data\modules\hs_group.dll" + File "anope-1.8.0\data\modules\hs_help.dll" + File "anope-1.8.0\data\modules\hs_list.dll" + File "anope-1.8.0\data\modules\hs_off.dll" + File "anope-1.8.0\data\modules\hs_on.dll" + File "anope-1.8.0\data\modules\hs_request.dll" + File "anope-1.8.0\data\modules\hs_set.dll" + File "anope-1.8.0\data\modules\hs_setall.dll" + File "anope-1.8.0\data\modules\hybrid.dll" + File "anope-1.8.0\data\modules\inspircd10.dll" + File "anope-1.8.0\data\modules\inspircd11.dll" + File "anope-1.8.0\data\modules\ms_cancel.dll" + File "anope-1.8.0\data\modules\ms_check.dll" + File "anope-1.8.0\data\modules\ms_del.dll" + File "anope-1.8.0\data\modules\ms_help.dll" + File "anope-1.8.0\data\modules\ms_info.dll" + File "anope-1.8.0\data\modules\ms_list.dll" + File "anope-1.8.0\data\modules\ms_read.dll" + File "anope-1.8.0\data\modules\ms_rsend.dll" + File "anope-1.8.0\data\modules\ms_send.dll" + File "anope-1.8.0\data\modules\ms_sendall.dll" + File "anope-1.8.0\data\modules\ms_set.dll" + File "anope-1.8.0\data\modules\ms_staff.dll" + File "anope-1.8.0\data\modules\ns_access.dll" + File "anope-1.8.0\data\modules\ns_alist.dll" + File "anope-1.8.0\data\modules\ns_drop.dll" + File "anope-1.8.0\data\modules\ns_forbid.dll" + File "anope-1.8.0\data\modules\ns_getemail.dll" + File "anope-1.8.0\data\modules\ns_getpass.dll" + File "anope-1.8.0\data\modules\ns_ghost.dll" + File "anope-1.8.0\data\modules\ns_group.dll" + File "anope-1.8.0\data\modules\ns_help.dll" + File "anope-1.8.0\data\modules\ns_identify.dll" + File "anope-1.8.0\data\modules\ns_info.dll" + File "anope-1.8.0\data\modules\ns_list.dll" + File "anope-1.8.0\data\modules\ns_logout.dll" + File "anope-1.8.0\data\modules\ns_maxemail.dll" + File "anope-1.8.0\data\modules\ns_recover.dll" + File "anope-1.8.0\data\modules\ns_register.dll" + File "anope-1.8.0\data\modules\ns_release.dll" + File "anope-1.8.0\data\modules\ns_saset.dll" + File "anope-1.8.0\data\modules\ns_sendpass.dll" + File "anope-1.8.0\data\modules\ns_set.dll" + File "anope-1.8.0\data\modules\ns_status.dll" + File "anope-1.8.0\data\modules\ns_suspend.dll" + File "anope-1.8.0\data\modules\ns_update.dll" + File "anope-1.8.0\data\modules\os_admin.dll" + File "anope-1.8.0\data\modules\os_akill.dll" + File "anope-1.8.0\data\modules\os_chankill.dll" + File "anope-1.8.0\data\modules\os_chanlist.dll" + File "anope-1.8.0\data\modules\os_clearmodes.dll" + File "anope-1.8.0\data\modules\os_defcon.dll" + File "anope-1.8.0\data\modules\os_global.dll" + File "anope-1.8.0\data\modules\os_help.dll" + File "anope-1.8.0\data\modules\os_ignore.dll" + File "anope-1.8.0\data\modules\os_info.dll" + File "anope-1.8.0\data\modules\os_jupe.dll" + File "anope-1.8.0\data\modules\os_kick.dll" + File "anope-1.8.0\data\modules\os_logonnews.dll" + File "anope-1.8.0\data\modules\os_mode.dll" + File "anope-1.8.0\data\modules\os_modinfo.dll" + File "anope-1.8.0\data\modules\os_modlist.dll" + File "anope-1.8.0\data\modules\os_modload.dll" + File "anope-1.8.0\data\modules\os_modunload.dll" + File "anope-1.8.0\data\modules\os_noop.dll" + File "anope-1.8.0\data\modules\os_oline.dll" + File "anope-1.8.0\data\modules\os_oper.dll" + File "anope-1.8.0\data\modules\os_opernews.dll" + File "anope-1.8.0\data\modules\os_quit.dll" + File "anope-1.8.0\data\modules\os_randomnews.dll" + File "anope-1.8.0\data\modules\os_raw.dll" + File "anope-1.8.0\data\modules\os_reload.dll" + File "anope-1.8.0\data\modules\os_restart.dll" + File "anope-1.8.0\data\modules\os_session.dll" + File "anope-1.8.0\data\modules\os_set.dll" + File "anope-1.8.0\data\modules\os_sgline.dll" + File "anope-1.8.0\data\modules\os_shutdown.dll" + File "anope-1.8.0\data\modules\os_sqline.dll" + File "anope-1.8.0\data\modules\os_staff.dll" + File "anope-1.8.0\data\modules\os_stats.dll" + File "anope-1.8.0\data\modules\os_svsnick.dll" + File "anope-1.8.0\data\modules\os_szline.dll" + File "anope-1.8.0\data\modules\os_umode.dll" + File "anope-1.8.0\data\modules\os_update.dll" + File "anope-1.8.0\data\modules\os_userlist.dll" + File "anope-1.8.0\data\modules\plexus2.dll" + File "anope-1.8.0\data\modules\plexus3.dll" + File "anope-1.8.0\data\modules\ptlink.dll" + File "anope-1.8.0\data\modules\rageircd.dll" + File "anope-1.8.0\data\modules\ratbox.dll" + File "anope-1.8.0\data\modules\shadowircd.dll" + File "anope-1.8.0\data\modules\solidircd.dll" + File "anope-1.8.0\data\modules\ultimate2.dll" + File "anope-1.8.0\data\modules\ultimate3.dll" + File "anope-1.8.0\data\modules\unreal31.dll" + File "anope-1.8.0\data\modules\unreal32.dll" + File "anope-1.8.0\data\modules\viagra.dll" + SetOutPath "$INSTDIR\data\modules\runtime" + SetOutPath "$INSTDIR\data" + File "anope-1.8.0\data\tables.sql" + SetOutPath "$INSTDIR\docs" + File "anope-1.8.0\docs\BUGS.txt" + File "anope-1.8.0\docs\COPYING.txt" + File "anope-1.8.0\docs\DEFCON.txt" + File "anope-1.8.0\docs\EVENTS.txt" + File "anope-1.8.0\docs\FAQ.txt" + File "anope-1.8.0\docs\INSTALL.txt" + File "anope-1.8.0\docs\IRCD.txt" + File "anope-1.8.0\docs\MODULES.txt" + File "anope-1.8.0\docs\MYSQL.txt" + File "anope-1.8.0\docs\NEWS.txt" + File "anope-1.8.0\docs\OLDCHANGES.txt" + File "anope-1.8.0\docs\PROXY.txt" + File "anope-1.8.0\docs\README.txt" + File "anope-1.8.0\docs\WIN32.txt" + File "anope-1.8.0\docs\OLDNEWS.txt" + +SectionEnd + +Section -AdditionalIcons + SetOutPath $INSTDIR + WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" + CreateShortCut "$SMPROGRAMS\Anope\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" + CreateShortCut "$SMPROGRAMS\Anope\Uninstall.lnk" "$INSTDIR\uninst.exe" +SectionEnd + +Section -Post + WriteUninstaller "$INSTDIR\uninst.exe" + WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\anope.exe" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\anope.exe" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" +SectionEnd + + +Function un.onUninstSuccess + HideWindow + MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." +FunctionEnd + +Function un.onInit +!insertmacro MUI_UNGETLANGUAGE + MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2 + Abort +FunctionEnd + +Section Uninstall + Delete "$INSTDIR\${PRODUCT_NAME}.url" + Delete "$INSTDIR\uninst.exe" + Delete "$INSTDIR\docs\WIN32.txt" + Delete "$INSTDIR\docs\README.txt" + Delete "$INSTDIR\docs\PROXY.txt" + Delete "$INSTDIR\docs\OLDCHANGES.txt" + Delete "$INSTDIR\docs\OLDNEWS.txt" + Delete "$INSTDIR\docs\NEWS.txt" + Delete "$INSTDIR\docs\MYSQL.txt" + Delete "$INSTDIR\docs\MODULES.txt" + Delete "$INSTDIR\docs\IRCD.txt" + Delete "$INSTDIR\docs\INSTALL.txt" + Delete "$INSTDIR\docs\FAQ.txt" + Delete "$INSTDIR\docs\EVENTS.txt" + Delete "$INSTDIR\docs\DEFCON.txt" + Delete "$INSTDIR\docs\COPYING.txt" + Delete "$INSTDIR\docs\BUGS.txt" + Delete "$INSTDIR\data\tables.sql" + Delete "$INSTDIR\data\modules\viagra.dll" + Delete "$INSTDIR\data\modules\unreal32.dll" + Delete "$INSTDIR\data\modules\unreal31.dll" + Delete "$INSTDIR\data\modules\ultimate3.dll" + Delete "$INSTDIR\data\modules\ultimate2.dll" + Delete "$INSTDIR\data\modules\solidircd.dll" + Delete "$INSTDIR\data\modules\shadowircd.dll" + Delete "$INSTDIR\data\modules\ratbox.dll" + Delete "$INSTDIR\data\modules\rageircd.dll" + Delete "$INSTDIR\data\modules\ptlink.dll" + Delete "$INSTDIR\data\modules\plexus3.dll" + Delete "$INSTDIR\data\modules\plexus2.dll" + Delete "$INSTDIR\data\modules\os_userlist.dll" + Delete "$INSTDIR\data\modules\os_update.dll" + Delete "$INSTDIR\data\modules\os_umode.dll" + Delete "$INSTDIR\data\modules\os_szline.dll" + Delete "$INSTDIR\data\modules\os_svsnick.dll" + Delete "$INSTDIR\data\modules\os_stats.dll" + Delete "$INSTDIR\data\modules\os_staff.dll" + Delete "$INSTDIR\data\modules\os_sqline.dll" + Delete "$INSTDIR\data\modules\os_shutdown.dll" + Delete "$INSTDIR\data\modules\os_sgline.dll" + Delete "$INSTDIR\data\modules\os_set.dll" + Delete "$INSTDIR\data\modules\os_session.dll" + Delete "$INSTDIR\data\modules\os_restart.dll" + Delete "$INSTDIR\data\modules\os_reload.dll" + Delete "$INSTDIR\data\modules\os_raw.dll" + Delete "$INSTDIR\data\modules\os_randomnews.dll" + Delete "$INSTDIR\data\modules\os_quit.dll" + Delete "$INSTDIR\data\modules\os_opernews.dll" + Delete "$INSTDIR\data\modules\os_oper.dll" + Delete "$INSTDIR\data\modules\os_oline.dll" + Delete "$INSTDIR\data\modules\os_noop.dll" + Delete "$INSTDIR\data\modules\os_modunload.dll" + Delete "$INSTDIR\data\modules\os_modload.dll" + Delete "$INSTDIR\data\modules\os_modlist.dll" + Delete "$INSTDIR\data\modules\os_modinfo.dll" + Delete "$INSTDIR\data\modules\os_mode.dll" + Delete "$INSTDIR\data\modules\os_logonnews.dll" + Delete "$INSTDIR\data\modules\os_kick.dll" + Delete "$INSTDIR\data\modules\os_jupe.dll" + Delete "$INSTDIR\data\modules\os_info.dll" + Delete "$INSTDIR\data\modules\os_ignore.dll" + Delete "$INSTDIR\data\modules\os_help.dll" + Delete "$INSTDIR\data\modules\os_global.dll" + Delete "$INSTDIR\data\modules\os_defcon.dll" + Delete "$INSTDIR\data\modules\os_clearmodes.dll" + Delete "$INSTDIR\data\modules\os_chanlist.dll" + Delete "$INSTDIR\data\modules\os_chankill.dll" + Delete "$INSTDIR\data\modules\os_akill.dll" + Delete "$INSTDIR\data\modules\os_admin.dll" + Delete "$INSTDIR\data\modules\ns_update.dll" + Delete "$INSTDIR\data\modules\ns_suspend.dll" + Delete "$INSTDIR\data\modules\ns_status.dll" + Delete "$INSTDIR\data\modules\ns_set.dll" + Delete "$INSTDIR\data\modules\ns_sendpass.dll" + Delete "$INSTDIR\data\modules\ns_saset.dll" + Delete "$INSTDIR\data\modules\ns_release.dll" + Delete "$INSTDIR\data\modules\ns_register.dll" + Delete "$INSTDIR\data\modules\ns_recover.dll" + Delete "$INSTDIR\data\modules\ns_maxemail.dll" + Delete "$INSTDIR\data\modules\ns_logout.dll" + Delete "$INSTDIR\data\modules\ns_list.dll" + Delete "$INSTDIR\data\modules\ns_info.dll" + Delete "$INSTDIR\data\modules\ns_identify.dll" + Delete "$INSTDIR\data\modules\ns_help.dll" + Delete "$INSTDIR\data\modules\ns_group.dll" + Delete "$INSTDIR\data\modules\ns_ghost.dll" + Delete "$INSTDIR\data\modules\ns_getpass.dll" + Delete "$INSTDIR\data\modules\ns_getemail.dll" + Delete "$INSTDIR\data\modules\ns_forbid.dll" + Delete "$INSTDIR\data\modules\ns_drop.dll" + Delete "$INSTDIR\data\modules\ns_alist.dll" + Delete "$INSTDIR\data\modules\ns_access.dll" + Delete "$INSTDIR\data\modules\ms_staff.dll" + Delete "$INSTDIR\data\modules\ms_set.dll" + Delete "$INSTDIR\data\modules\ms_sendall.dll" + Delete "$INSTDIR\data\modules\ms_send.dll" + Delete "$INSTDIR\data\modules\ms_rsend.dll" + Delete "$INSTDIR\data\modules\ms_read.dll" + Delete "$INSTDIR\data\modules\ms_list.dll" + Delete "$INSTDIR\data\modules\ms_info.dll" + Delete "$INSTDIR\data\modules\ms_help.dll" + Delete "$INSTDIR\data\modules\ms_del.dll" + Delete "$INSTDIR\data\modules\ms_check.dll" + Delete "$INSTDIR\data\modules\ms_cancel.dll" + Delete "$INSTDIR\data\modules\inspircd11.dll" + Delete "$INSTDIR\data\modules\inspircd10.dll" + Delete "$INSTDIR\data\modules\hybrid.dll" + Delete "$INSTDIR\data\modules\hs_setall.dll" + Delete "$INSTDIR\data\modules\hs_set.dll" + Delete "$INSTDIR\data\modules\hs_request.dll" + Delete "$INSTDIR\data\modules\hs_on.dll" + Delete "$INSTDIR\data\modules\hs_off.dll" + Delete "$INSTDIR\data\modules\hs_list.dll" + Delete "$INSTDIR\data\modules\hs_help.dll" + Delete "$INSTDIR\data\modules\hs_group.dll" + Delete "$INSTDIR\data\modules\hs_delall.dll" + Delete "$INSTDIR\data\modules\hs_del.dll" + Delete "$INSTDIR\data\modules\he_help.dll" + Delete "$INSTDIR\data\modules\enc_old.dll" + Delete "$INSTDIR\data\modules\enc_none.dll" + Delete "$INSTDIR\data\modules\enc_md5.dll" + Delete "$INSTDIR\data\modules\enc_sha1.dll" + Delete "$INSTDIR\data\modules\dreamforge.dll" + Delete "$INSTDIR\data\modules\cs_xop.dll" + Delete "$INSTDIR\data\modules\cs_topic.dll" + Delete "$INSTDIR\data\modules\cs_tban.dll" + Delete "$INSTDIR\data\modules\cs_suspend.dll" + Delete "$INSTDIR\data\modules\cs_status.dll" + Delete "$INSTDIR\data\modules\cs_set.dll" + Delete "$INSTDIR\data\modules\cs_sendpass.dll" + Delete "$INSTDIR\data\modules\cs_register.dll" + Delete "$INSTDIR\data\modules\cs_modes.dll" + Delete "$INSTDIR\data\modules\cs_logout.dll" + Delete "$INSTDIR\data\modules\cs_list.dll" + Delete "$INSTDIR\data\modules\cs_kick.dll" + Delete "$INSTDIR\data\modules\cs_invite.dll" + Delete "$INSTDIR\data\modules\cs_info.dll" + Delete "$INSTDIR\data\modules\cs_identify.dll" + Delete "$INSTDIR\data\modules\cs_help.dll" + Delete "$INSTDIR\data\modules\cs_getpass.dll" + Delete "$INSTDIR\data\modules\cs_getkey.dll" + Delete "$INSTDIR\data\modules\cs_forbid.dll" + Delete "$INSTDIR\data\modules\cs_enforce.dll" + Delete "$INSTDIR\data\modules\cs_drop.dll" + Delete "$INSTDIR\data\modules\cs_clear.dll" + Delete "$INSTDIR\data\modules\cs_ban.dll" + Delete "$INSTDIR\data\modules\cs_appendtopic.dll" + Delete "$INSTDIR\data\modules\cs_akick.dll" + Delete "$INSTDIR\data\modules\cs_access.dll" + Delete "$INSTDIR\data\modules\charybdis.dll" + Delete "$INSTDIR\data\modules\bs_unassign.dll" + Delete "$INSTDIR\data\modules\bs_set.dll" + Delete "$INSTDIR\data\modules\bs_say.dll" + Delete "$INSTDIR\data\modules\bs_kick.dll" + Delete "$INSTDIR\data\modules\bs_info.dll" + Delete "$INSTDIR\data\modules\bs_help.dll" + Delete "$INSTDIR\data\modules\bs_fantasy_unban.dll" + Delete "$INSTDIR\data\modules\bs_fantasy_seen.dll" + Delete "$INSTDIR\data\modules\bs_fantasy_owner.dll" + Delete "$INSTDIR\data\modules\bs_fantasy_kickban.dll" + Delete "$INSTDIR\data\modules\bs_fantasy_kick.dll" + Delete "$INSTDIR\data\modules\bs_fantasy.dll" + Delete "$INSTDIR\data\modules\bs_botlist.dll" + Delete "$INSTDIR\data\modules\bs_bot.dll" + Delete "$INSTDIR\data\modules\bs_badwords.dll" + Delete "$INSTDIR\data\modules\bs_assign.dll" + Delete "$INSTDIR\data\modules\bs_act.dll" + Delete "$INSTDIR\data\modules\bahamut.dll" + Delete "$INSTDIR\data\languages\tr" + Delete "$INSTDIR\data\languages\ru" + Delete "$INSTDIR\data\languages\pt" + Delete "$INSTDIR\data\languages\pl" + Delete "$INSTDIR\data\languages\nl" + Delete "$INSTDIR\data\languages\it" + Delete "$INSTDIR\data\languages\hun" + Delete "$INSTDIR\data\languages\gr" + Delete "$INSTDIR\data\languages\fr" + Delete "$INSTDIR\data\languages\es" + Delete "$INSTDIR\data\languages\en_us" + Delete "$INSTDIR\data\languages\de" + Delete "$INSTDIR\data\languages\cat" + Delete "$INSTDIR\data\example.conf" + Delete "$INSTDIR\data\epona2anope.exe.manifest" + Delete "$INSTDIR\data\epona2anope.exe" + Delete "$INSTDIR\data\db-merger.exe.manifest" + Delete "$INSTDIR\data\db-merger.exe" + Delete "$INSTDIR\data\bin\register" + Delete "$INSTDIR\data\bin\mydbgen" + Delete "$INSTDIR\data\bin\langtool" + Delete "$INSTDIR\data\bin\cp-recursive" + Delete "$INSTDIR\data\bin\anoperc.in" + Delete "$INSTDIR\data\bin\am" + Delete "$INSTDIR\data\anopesmtp.exe.manifest" + Delete "$INSTDIR\data\anopesmtp.exe" + Delete "$INSTDIR\Changes.txt" + Delete "$INSTDIR\Changes.mysql.txt" + Delete "$INSTDIR\Changes.lang.txt" + Delete "$INSTDIR\Changes.conf.txt" + Delete "$INSTDIR\anope.exe.manifest" + Delete "$INSTDIR\anope.exe" +Delete "$INSTDIR\anope.bat" + SetShellVarContext all + Delete "$SMPROGRAMS\Anope\Uninstall.lnk" + Delete "$SMPROGRAMS\Anope\Website.lnk" + Delete "$DESKTOP\Anope IRC Services.lnk" + Delete "$SMPROGRAMS\Anope\Anope IRC Services.lnk" + Delete "$SMPROGRAMS\Anope\Advanced\Anope IRC Services (Debug and Window Logging).lnk" + Delete "$SMPROGRAMS\Anope\Advanced\Anope IRC Services (Window Logging).lnk" + Delete "$SMPROGRAMS\Anope\Advanced\Anope IRC Services (No Third Party Modules).lnk" + +RMDir "$SMPROGRAMS\Anope\Advanced" + RMDir "$SMPROGRAMS\Anope" + RMDir "$INSTDIR\docs" + RMDir "$INSTDIR\data\modules" +RMDir "$INSTDIR\data\backups" + RMDir "$INSTDIR\data\logs" + RMDir "$INSTDIR\data\languages" + RMDir "$INSTDIR\data\bin" + RMDir "$INSTDIR\data" + RMDir "$INSTDIR" + + DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" + DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}" + SetAutoClose true +SectionEnd \ No newline at end of file diff --git a/src/tools/Anope_MySQL_Install_Script.nsi b/src/tools/Anope_MySQL_Install_Script.nsi new file mode 100644 index 000000000..ead85e449 --- /dev/null +++ b/src/tools/Anope_MySQL_Install_Script.nsi @@ -0,0 +1,542 @@ +; Script generated by the HM NIS Edit Script Wizard. + +; HM NIS Edit Wizard helper defines +!define PRODUCT_NAME "Anope IRC Services" +!define PRODUCT_VERSION "1.8.0-MySQL" +!define PRODUCT_PUBLISHER "Anope" +!define PRODUCT_WEB_SITE "http://www.anope.org" +!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\anope.exe" +!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" +!define PRODUCT_UNINST_ROOT_KEY "HKLM" + +; MUI 1.67 compatible ------ +!include "MUI.nsh" + +; MUI Settings +!define MUI_ABORTWARNING +!define MUI_ICON "anope-icon.ico" +!define MUI_UNICON "anope-icon.ico" + +; Language Selection Dialog Settings +!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}" +!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}" +!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language" + +; Welcome page +!insertmacro MUI_PAGE_WELCOME +; License page +!define MUI_LICENSEPAGE_RADIOBUTTONS +!insertmacro MUI_PAGE_LICENSE "anope-1.8.0-MySQL\docs\COPYING.txt" +; Directory page +!insertmacro MUI_PAGE_DIRECTORY +; Instfiles page +!insertmacro MUI_PAGE_INSTFILES +; Finish page +!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\docs\README.txt" +!insertmacro MUI_PAGE_FINISH + +; Uninstaller pages +!insertmacro MUI_UNPAGE_INSTFILES + +; Language files +!insertmacro MUI_LANGUAGE "Dutch" +!insertmacro MUI_LANGUAGE "English" +!insertmacro MUI_LANGUAGE "French" +!insertmacro MUI_LANGUAGE "German" +!insertmacro MUI_LANGUAGE "Italian" +!insertmacro MUI_LANGUAGE "Portuguese" +!insertmacro MUI_LANGUAGE "Spanish" + +; MUI end ------ + +Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" +OutFile "Anope-1.8.0-MySQL.exe" +InstallDir "$PROGRAMFILES\Anope" +InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" +ShowInstDetails show +ShowUnInstDetails show + +Function .onInit + !insertmacro MUI_LANGDLL_DISPLAY +FunctionEnd + +Section "MainSection" SEC01 + SetOutPath "$INSTDIR" + File "anope-1.8.0-MySQL\anope.exe" +File "anope-1.8.0\anope.bat" + SetShellVarContext all + CreateDirectory "$SMPROGRAMS\Anope" + CreateShortCut "$SMPROGRAMS\Anope\Anope IRC Services.lnk" "$INSTDIR\anope.exe" + CreateShortCut "$DESKTOP\Anope IRC Services.lnk" "$INSTDIR\anope.exe" + CreateDirectory "$SMPROGRAMS\Anope\Advanced" + CreateShortCut "$SMPROGRAMS\Anope\Advanced\Anope IRC Services (Debug and Window Logging).lnk" "$INSTDIR\anope.bat" "-debug -nofork" + CreateShortCut "$SMPROGRAMS\Anope\Advanced\Anope IRC Services (Window Logging).lnk" "$INSTDIR\anope.bat" "-nofork" + CreateShortCut "$SMPROGRAMS\Anope\Advanced\Anope IRC Services (No Third Party Modules).lnk" "$INSTDIR\anope.bat" "-nothird" + + File "anope-1.8.0-MySQL\anope.exe.manifest" + File "anope-1.8.0-MySQL\Changes.conf.txt" + File "anope-1.8.0-MySQL\Changes.lang.txt" + File "anope-1.8.0-MySQL\Changes.mysql.txt" + File "anope-1.8.0-MySQL\Changes.txt" + SetOutPath "$INSTDIR\data" + File "anope-1.8.0-MySQL\data\anopesmtp.exe" + File "anope-1.8.0-MySQL\data\anopesmtp.exe.manifest" + SetOutPath "$INSTDIR\data\bin" + File "anope-1.8.0-MySQL\data\bin\am" + File "anope-1.8.0-MySQL\data\bin\anoperc.in" + File "anope-1.8.0-MySQL\data\bin\cp-recursive" + File "anope-1.8.0-MySQL\data\bin\langtool" + File "anope-1.8.0-MySQL\data\bin\mydbgen" + File "anope-1.8.0-MySQL\data\bin\register" + SetOutPath "$INSTDIR\data" + File "anope-1.8.0-MySQL\data\db-merger.exe" + File "anope-1.8.0-MySQL\data\db-merger.exe.manifest" + File "anope-1.8.0-MySQL\data\epona2anope.exe" + File "anope-1.8.0-MySQL\data\epona2anope.exe.manifest" + File "anope-1.8.0-MySQL\data\example.conf" + SetOutPath "$INSTDIR\data\languages" + File "anope-1.8.0-MySQL\data\languages\cat" + File "anope-1.8.0-MySQL\data\languages\de" + File "anope-1.8.0-MySQL\data\languages\en_us" + File "anope-1.8.0-MySQL\data\languages\es" + File "anope-1.8.0-MySQL\data\languages\fr" + File "anope-1.8.0-MySQL\data\languages\gr" + File "anope-1.8.0-MySQL\data\languages\hun" + File "anope-1.8.0-MySQL\data\languages\it" + File "anope-1.8.0-MySQL\data\languages\nl" + File "anope-1.8.0-MySQL\data\languages\pl" + File "anope-1.8.0-MySQL\data\languages\pt" + File "anope-1.8.0-MySQL\data\languages\ru" + File "anope-1.8.0-MySQL\data\languages\tr" + SetOutPath "$INSTDIR\data\logs" +SetOutPath "$INSTDIR\data\backups" + SetOutPath "$INSTDIR\data\modules" + File "anope-1.8.0-MySQL\data\modules\bahamut.dll" + File "anope-1.8.0-MySQL\data\modules\bs_act.dll" + File "anope-1.8.0-MySQL\data\modules\bs_assign.dll" + File "anope-1.8.0-MySQL\data\modules\bs_badwords.dll" + File "anope-1.8.0-MySQL\data\modules\bs_bot.dll" + File "anope-1.8.0-MySQL\data\modules\bs_botlist.dll" + File "anope-1.8.0-MySQL\data\modules\bs_fantasy.dll" + File "anope-1.8.0-MySQL\data\modules\bs_fantasy_kick.dll" + File "anope-1.8.0-MySQL\data\modules\bs_fantasy_kickban.dll" + File "anope-1.8.0-MySQL\data\modules\bs_fantasy_owner.dll" + File "anope-1.8.0-MySQL\data\modules\bs_fantasy_seen.dll" + File "anope-1.8.0-MySQL\data\modules\bs_fantasy_unban.dll" + File "anope-1.8.0-MySQL\data\modules\bs_help.dll" + File "anope-1.8.0-MySQL\data\modules\bs_info.dll" + File "anope-1.8.0-MySQL\data\modules\bs_kick.dll" + File "anope-1.8.0-MySQL\data\modules\bs_say.dll" + File "anope-1.8.0-MySQL\data\modules\bs_set.dll" + File "anope-1.8.0-MySQL\data\modules\bs_unassign.dll" + File "anope-1.8.0-MySQL\data\modules\charybdis.dll" + File "anope-1.8.0-MySQL\data\modules\cs_access.dll" + File "anope-1.8.0-MySQL\data\modules\cs_akick.dll" + File "anope-1.8.0-MySQL\data\modules\cs_appendtopic.dll" + File "anope-1.8.0-MySQL\data\modules\cs_ban.dll" + File "anope-1.8.0-MySQL\data\modules\cs_clear.dll" + File "anope-1.8.0-MySQL\data\modules\cs_drop.dll" + File "anope-1.8.0-MySQL\data\modules\cs_enforce.dll" + File "anope-1.8.0-MySQL\data\modules\cs_forbid.dll" + File "anope-1.8.0-MySQL\data\modules\cs_getkey.dll" + File "anope-1.8.0-MySQL\data\modules\cs_getpass.dll" + File "anope-1.8.0-MySQL\data\modules\cs_help.dll" + File "anope-1.8.0-MySQL\data\modules\cs_identify.dll" + File "anope-1.8.0-MySQL\data\modules\cs_info.dll" + File "anope-1.8.0-MySQL\data\modules\cs_invite.dll" + File "anope-1.8.0-MySQL\data\modules\cs_kick.dll" + File "anope-1.8.0-MySQL\data\modules\cs_list.dll" + File "anope-1.8.0-MySQL\data\modules\cs_logout.dll" + File "anope-1.8.0-MySQL\data\modules\cs_modes.dll" + File "anope-1.8.0-MySQL\data\modules\cs_register.dll" + File "anope-1.8.0-MySQL\data\modules\cs_sendpass.dll" + File "anope-1.8.0-MySQL\data\modules\cs_set.dll" + File "anope-1.8.0-MySQL\data\modules\cs_status.dll" + File "anope-1.8.0-MySQL\data\modules\cs_suspend.dll" + File "anope-1.8.0-MySQL\data\modules\cs_tban.dll" + File "anope-1.8.0-MySQL\data\modules\cs_topic.dll" + File "anope-1.8.0-MySQL\data\modules\cs_xop.dll" + File "anope-1.8.0-MySQL\data\modules\dreamforge.dll" + File "anope-1.8.0-MySQL\data\modules\enc_md5.dll" + File "anope-1.8.0-MySQL\data\modules\enc_sha1.dll" + File "anope-1.8.0-MySQL\data\modules\enc_none.dll" + File "anope-1.8.0-MySQL\data\modules\enc_old.dll" + File "anope-1.8.0-MySQL\data\modules\he_help.dll" + File "anope-1.8.0-MySQL\data\modules\hs_del.dll" + File "anope-1.8.0-MySQL\data\modules\hs_delall.dll" + File "anope-1.8.0-MySQL\data\modules\hs_group.dll" + File "anope-1.8.0-MySQL\data\modules\hs_help.dll" + File "anope-1.8.0-MySQL\data\modules\hs_list.dll" + File "anope-1.8.0-MySQL\data\modules\hs_off.dll" + File "anope-1.8.0-MySQL\data\modules\hs_on.dll" + File "anope-1.8.0-MySQL\data\modules\hs_request.dll" + File "anope-1.8.0-MySQL\data\modules\hs_set.dll" + File "anope-1.8.0-MySQL\data\modules\hs_setall.dll" + File "anope-1.8.0-MySQL\data\modules\hybrid.dll" + File "anope-1.8.0-MySQL\data\modules\inspircd10.dll" + File "anope-1.8.0-MySQL\data\modules\inspircd11.dll" + File "anope-1.8.0-MySQL\data\modules\ms_cancel.dll" + File "anope-1.8.0-MySQL\data\modules\ms_check.dll" + File "anope-1.8.0-MySQL\data\modules\ms_del.dll" + File "anope-1.8.0-MySQL\data\modules\ms_help.dll" + File "anope-1.8.0-MySQL\data\modules\ms_info.dll" + File "anope-1.8.0-MySQL\data\modules\ms_list.dll" + File "anope-1.8.0-MySQL\data\modules\ms_read.dll" + File "anope-1.8.0-MySQL\data\modules\ms_rsend.dll" + File "anope-1.8.0-MySQL\data\modules\ms_send.dll" + File "anope-1.8.0-MySQL\data\modules\ms_sendall.dll" + File "anope-1.8.0-MySQL\data\modules\ms_set.dll" + File "anope-1.8.0-MySQL\data\modules\ms_staff.dll" + File "anope-1.8.0-MySQL\data\modules\ns_access.dll" + File "anope-1.8.0-MySQL\data\modules\ns_alist.dll" + File "anope-1.8.0-MySQL\data\modules\ns_drop.dll" + File "anope-1.8.0-MySQL\data\modules\ns_forbid.dll" + File "anope-1.8.0-MySQL\data\modules\ns_getemail.dll" + File "anope-1.8.0-MySQL\data\modules\ns_getpass.dll" + File "anope-1.8.0-MySQL\data\modules\ns_ghost.dll" + File "anope-1.8.0-MySQL\data\modules\ns_group.dll" + File "anope-1.8.0-MySQL\data\modules\ns_help.dll" + File "anope-1.8.0-MySQL\data\modules\ns_identify.dll" + File "anope-1.8.0-MySQL\data\modules\ns_info.dll" + File "anope-1.8.0-MySQL\data\modules\ns_list.dll" + File "anope-1.8.0-MySQL\data\modules\ns_logout.dll" + File "anope-1.8.0-MySQL\data\modules\ns_maxemail.dll" + File "anope-1.8.0-MySQL\data\modules\ns_recover.dll" + File "anope-1.8.0-MySQL\data\modules\ns_register.dll" + File "anope-1.8.0-MySQL\data\modules\ns_release.dll" + File "anope-1.8.0-MySQL\data\modules\ns_saset.dll" + File "anope-1.8.0-MySQL\data\modules\ns_sendpass.dll" + File "anope-1.8.0-MySQL\data\modules\ns_set.dll" + File "anope-1.8.0-MySQL\data\modules\ns_status.dll" + File "anope-1.8.0-MySQL\data\modules\ns_suspend.dll" + File "anope-1.8.0-MySQL\data\modules\ns_update.dll" + File "anope-1.8.0-MySQL\data\modules\os_admin.dll" + File "anope-1.8.0-MySQL\data\modules\os_akill.dll" + File "anope-1.8.0-MySQL\data\modules\os_chankill.dll" + File "anope-1.8.0-MySQL\data\modules\os_chanlist.dll" + File "anope-1.8.0-MySQL\data\modules\os_clearmodes.dll" + File "anope-1.8.0-MySQL\data\modules\os_defcon.dll" + File "anope-1.8.0-MySQL\data\modules\os_global.dll" + File "anope-1.8.0-MySQL\data\modules\os_help.dll" + File "anope-1.8.0-MySQL\data\modules\os_ignore.dll" + File "anope-1.8.0-MySQL\data\modules\os_info.dll" + File "anope-1.8.0-MySQL\data\modules\os_jupe.dll" + File "anope-1.8.0-MySQL\data\modules\os_kick.dll" + File "anope-1.8.0-MySQL\data\modules\os_logonnews.dll" + File "anope-1.8.0-MySQL\data\modules\os_mode.dll" + File "anope-1.8.0-MySQL\data\modules\os_modinfo.dll" + File "anope-1.8.0-MySQL\data\modules\os_modlist.dll" + File "anope-1.8.0-MySQL\data\modules\os_modload.dll" + File "anope-1.8.0-MySQL\data\modules\os_modunload.dll" + File "anope-1.8.0-MySQL\data\modules\os_noop.dll" + File "anope-1.8.0-MySQL\data\modules\os_oline.dll" + File "anope-1.8.0-MySQL\data\modules\os_oper.dll" + File "anope-1.8.0-MySQL\data\modules\os_opernews.dll" + File "anope-1.8.0-MySQL\data\modules\os_quit.dll" + File "anope-1.8.0-MySQL\data\modules\os_randomnews.dll" + File "anope-1.8.0-MySQL\data\modules\os_raw.dll" + File "anope-1.8.0-MySQL\data\modules\os_reload.dll" + File "anope-1.8.0-MySQL\data\modules\os_restart.dll" + File "anope-1.8.0-MySQL\data\modules\os_session.dll" + File "anope-1.8.0-MySQL\data\modules\os_set.dll" + File "anope-1.8.0-MySQL\data\modules\os_sgline.dll" + File "anope-1.8.0-MySQL\data\modules\os_shutdown.dll" + File "anope-1.8.0-MySQL\data\modules\os_sqline.dll" + File "anope-1.8.0-MySQL\data\modules\os_staff.dll" + File "anope-1.8.0-MySQL\data\modules\os_stats.dll" + File "anope-1.8.0-MySQL\data\modules\os_svsnick.dll" + File "anope-1.8.0-MySQL\data\modules\os_szline.dll" + File "anope-1.8.0-MySQL\data\modules\os_umode.dll" + File "anope-1.8.0-MySQL\data\modules\os_update.dll" + File "anope-1.8.0-MySQL\data\modules\os_userlist.dll" + File "anope-1.8.0-MySQL\data\modules\plexus2.dll" + File "anope-1.8.0-MySQL\data\modules\plexus3.dll" + File "anope-1.8.0-MySQL\data\modules\ptlink.dll" + File "anope-1.8.0-MySQL\data\modules\rageircd.dll" + File "anope-1.8.0-MySQL\data\modules\ratbox.dll" + File "anope-1.8.0-MySQL\data\modules\shadowircd.dll" + File "anope-1.8.0-MySQL\data\modules\solidircd.dll" + File "anope-1.8.0-MySQL\data\modules\ultimate2.dll" + File "anope-1.8.0-MySQL\data\modules\ultimate3.dll" + File "anope-1.8.0-MySQL\data\modules\unreal31.dll" + File "anope-1.8.0-MySQL\data\modules\unreal32.dll" + File "anope-1.8.0-MySQL\data\modules\viagra.dll" + SetOutPath "$INSTDIR\data\modules\runtime" + SetOutPath "$INSTDIR\data" + File "anope-1.8.0-MySQL\data\tables.sql" + SetOutPath "$INSTDIR\docs" + File "anope-1.8.0-MySQL\docs\BUGS.txt" + File "anope-1.8.0-MySQL\docs\COPYING.txt" + File "anope-1.8.0-MySQL\docs\DEFCON.txt" + File "anope-1.8.0-MySQL\docs\EVENTS.txt" + File "anope-1.8.0-MySQL\docs\FAQ.txt" + File "anope-1.8.0-MySQL\docs\INSTALL.txt" + File "anope-1.8.0-MySQL\docs\IRCD.txt" + File "anope-1.8.0-MySQL\docs\MODULES.txt" + File "anope-1.8.0-MySQL\docs\MYSQL.txt" + File "anope-1.8.0-MySQL\docs\NEWS.txt" + File "anope-1.8.0-MySQL\docs\OLDNEWS.txt" + File "anope-1.8.0-MySQL\docs\OLDCHANGES.txt" + File "anope-1.8.0-MySQL\docs\PROXY.txt" + File "anope-1.8.0-MySQL\docs\README.txt" + File "anope-1.8.0-MySQL\docs\WIN32.txt" +SectionEnd + +Section -AdditionalIcons + SetOutPath $INSTDIR + WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" + CreateShortCut "$SMPROGRAMS\Anope\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" + CreateShortCut "$SMPROGRAMS\Anope\Uninstall.lnk" "$INSTDIR\uninst.exe" +SectionEnd + +Section -Post + WriteUninstaller "$INSTDIR\uninst.exe" + WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\anope.exe" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\anope.exe" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" +SectionEnd + + +Function un.onUninstSuccess + HideWindow + MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." +FunctionEnd + +Function un.onInit +!insertmacro MUI_UNGETLANGUAGE + MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2 + Abort +FunctionEnd + +Section Uninstall + Delete "$INSTDIR\${PRODUCT_NAME}.url" + Delete "$INSTDIR\uninst.exe" + Delete "$INSTDIR\docs\WIN32.txt" + Delete "$INSTDIR\docs\README.txt" + Delete "$INSTDIR\docs\PROXY.txt" + Delete "$INSTDIR\docs\OLDCHANGES.txt" + Delete "$INSTDIR\docs\OLDNEWS.txt" + Delete "$INSTDIR\docs\NEWS.txt" + Delete "$INSTDIR\docs\MYSQL.txt" + Delete "$INSTDIR\docs\MODULES.txt" + Delete "$INSTDIR\docs\IRCD.txt" + Delete "$INSTDIR\docs\INSTALL.txt" + Delete "$INSTDIR\docs\FAQ.txt" + Delete "$INSTDIR\docs\EVENTS.txt" + Delete "$INSTDIR\docs\DEFCON.txt" + Delete "$INSTDIR\docs\COPYING.txt" + Delete "$INSTDIR\docs\BUGS.txt" + Delete "$INSTDIR\data\tables.sql" + Delete "$INSTDIR\data\modules\viagra.dll" + Delete "$INSTDIR\data\modules\unreal32.dll" + Delete "$INSTDIR\data\modules\unreal31.dll" + Delete "$INSTDIR\data\modules\ultimate3.dll" + Delete "$INSTDIR\data\modules\ultimate2.dll" + Delete "$INSTDIR\data\modules\solidircd.dll" + Delete "$INSTDIR\data\modules\shadowircd.dll" + Delete "$INSTDIR\data\modules\ratbox.dll" + Delete "$INSTDIR\data\modules\rageircd.dll" + Delete "$INSTDIR\data\modules\ptlink.dll" + Delete "$INSTDIR\data\modules\plexus3.dll" + Delete "$INSTDIR\data\modules\plexus2.dll" + Delete "$INSTDIR\data\modules\os_userlist.dll" + Delete "$INSTDIR\data\modules\os_update.dll" + Delete "$INSTDIR\data\modules\os_umode.dll" + Delete "$INSTDIR\data\modules\os_szline.dll" + Delete "$INSTDIR\data\modules\os_svsnick.dll" + Delete "$INSTDIR\data\modules\os_stats.dll" + Delete "$INSTDIR\data\modules\os_staff.dll" + Delete "$INSTDIR\data\modules\os_sqline.dll" + Delete "$INSTDIR\data\modules\os_shutdown.dll" + Delete "$INSTDIR\data\modules\os_sgline.dll" + Delete "$INSTDIR\data\modules\os_set.dll" + Delete "$INSTDIR\data\modules\os_session.dll" + Delete "$INSTDIR\data\modules\os_restart.dll" + Delete "$INSTDIR\data\modules\os_reload.dll" + Delete "$INSTDIR\data\modules\os_raw.dll" + Delete "$INSTDIR\data\modules\os_randomnews.dll" + Delete "$INSTDIR\data\modules\os_quit.dll" + Delete "$INSTDIR\data\modules\os_opernews.dll" + Delete "$INSTDIR\data\modules\os_oper.dll" + Delete "$INSTDIR\data\modules\os_oline.dll" + Delete "$INSTDIR\data\modules\os_noop.dll" + Delete "$INSTDIR\data\modules\os_modunload.dll" + Delete "$INSTDIR\data\modules\os_modload.dll" + Delete "$INSTDIR\data\modules\os_modlist.dll" + Delete "$INSTDIR\data\modules\os_modinfo.dll" + Delete "$INSTDIR\data\modules\os_mode.dll" + Delete "$INSTDIR\data\modules\os_logonnews.dll" + Delete "$INSTDIR\data\modules\os_kick.dll" + Delete "$INSTDIR\data\modules\os_jupe.dll" + Delete "$INSTDIR\data\modules\os_info.dll" + Delete "$INSTDIR\data\modules\os_ignore.dll" + Delete "$INSTDIR\data\modules\os_help.dll" + Delete "$INSTDIR\data\modules\os_global.dll" + Delete "$INSTDIR\data\modules\os_defcon.dll" + Delete "$INSTDIR\data\modules\os_clearmodes.dll" + Delete "$INSTDIR\data\modules\os_chanlist.dll" + Delete "$INSTDIR\data\modules\os_chankill.dll" + Delete "$INSTDIR\data\modules\os_akill.dll" + Delete "$INSTDIR\data\modules\os_admin.dll" + Delete "$INSTDIR\data\modules\ns_update.dll" + Delete "$INSTDIR\data\modules\ns_suspend.dll" + Delete "$INSTDIR\data\modules\ns_status.dll" + Delete "$INSTDIR\data\modules\ns_set.dll" + Delete "$INSTDIR\data\modules\ns_sendpass.dll" + Delete "$INSTDIR\data\modules\ns_saset.dll" + Delete "$INSTDIR\data\modules\ns_release.dll" + Delete "$INSTDIR\data\modules\ns_register.dll" + Delete "$INSTDIR\data\modules\ns_recover.dll" + Delete "$INSTDIR\data\modules\ns_maxemail.dll" + Delete "$INSTDIR\data\modules\ns_logout.dll" + Delete "$INSTDIR\data\modules\ns_list.dll" + Delete "$INSTDIR\data\modules\ns_info.dll" + Delete "$INSTDIR\data\modules\ns_identify.dll" + Delete "$INSTDIR\data\modules\ns_help.dll" + Delete "$INSTDIR\data\modules\ns_group.dll" + Delete "$INSTDIR\data\modules\ns_ghost.dll" + Delete "$INSTDIR\data\modules\ns_getpass.dll" + Delete "$INSTDIR\data\modules\ns_getemail.dll" + Delete "$INSTDIR\data\modules\ns_forbid.dll" + Delete "$INSTDIR\data\modules\ns_drop.dll" + Delete "$INSTDIR\data\modules\ns_alist.dll" + Delete "$INSTDIR\data\modules\ns_access.dll" + Delete "$INSTDIR\data\modules\ms_staff.dll" + Delete "$INSTDIR\data\modules\ms_set.dll" + Delete "$INSTDIR\data\modules\ms_sendall.dll" + Delete "$INSTDIR\data\modules\ms_send.dll" + Delete "$INSTDIR\data\modules\ms_rsend.dll" + Delete "$INSTDIR\data\modules\ms_read.dll" + Delete "$INSTDIR\data\modules\ms_list.dll" + Delete "$INSTDIR\data\modules\ms_info.dll" + Delete "$INSTDIR\data\modules\ms_help.dll" + Delete "$INSTDIR\data\modules\ms_del.dll" + Delete "$INSTDIR\data\modules\ms_check.dll" + Delete "$INSTDIR\data\modules\ms_cancel.dll" + Delete "$INSTDIR\data\modules\inspircd11.dll" + Delete "$INSTDIR\data\modules\inspircd10.dll" + Delete "$INSTDIR\data\modules\hybrid.dll" + Delete "$INSTDIR\data\modules\hs_setall.dll" + Delete "$INSTDIR\data\modules\hs_set.dll" + Delete "$INSTDIR\data\modules\hs_request.dll" + Delete "$INSTDIR\data\modules\hs_on.dll" + Delete "$INSTDIR\data\modules\hs_off.dll" + Delete "$INSTDIR\data\modules\hs_list.dll" + Delete "$INSTDIR\data\modules\hs_help.dll" + Delete "$INSTDIR\data\modules\hs_group.dll" + Delete "$INSTDIR\data\modules\hs_delall.dll" + Delete "$INSTDIR\data\modules\hs_del.dll" + Delete "$INSTDIR\data\modules\he_help.dll" + Delete "$INSTDIR\data\modules\enc_old.dll" + Delete "$INSTDIR\data\modules\enc_none.dll" + Delete "$INSTDIR\data\modules\enc_md5.dll" + Delete "$INSTDIR\data\modules\enc_sha1.dll" + Delete "$INSTDIR\data\modules\dreamforge.dll" + Delete "$INSTDIR\data\modules\cs_xop.dll" + Delete "$INSTDIR\data\modules\cs_topic.dll" + Delete "$INSTDIR\data\modules\cs_tban.dll" + Delete "$INSTDIR\data\modules\cs_suspend.dll" + Delete "$INSTDIR\data\modules\cs_status.dll" + Delete "$INSTDIR\data\modules\cs_set.dll" + Delete "$INSTDIR\data\modules\cs_sendpass.dll" + Delete "$INSTDIR\data\modules\cs_register.dll" + Delete "$INSTDIR\data\modules\cs_modes.dll" + Delete "$INSTDIR\data\modules\cs_logout.dll" + Delete "$INSTDIR\data\modules\cs_list.dll" + Delete "$INSTDIR\data\modules\cs_kick.dll" + Delete "$INSTDIR\data\modules\cs_invite.dll" + Delete "$INSTDIR\data\modules\cs_info.dll" + Delete "$INSTDIR\data\modules\cs_identify.dll" + Delete "$INSTDIR\data\modules\cs_help.dll" + Delete "$INSTDIR\data\modules\cs_getpass.dll" + Delete "$INSTDIR\data\modules\cs_getkey.dll" + Delete "$INSTDIR\data\modules\cs_forbid.dll" + Delete "$INSTDIR\data\modules\cs_enforce.dll" + Delete "$INSTDIR\data\modules\cs_drop.dll" + Delete "$INSTDIR\data\modules\cs_clear.dll" + Delete "$INSTDIR\data\modules\cs_ban.dll" + Delete "$INSTDIR\data\modules\cs_appendtopic.dll" + Delete "$INSTDIR\data\modules\cs_akick.dll" + Delete "$INSTDIR\data\modules\cs_access.dll" + Delete "$INSTDIR\data\modules\charybdis.dll" + Delete "$INSTDIR\data\modules\bs_unassign.dll" + Delete "$INSTDIR\data\modules\bs_set.dll" + Delete "$INSTDIR\data\modules\bs_say.dll" + Delete "$INSTDIR\data\modules\bs_kick.dll" + Delete "$INSTDIR\data\modules\bs_info.dll" + Delete "$INSTDIR\data\modules\bs_help.dll" + Delete "$INSTDIR\data\modules\bs_fantasy_unban.dll" + Delete "$INSTDIR\data\modules\bs_fantasy_seen.dll" + Delete "$INSTDIR\data\modules\bs_fantasy_owner.dll" + Delete "$INSTDIR\data\modules\bs_fantasy_kickban.dll" + Delete "$INSTDIR\data\modules\bs_fantasy_kick.dll" + Delete "$INSTDIR\data\modules\bs_fantasy.dll" + Delete "$INSTDIR\data\modules\bs_botlist.dll" + Delete "$INSTDIR\data\modules\bs_bot.dll" + Delete "$INSTDIR\data\modules\bs_badwords.dll" + Delete "$INSTDIR\data\modules\bs_assign.dll" + Delete "$INSTDIR\data\modules\bs_act.dll" + Delete "$INSTDIR\data\modules\bahamut.dll" + Delete "$INSTDIR\data\languages\tr" + Delete "$INSTDIR\data\languages\ru" + Delete "$INSTDIR\data\languages\pt" + Delete "$INSTDIR\data\languages\pl" + Delete "$INSTDIR\data\languages\nl" + Delete "$INSTDIR\data\languages\it" + Delete "$INSTDIR\data\languages\hun" + Delete "$INSTDIR\data\languages\gr" + Delete "$INSTDIR\data\languages\fr" + Delete "$INSTDIR\data\languages\es" + Delete "$INSTDIR\data\languages\en_us" + Delete "$INSTDIR\data\languages\de" + Delete "$INSTDIR\data\languages\cat" + Delete "$INSTDIR\data\example.conf" + Delete "$INSTDIR\data\epona2anope.exe.manifest" + Delete "$INSTDIR\data\epona2anope.exe" + Delete "$INSTDIR\data\db-merger.exe.manifest" + Delete "$INSTDIR\data\db-merger.exe" + Delete "$INSTDIR\data\bin\register" + Delete "$INSTDIR\data\bin\mydbgen" + Delete "$INSTDIR\data\bin\langtool" + Delete "$INSTDIR\data\bin\cp-recursive" + Delete "$INSTDIR\data\bin\anoperc.in" + Delete "$INSTDIR\data\bin\am" + Delete "$INSTDIR\data\anopesmtp.exe.manifest" + Delete "$INSTDIR\data\anopesmtp.exe" + Delete "$INSTDIR\Changes.txt" + Delete "$INSTDIR\Changes.mysql.txt" + Delete "$INSTDIR\Changes.lang.txt" + Delete "$INSTDIR\Changes.conf.txt" + Delete "$INSTDIR\anope.exe.manifest" + Delete "$INSTDIR\anope.exe" +Delete "$INSTDIR\anope.bat" + SetShellVarContext all + + Delete "$SMPROGRAMS\Anope\Uninstall.lnk" + Delete "$SMPROGRAMS\Anope\Website.lnk" + Delete "$DESKTOP\Anope IRC Services.lnk" + Delete "$SMPROGRAMS\Anope\Anope IRC Services.lnk" + Delete "$SMPROGRAMS\Anope\Advanced\Anope IRC Services (Debug and Window Logging).lnk" + Delete "$SMPROGRAMS\Anope\Advanced\Anope IRC Services (Window Logging).lnk" + Delete "$SMPROGRAMS\Anope\Advanced\Anope IRC Services (No Third Party Modules).lnk" + +RMDir "$SMPROGRAMS\Anope\Advanced" + + RMDir "$SMPROGRAMS\Anope" + RMDir "$INSTDIR\docs" + RMDir "$INSTDIR\data\modules" + RMDir "$INSTDIR\data\logs" + RMDir "$INSTDIR\data\languages" + RMDir "$INSTDIR\data\bin" +RMDir "$INSTDIR\data\backups" + RMDir "$INSTDIR\data" + RMDir "$INSTDIR" + + DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" + DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}" + SetAutoClose true +SectionEnd \ No newline at end of file diff --git a/src/tools/Makefile b/src/tools/Makefile new file mode 100644 index 000000000..c0aa9fb85 --- /dev/null +++ b/src/tools/Makefile @@ -0,0 +1,39 @@ +SRCS = anopesmtp.c db-merger.c epona2anope.c +OBJS = $(SRCS:.c=.o) + +INCLUDES = ../../include/services.h + +MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \ + 'LDFLAGS=${LDFLAGS}' 'BINDEST=${BINDEST}' 'INSTALL=${INSTALL}' \ + 'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \ + 'TOUCH=${TOUCH}' 'SHELL=${SHELL}' 'DATDEST=${DATDEST}' \ + 'RUNGROUP=${RUNGROUP}' + +.c.o: + $(CC) $(CFLAGS) -I../include/ -c $< + +all: ${OBJS} + +distclean: spotless + +anopesmpt: $(OBJS) + $(CC) $(CFLAGS) $(OBJS) $(ANOPELIBS) $(MLIBS) -o $@ $(LDFLAGS) + +$(OBJS): Makefile +anopesmtp.o: anopesmtp.c $(INCLUDES) +db-merger.o: db-merger.c $(INCLUDES) +epona2anope.o: epona2anope.c $(INCLUDES) + +clean: + rm -f *.o anopesmtp a.out db-merger epona2anope + +spotless: clean + +install: anopesmtp db-merger epona2anope + test -d ${BINDEST} || mkdir ${BINDEST} + test -d $(BINDEST)/tools || mkdir $(BINDEST)/tools + $(INSTALL) anopesmtp $(BINDEST)/tools/anopesmtp + $(INSTALL) db-merger $(BINDEST)/tools/db-merger + $(INSTALL) epona2anope $(BINDEST)/tools/epona2anope + +DUMMY: diff --git a/src/tools/Makefile.win32 b/src/tools/Makefile.win32 new file mode 100644 index 000000000..77e7f2c91 --- /dev/null +++ b/src/tools/Makefile.win32 @@ -0,0 +1,29 @@ +include ../../Makefile.inc.win32 + +SRCS=anopesmtp.c epona2anope.c db-merger.c +OBJECTS= $(SRCS:.c=.exe) +CFLAGS=$(CFLAGS) /I"../../include" +LFLAGS=/link wsock32.lib $(LIBS) $(LFLAGS) + +all: $(OBJECTS) + +distclean: clean spotless + +.c.exe: + $(CC) $(CFLAGS) $< $(LFLAGS) + +clean: + -@del *.obj + +spotless: clean + -@del *.exe *.lib *.exp + +install: exe_install manifest_install + +exe_install: FRC + -@copy *.exe ..\..\$(DATDEST)\ + +manifest_install: FRC + -@copy *.manifest ..\..\$(DATDEST)\ + +FRC: diff --git a/src/tools/README b/src/tools/README new file mode 100644 index 000000000..3acb80ad2 --- /dev/null +++ b/src/tools/README @@ -0,0 +1,58 @@ +Anope Bundled Tools +------------------- + +1) Anope SMTP Client +2) Anope Database Merger +3) Epona to Anope Database Converter + +1) Anope SMTP Client + + Provided with Anope is a simple SMTP client which can be used instead of + programs like SendMail in some cases. + + The SMTP client can be used instead of sendmail for use with Anope's mail + options. To use the SMTP client instead of sendmail, find the line in your + services configuration file (services.conf) that defines SendMailPath. On + that line, change the path to your services installation directory, then + followed by "tools/anopesmtp" and the IP address of a valid SMTP server. It + should look like this: + + SendMailPath "/home/anope/services/tools/anopesmtp 127.0.0.1" + + If the SMTP client doesn't send mail, or if there's an other problem with + it, you can compile it in debug mode. To do this, open smtp.h, and look + for "smtp_debug" near the bottom. Change this from 0 to 1 and recompile + the code. This should generate a log file of what happened when it tried + to connect to the SMTP server. + + Credits: + Originally written by Dominick Meglio + Ported to *nix by Trystan Scott Lee + +2) Anope Database Merger + + This program tries to merge two standard Anope database sets (ChanServ, + NickServ, BotServ, and MemoServ). + + To merge two database sets, put them both in the folder where the merger + is located. The first database set must be named 1.db (nick1.db, + chan1.db, etc); the second database set must be named 2.db (nick2.db, + chan2.db, etc). If you execute the merger now the databases will be merged + into databases named .db. + + Credits: + Written by Florian Schulze + +3) Epona to Anope Database Converter + + This program tries to convert databases made by epona .4.15 and up to + standard anope databases. Currently, only the ChanServ database needs to + be converted. + + Put your Epona (ChanServ) database in the folder where the epona2anope + executable file is located. Rename this ChanServ database file to + chan1.db and then run the converter (epona2anope). A new database called + chan.db will be created; this file is Anope-compatible. + + Credits: + Written by Florian Schulze diff --git a/src/tools/anopesmtp.c b/src/tools/anopesmtp.c new file mode 100644 index 000000000..4ff0c6fcf --- /dev/null +++ b/src/tools/anopesmtp.c @@ -0,0 +1,604 @@ +/* smtp stuff handler for win32. + * + * (C) 2003-2008 Anope Team + * Contact us at info@anope.org + * + * Please read COPYING and README for furhter details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + * + * Written by Dominick Meglio + * *nix port by Trystan Scott Lee + * + */ + +#include "smtp.h" + +static FILE *logfile; +static int curday = 0; + +/*************************************************************************/ + +#ifdef _WIN32 +int strcasecmp(const char *s1, const char *s2) +{ + register int c; + + while ((c = tolower(*s1)) == tolower(*s2)) { + if (c == 0) + return 0; + s1++; + s2++; + } + if (c < tolower(*s2)) + return -1; + return 1; +} +#endif + +static int get_logname(char *name, int count, struct tm *tm) +{ + + char timestamp[32]; + + if (!tm) { + time_t t; + + time(&t); + tm = localtime(&t); + } + + strftime(timestamp, count, "%Y%m%d", tm); + snprintf(name, count, "logs/%s.%s", "anopesmtp", timestamp); + curday = tm->tm_yday; + + return 1; +} + +/*************************************************************************/ + +/* Close the log file. */ + +void close_log(void) +{ + if (!logfile) + return; + fclose(logfile); + logfile = NULL; +} + +/*************************************************************************/ + +static void remove_log(void) +{ + time_t t; + struct tm tm; + + char name[PATH_MAX]; + + time(&t); + t -= (60 * 60 * 24 * 30); + tm = *localtime(&t); + + if (!get_logname(name, sizeof(name), &tm)) + return; + unlink(name); +} + +/*************************************************************************/ + +/* Open the log file. Return -1 if the log file could not be opened, else + * return 0. */ + +int open_log(void) +{ + char name[PATH_MAX]; + + if (logfile) + return 0; + + if (!get_logname(name, sizeof(name), NULL)) + return 0; + logfile = fopen(name, "a"); + + if (logfile) + setbuf(logfile, NULL); + return logfile != NULL ? 0 : -1; +} + +/*************************************************************************/ + +static void checkday(void) +{ + time_t t; + struct tm tm; + + time(&t); + tm = *localtime(&t); + + if (curday != tm.tm_yday) { + close_log(); + remove_log(); + open_log(); + } +} + +/*************************************************************************/ + +/* Log stuff to the log file with a datestamp. Note that errno is + * preserved by this routine and log_perror(). + */ + +void alog(const char *fmt, ...) +{ + va_list args; + time_t t; + struct tm tm; + char buf[256]; + int errno_save = errno; + + if (!smtp_debug) { + return; + } + + checkday(); + + if (!fmt) { + return; + } + + va_start(args, fmt); + time(&t); + tm = *localtime(&t); + strftime(buf, sizeof(buf) - 1, "[%b %d %H:%M:%S %Y] ", &tm); + if (logfile && args) { + fputs(buf, logfile); + vfprintf(logfile, fmt, args); + fputc('\n', logfile); + } + va_end(args); + errno = errno_save; +} + +/*************************************************************************/ + +/* Remove a trailing \r\n */ +char *strip(char *buf) +{ + char *c; + if ((c = strchr(buf, '\n'))) + *c = 0; + if ((c = strchr(buf, '\r'))) + *c = 0; + return buf; +} + +/*************************************************************************/ + +/* Convert a trailing \n to \r\n + * The caller must free the allocated memory + */ +char *lftocrlf(char *buf) +{ + char *result = malloc(strlen(buf) + 2); + strip(buf); + strcpy(result, buf); + strcat(result, "\r\n"); + return result; +} + +/*************************************************************************/ + +/* Add a header to the list */ +void smtp_add_header(char *header) +{ + struct smtp_header *head = malloc(sizeof(struct smtp_header)); + + head->header = lftocrlf(header); + head->next = NULL; + + if (!mail.smtp_headers) { + mail.smtp_headers = head; + } + if (mail.smtp_headers_tail) { + mail.smtp_headers_tail->next = head; + } + mail.smtp_headers_tail = head; +} + +/*************************************************************************/ + +/* Is the buffer a header? */ +int smtp_is_header(char *buf) +{ + char *tmp = strchr(buf, ' '); + + if (!tmp) + return 0; + + if (*(tmp - 1) == ':') + return 1; + return 0; +} + +/*************************************************************************/ + +/* Parse a header into a name and value */ +void smtp_parse_header(char *buf, char **header, char **value) +{ + strip(buf); + + *header = strtok(buf, " "); + *value = strtok(NULL, ""); + if (*header) + (*header)[strlen(*header) - 1] = 0; +} + +/*************************************************************************/ + +/* Have we reached the end of input? */ +int smtp_is_end(char *buf) +{ + if (*buf == '.') + if (*(buf + 1) == '\r' || *(buf + 1) == '\n') + return 1; + + return 0; +} + +/*************************************************************************/ + +/* Set who the email is from */ +void smtp_set_from(char *from) +{ + mail.from = strdup(from); +} + +/*************************************************************************/ + +/* Set who the email is to */ +void smtp_set_to(char *to) +{ + char *c; + + if ((c = strrchr(to, '<')) && *(c + 1)) { + to = c + 1; + to[strlen(to) - 1] = 0; + } + mail.to = strdup(to); +} + +/*************************************************************************/ + +/* Add a line of body text */ +void smtp_add_body_line(char *line) +{ + struct smtp_body_line *body; + + body = malloc(sizeof(struct smtp_body_line)); + + body->line = lftocrlf(line); + body->next = NULL; + + if (!mail.smtp_body) + mail.smtp_body = body; + if (mail.smtp_body_tail) + mail.smtp_body_tail->next = body; + mail.smtp_body_tail = body; + +} + +/*************************************************************************/ + +/* Establish a connection to the SMTP server */ +int smtp_connect(char *host, unsigned short port) +{ + struct sockaddr_in addr; + + if ((mail.sock = socket(AF_INET, SOCK_STREAM, 0)) == SOCKET_ERROR) + return 0; + + if ((addr.sin_addr.s_addr = inet_addr(host)) == INADDR_NONE) { + struct hostent *hent; + if (!(hent = gethostbyname(host))) + return 0; + memcpy(&addr.sin_addr, hent->h_addr, hent->h_length); + } + addr.sin_family = AF_INET; + addr.sin_port = htons(port ? port : 25); + if (connect(mail.sock, (struct sockaddr *) &addr, sizeof(struct sockaddr_in)) == SOCKET_ERROR) { + ano_sockclose(mail.sock); + return 0; + } + + return 1; +} + +/*************************************************************************/ + +/* Send a line of text */ +int smtp_send(char *text) +{ + int result = ano_sockwrite(mail.sock, text, strlen(text)); + + alog("SMTP: sent %s",text); + + if (result == SOCKET_ERROR) + ano_sockclose(mail.sock); + + return result; +} + +/*************************************************************************/ + +/* Read a line of text */ +int smtp_read(char *buf, int len) +{ + int result; + + memset(buf, 0, len); + result = ano_sockread(mail.sock, buf, len); + + if (result == SOCKET_ERROR) + ano_sockclose(mail.sock); + + return result; +} + +/*************************************************************************/ + +/* Retrieve a response code */ +int smtp_get_code(char *text) +{ + char *tmp = strtok(text, " "); + + if (!tmp) + return 0; + + return atol(tmp); +} + +/*************************************************************************/ + +/* Send the email */ +int smtp_send_email() +{ + char buf[1024]; + struct smtp_header *head; + struct smtp_body_line *body; + int code; + int skip_done = 0; + + if (!smtp_read(buf, 1024)) { + alog("SMTP: error reading buffer"); + return 0; + } + + code = smtp_get_code(buf); + if (code != 220) { + alog("SMTP: error expected code 220 got %d",code); + return 0; + } + + if (!smtp_send("HELO anope\r\n")) { + alog("SMTP: error writting to socket"); + return 0; + } + + if (!smtp_read(buf, 1024)) { + alog("SMTP: error reading buffer"); + return 0; + } + + code = smtp_get_code(buf); + if (code != 250) { + alog("SMTP: error expected code 250 got %d",code); + return 0; + } + + strcpy(buf, "MAIL FROM: <"); + strcat(buf, mail.from); + strcat(buf, ">\r\n"); + + if (!smtp_send(buf)) { + alog("SMTP: error writting to socket"); + return 0; + } + + if (!smtp_read(buf, 1024)) { + alog("SMTP: error reading buffer"); + return 0; +