Bug 368103 Make mailnews/import build into only one shared library for SeaMonkey. r=mnyromyr+mscott,sr=Neil

This commit is contained in:
bugzilla%standard8.demon.co.uk 2007-02-14 16:56:29 +00:00
Родитель 55b362c337
Коммит f96a0c5abb
15 изменённых файлов: 22 добавлений и 856 удалений

Просмотреть файл

@ -45,7 +45,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = import
PACKAGE_FILE = msgimport.pkg
PACKAGE_VARS += MOZ_STATIC_MAIL_BUILD
DIRS = public src text comm4x
@ -60,8 +59,6 @@ DIRS += oexpress outlook
endif
endif
ifdef MOZ_STATIC_MAIL_BUILD
DIRS += build
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -124,9 +124,19 @@ LOCAL_INCLUDES += -I$(srcdir)/../oexpress \
endif
endif
ifdef MOZ_STATIC_MAIL_BUILD
EXTRA_DSO_LDOPTS += ../../base/util/$(LIB_PREFIX)msgbsutl_s.$(LIB_SUFFIX)
else
ifeq ($(USE_SHORT_LIBNAME),1)
EXTRA_DSO_LIBS = msgbsutl
else
EXTRA_DSO_LIBS = msgbaseutil
endif # ifeq
endif # MOZ_STATIC_MAIL_BUILD
EXTRA_DSO_LDOPTS += \
$(LIBS_DIR) \
../../base/util/$(LIB_PREFIX)msgbsutl_s.$(LIB_SUFFIX) \
$(EXTRA_DSO_LIBS) \
$(MOZ_UNICHARUTIL_LIBS) \
$(DEPTH)/modules/libreg/src/$(LIB_PREFIX)mozreg_s.$(LIB_SUFFIX) \
$(MOZ_COMPONENT_LIBS) \

Просмотреть файл

@ -43,28 +43,8 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = impComm4xMail
ifndef MOZ_STATIC_MAIL_BUILD
LIBRARY_NAME = impComm4xMail
# don't define SHORT_LIBNAME on WINNT
# see bug # 141438
ifneq ($(OS_ARCH),WINNT)
SHORT_LIBNAME = imp4Mail
endif
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = nsComm4xMailImportModule
else
LIBRARY_NAME = imp4mail_s
endif
PACKAGE_FILE = importcomm4x.pkg
MOZILLA_INTERNAL_API = 1
@ -87,32 +67,9 @@ CPPSRCS = \
nsComm4xProfile.cpp \
$(NULL)
ifndef MOZ_STATIC_MAIL_BUILD
CPPSRCS += nsComm4xMailFactory.cpp
ifeq ($(USE_SHORT_LIBNAME),1)
EXTRA_DSO_LIBS = msgbsutl
else
EXTRA_DSO_LIBS = msgbaseutil
endif
EXTRA_DSO_LDOPTS = \
$(LIBS_DIR) \
$(EXTRA_DSO_LIBS) \
$(DEPTH)/modules/libreg/src/$(LIB_PREFIX)mozreg_s.$(LIB_SUFFIX) \
$(MOZ_COMPONENT_LIBS) \
$(MOZ_XPCOM_OBSOLETE_LIBS) \
$(NULL)
else
# we don't want the shared lib, but we want to force the creation of a static lib.
FORCE_STATIC_LIB = 1
endif
include $(topsrcdir)/config/rules.mk
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))

Просмотреть файл

@ -44,20 +44,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = impEudra
PACKAGE_FILE = importeudora.pkg
ifndef MOZ_STATIC_MAIL_BUILD
LIBRARY_NAME = impEudra
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = nsEudoraImportModule
else
LIBRARY_NAME = impEudra_s
endif
META_COMPONENT = mail
MOZILLA_INTERNAL_API = 1
@ -99,33 +86,7 @@ REQUIRES += macmorefiles
CPPSRCS += nsEudoraMac.cpp
endif
ifndef MOZ_STATIC_MAIL_BUILD
CPPSRCS += nsEudoraFactory.cpp
ifeq ($(USE_SHORT_LIBNAME),1)
EXTRA_DSO_LIBS = msgbsutl
else
EXTRA_DSO_LIBS = msgbaseutil
endif
EXTRA_DSO_LDOPTS = \
$(LIBS_DIR) \
$(EXTRA_DSO_LIBS) \
$(MOZ_XPCOM_OBSOLETE_LIBS) \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_COMPONENT_LIBS) \
$(NULL)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
EXTRA_DSO_LDOPTS += $(TK_LIBS)
endif
else
# we don't want the shared lib, but we want to force the creation of a static lib.
FORCE_STATIC_LIB = 1
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -1,6 +1 @@
[xpfe-mailnews]
#if !MOZ_STATIC_MAIL_BUILD
dist/bin/components/@DLLP@import@DLLS@
#endif
!xpt dist/bin/components/import.xpt

Просмотреть файл

@ -44,18 +44,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = importOE
PACKAGE_FILE = importoe.pkg
ifndef MOZ_STATIC_MAIL_BUILD
LIBRARY_NAME = importOE
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = nsOEImport
else
LIBRARY_NAME = importOE_s
endif
MOZILLA_INTERNAL_API = 1
META_COMPONENT = mail
@ -89,28 +78,7 @@ CPPSRCS = \
nsOEStringBundle.cpp \
$(NULL)
ifndef MOZ_STATIC_MAIL_BUILD
CPPSRCS += nsOEFactory.cpp
ifdef USE_SHORT_LIBNAME
EXTRA_DSO_LIBS = msgbsutl
else
EXTRA_DSO_LIBS = msgbaseutil
endif
EXTRA_DSO_LDOPTS = \
$(EXTRA_DSO_LIBS) \
$(MOZ_COMPONENT_LIBS) \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_XPCOM_OBSOLETE_LIBS) \
$(NULL)
else
# we don't want the shared lib, but we want to force the creation of a static lib.
FORCE_STATIC_LIB = 1
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -44,18 +44,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = impOutlk
PACKAGE_FILE = importoutlook.pkg
ifndef MOZ_STATIC_MAIL_BUILD
LIBRARY_NAME = impOutlk
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = nsOutlookImport
else
LIBRARY_NAME = impOutlk_s
endif
META_COMPONENT = mail
MOZILLA_INTERNAL_API = 1
@ -93,29 +82,7 @@ CPPSRCS = \
nsOutlookCompose.cpp \
$(NULL)
ifndef MOZ_STATIC_MAIL_BUILD
CPPSRCS += nsOutlookFactory.cpp
ifdef USE_SHORT_LIBNAME
EXTRA_DSO_LIBS = msgbsutl
else
EXTRA_DSO_LIBS = msgbaseutil
endif
EXTRA_DSO_LDOPTS = \
$(LIBS_DIR) \
$(EXTRA_DSO_LIBS) \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_COMPONENT_LIBS) \
$(MOZ_XPCOM_OBSOLETE_LIBS) \
$(NULL)
else
# we don't want the shared lib, but we want to force the creation of a static lib.
FORCE_STATIC_LIB = 1
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -43,17 +43,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = import
ifndef MOZ_STATIC_MAIL_BUILD
LIBRARY_NAME = import
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = nsImportServiceModule
else
LIBRARY_NAME = import_s
endif
META_COMPONENT = mail
MOZILLA_INTERNAL_API = 1
@ -92,28 +82,7 @@ CPPSRCS = \
nsImportFieldMap.cpp \
$(NULL)
ifndef MOZ_STATIC_MAIL_BUILD
CPPSRCS += nsImportFactory.cpp
ifeq ($(USE_SHORT_LIBNAME),1)
EXTRA_DSO_LIBS = msgbsutl
else
EXTRA_DSO_LIBS = msgbaseutil
endif
EXTRA_DSO_LDOPTS += \
$(LIBS_DIR) \
$(EXTRA_DSO_LIBS) \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_COMPONENT_LIBS) \
$(MOZ_XPCOM_OBSOLETE_LIBS) \
$(NULL)
else
# we don't want the shared lib, but we want to force the creation of a static lib.
FORCE_STATIC_LIB = 1
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -45,30 +45,21 @@ include $(DEPTH)/config/autoconf.mk
MODULE = impText
PACKAGE_FILE = importtext.pkg
ifndef MOZ_STATIC_MAIL_BUILD
LIBRARY_NAME = impText
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = nsTextImportModule
else
LIBRARY_NAME = imptext_s
endif
META_COMPONENT = mail
MOZILLA_INTERNAL_API = 1
REQUIRES = xpcom \
xpcom_obsolete \
string \
import \
intl \
necko \
addrbook \
pref \
mork \
$(NULL)
REQUIRES = xpcom \
xpcom_obsolete \
string \
import \
intl \
necko \
addrbook \
pref \
mork \
$(NULL)
CPPSRCS = \
nsTextStringBundle.cpp \
@ -76,20 +67,9 @@ CPPSRCS = \
nsTextAddress.cpp \
$(NULL)
ifndef MOZ_STATIC_MAIL_BUILD
CPPSRCS += nsTextFactory.cpp
EXTRA_DSO_LDOPTS = \
$(MOZ_COMPONENT_LIBS) \
$(MOZ_XPCOM_OBSOLETE_LIBS) \
$(NULL)
else
LOCAL_INCLUDES += -I$(srcdir)/../../src
# we don't want the shared lib, but we want to force the creation of a static lib.
FORCE_STATIC_LIB = 1
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -1,88 +0,0 @@
function upgradeCleanup()
{
// Obsolete files and generated files that
// need to be cleaned up.
deleteThisFile("Program", "msgMapi.dll");
deleteThisFile("Components", "signed.dll");
deleteThisFile("Components", "smimestb.dll");
deleteThisFile("Components", "nsMapiRegistry.dll");
deleteThisFile("Components", "absyncsv.dll");
deleteThisFile("Components", "addrbook.xpt");
deleteThisFile("Components", "impComm4xMail.xpt");
deleteThisFile("Components", "import.xpt");
deleteThisFile("Components", "mailnews.xpt");
deleteThisFile("Components", "mailview.xpt");
deleteThisFile("Components", "mime.xpt");
deleteThisFile("Components", "msgbase.xpt");
deleteThisFile("Components", "msgcompose.xpt");
deleteThisFile("Components", "msgdb.xpt");
deleteThisFile("Components", "msgimap.xpt");
deleteThisFile("Components", "msglocal.xpt");
deleteThisFile("Components", "msgnews.xpt");
deleteThisFile("Components", "msgsearch.xpt");
deleteThisFile("Components", "msgsmime.xpt");
}
// main
var srDest;
var err;
var fProgram;
srDest = $SpaceRequired$:bin;
err = initInstall("SeaMonkey Mail", "Mail", "$Version$");
logComment("initInstall: " + err);
fProgram = getFolder("Program");
logComment("fProgram: " + fProgram);
if(verifyDiskSpace(fProgram, srDest))
{
setPackageFolder(fProgram);
upgradeCleanup();
err = addDirectory("",
"$Version$",
"bin", // dir name in jar to extract
fProgram, // Where to put this file (Returned from GetFolder)
"", // subdir name to create relative to fProgram
true); // Force Flag
logComment("addDirectory() returned: " + err);
// check return value
if( err == SUCCESS )
{
// register chrome
registerChrome(CONTENT | DELAYED_CHROME,
getFolder("Chrome","messenger.jar"),
"content/messenger/");
registerChrome(CONTENT | DELAYED_CHROME,
getFolder("Chrome","messenger.jar"),
"content/messenger-region/");
registerChrome(CONTENT | DELAYED_CHROME,
getFolder("Chrome","messenger.jar"),
"content/messenger-smime/");
registerChrome(CONTENT | DELAYED_CHROME,
getFolder("Chrome","messenger.jar"),
"content/messenger-mdn/");
registerChrome(CONTENT | DELAYED_CHROME,
getFolder("Chrome","messenger.jar"),
"content/messenger-views/");
// check return value
err = getLastError();
if(err == SUCCESS)
{
err = performInstall();
logComment("performInstall() returned: " + err);
}
else
cancelInstall(err);
}
else
cancelInstall(err);
}
else
cancelInstall(INSUFFICIENT_DISK_SPACE);
// end main

Просмотреть файл

@ -456,12 +456,6 @@ bin/components/vcard.dll
bin/components/smimestb.dll
bin/components/import.dll
bin/components/import.xpt
;bin/components/importOE.dll
;bin/components/impOutlk.dll
;bin/components/impEudra.dll
bin/components/impText.dll
;bin/components/impComm4xMail.dll
bin/components/imp4Mail.dll
bin/components/impComm4xMail.xpt
bin/components/nsAbLDAPAttributeMap.js
bin/components/nsLDAPPrefsService.js

Просмотреть файл

@ -450,8 +450,6 @@ bin/components/libmsgnews.so
bin/components/libvcard.so
bin/components/libsmimestb.so
bin/components/libimport.so
bin/components/libimpText.so
bin/components/libimpComm4xMail.so
bin/components/mailnews.xpt
bin/components/mime.xpt
bin/components/msgbase.xpt

Просмотреть файл

@ -313,11 +313,6 @@ bin\components\vcard.dll
bin\components\smimestb.dll
bin\components\import.dll
bin\components\import.xpt
bin\components\importOE.dll
bin\components\impOutlk.dll
bin\components\impEudra.dll
bin\components\impText.dll
bin\components\impComm4xMail.dll
bin\components\impComm4xMail.xpt
bin\components\nsAbLDAPAttributeMap.js
bin\components\nsLDAPPrefsService.js

Просмотреть файл

@ -1,63 +0,0 @@
function upgradeCleanup()
{
// Obsolete files from Netscape 6.0 and Netscape 6.01 that
// need to be cleaned up.
deleteThisFile("Components", "libsigned.so");
}
var srDest = $SpaceRequired$;
var err = initInstall("$AppDisplayName$ Mail", "Mail", "$Version$");
logComment("initInstall: " + err);
var communicatorFolder = getFolder("Program");
logComment("communicatorFolder: " + communicatorFolder);
if (verifyDiskSpace(communicatorFolder, srDest))
{
// Call upgradeCleanup() before addDirectory() in case we accidentaly
// delete files that we happen to be also installing. This way, if we do,
// it will just get reinstalled. This is for safety measure.
upgradeCleanup();
err = addDirectory("Program",
"$Version$",
"bin", // jar source folder
communicatorFolder, // target folder
"", // target subdir
true ); // force flag
logComment("addDirectory() returned: " + err);
registerChrome(CONTENT | DELAYED_CHROME,
getFolder("Chrome","messenger.jar"),
"content/messenger/");
registerChrome(CONTENT | DELAYED_CHROME,
getFolder("Chrome","messenger.jar"),
"content/messenger-region/");
registerChrome(CONTENT | DELAYED_CHROME,
getFolder("Chrome","messenger.jar"),
"content/messenger-smime/");
registerChrome(CONTENT | DELAYED_CHROME,
getFolder("Chrome","messenger.jar"),
"content/messenger-mdn/");
registerChrome(CONTENT | DELAYED_CHROME,
getFolder("Chrome","messenger.jar"),
"content/messenger-views/");
if (err==SUCCESS)
{
err = performInstall();
logComment("performInstall() returned: " + err);
}
else
{
cancelInstall(err);
logComment("cancelInstall() due to error: " + err);
}
}
else
cancelInstall(INSUFFICIENT_DISK_SPACE);

Просмотреть файл

@ -1,474 +0,0 @@
function IsWinnt()
{
/* Determines if the script is running under NT or not.
*
*/
var winreg = getWinRegistry();
var subkey;
var szCurrentVersion;
winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);
subkey = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion";
szCurrentVersion = winreg.getValueString(subkey, "CurrentVersion");
logComment("szCurrentVersion: " + szCurrentVersion);
if((szCurrentVersion == "") || (szCurrentVersion == null))
{
return false;
}
else
{
return true;
}
}
function registerProgramFolderKey(winreg, fFolderPath)
{
var subkey;
var err;
/* set the Program Folder Path in the Mozilla key in the Windows Registry */
winreg.createKey("SOFTWARE\\$CompanyName$", "");
subkey = "SOFTWARE\\$CompanyName$\\$ProductName$";
winreg.createKey(subkey,"");
err = winreg.setValueString(subkey, "CurrentVersion", "$UserAgent$");
subkey = "SOFTWARE\\$CompanyName$\\$ProductName$\\$UserAgent$";
winreg.createKey(subkey,"");
subkey = "SOFTWARE\\$CompanyName$\\$ProductName$\\$UserAgent$\\Main";
winreg.createKey(subkey,"");
err = winreg.setValueString(subkey, "Program Folder Path", fFolderPath);
}
function createShortcuts()
{
var subkey;
var szStartMenuPrograms;
var szStartMenu;
var szFolderDesktop;
var szFolderQuickLaunch;
var szFolderSendTo;
var szFolderAppData;
var winreg;
var fWindows;
var fTemp;
var fProgram;
var fileExe;
var scExeDesc;
var scProfileDesc;
var scProfileDescParam;
var scFolderName;
var fFolderDesktop;
var fFolderPath;
var fFolderPathStr;
var fFolderQuickLaunch;
var is_winnt;
var szCurrentVersion;
var restrictedAccess;
var ikwDefined;
var folderQuickLaunchExists;
var filePalmSyncInstallExe;
var scDescPalmSyncInstall;
var scDescPalmSyncUninstall;
var folderPalmSyncName;
winreg = getWinRegistry();
fWindows = getFolder("Windows");
fProgram = getFolder("Program");
fileExe = getFolder("Program", "$MainExeFile$");
filePalmSyncInstallExe = getFolder("Program", "PalmSyncInstall.exe");
scDescPalmSyncInstall = "Address Book Palm Sync Install";
scDescPalmSyncUninstall = "Address Book Palm Sync Uninstall";
filePalmSyncReadme = getFolder("Program", "palm.html");
scDescPalmSyncReadme = "Palm Sync User Guide";
fileMailIcon = getFolder("Chrome", "icons/default/messengerWindow.ico");
scExeDesc = "Mail";
scParam = "-mail";
scFolderName = "$ProductName$";
folderPalmSyncName = "Palm Tools";
if(winreg != null)
{
/* This will check to see if the user has restricted access or not.
* It checks to see if HKEY_LOCALMACHINE\SOFTWARE is writable. If
* it is, then access is not restricted. This is only used to
* determine which Desktop, Programs, and Start Menu folders
* are to used: common or per user
*/
restrictedAccess = false;
ikwDefined = typeof(winreg.isKeyWritable);
logComment("winreg.isKeyWritable(): " + ikwDefined);
if(ikwDefined == "function")
{
winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);
if(!winreg.isKeyWritable("SOFTWARE"))
restrictedAccess = true;
}
/* determine if the script is running under NT or not */
winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);
subkey = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion";
szCurrentVersion = winreg.getValueString(subkey, "CurrentVersion");
logComment("szCurrentVersion: " + szCurrentVersion);
if((szCurrentVersion == "") || (szCurrentVersion == null))
{
is_winnt = false;
}
else
{
is_winnt = true;
}
logComment("is_winnt value: " + is_winnt);
logComment("restrictedAccess value: " + restrictedAccess);
if(!is_winnt || restrictedAccess)
{
winreg.setRootKey(winreg.HKEY_CURRENT_USER);
subkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
szStartMenuPrograms = winreg.getValueString(subkey, "Programs");
szStartMenu = winreg.getValueString(subkey, "Start Menu");
szFolderDesktop = winreg.getValueString(subkey, "Desktop");
}
else
{
winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);
subkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
szStartMenuPrograms = winreg.getValueString(subkey, "Common Programs");
szStartMenu = winreg.getValueString(subkey, "Common Start Menu");
szFolderDesktop = winreg.getValueString(subkey, "Common Desktop");
}
winreg.setRootKey(winreg.HKEY_CURRENT_USER);
subkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
szFolderSendTo = winreg.getValueString(subkey, "SendTo");
subkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
szFolderAppData = winreg.getValueString(subkey, "AppData");
// locate the Quick Launch folder
szFolderQuickLaunch = szFolderAppData + "\\Microsoft\\Internet Explorer\\Quick Launch";
fFolderQuickLaunch = getFolder("file:///", szFolderQuickLaunch);
folderQuickLaunchExists = File.isDirectory(fFolderQuickLaunch);
if(!folderQuickLaunchExists)
{
subkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\GrpConv\\MapGroups";
szFolderQuickLaunch = winreg.getValueString(subkey, "Quick Launch");
folderQuickLaunchExists = File.isDirectory(fFolderPath);
if(folderQuickLaunchExists)
fFolderQuickLaunch = getFolder("file:///", szFolderQuickLaunch);
}
logComment("folderQuickLaunchExists: " + folderQuickLaunchExists);
subkey = "SOFTWARE\\$CompanyName$\\$ProductName$\\$UserAgent$\\Main";
fFolderPathStr = winreg.getValueString(subkey, "Program Folder Path");
if((fFolderPathStr == "") || (fFolderPathStr == null))
{
fTemp = szStartMenuPrograms + "\\" + scFolderName;
fFolderPath = getFolder("file:///", fTemp);
}
else
{
/* convert the path string to a path folder object */
fFolderPath = getFolder("file:///", fFolderPathStr);
}
/* convert the path string to a path folder object */
fFolderDesktop = getFolder("file:///", szFolderDesktop);
logComment("Folder StartMenuPrograms: " + szStartMenuPrograms);
logComment("Folder StartMenu : " + szStartMenu);
logComment("Folder FolderDesktop : " + szFolderDesktop);
logComment("Folder FolderSendTo : " + szFolderSendTo);
logComment("Folder FolderQuickLaunch: " + szFolderQuickLaunch);
logComment("fileExe : " + fileExe);
logComment("fFolderPath : " + fFolderPath);
logComment("scExeDesc : " + scExeDesc);
logComment("fProgram : " + fProgram);
/* explicitly create the fFolderPath even though the windowsShortcut function creates the folder.
* This is so that the folder creation gets logged for uninstall to remove it. */
if(!File.exists(fFolderPath))
File.dirCreate(fFolderPath);
/* create the shortcuts */
File.windowsShortcut(fileExe, fFolderPath, scExeDesc, fProgram, scParam, fileMailIcon, 0);
// only create these two shortcuts if the files exist
if(File.exists(filePalmSyncInstallExe))
{
/* build the path to the sub folder to Palm Sync files */
var fStartMenuPalmSync = getFolder("file:///", fFolderPath + "/" + folderPalmSyncName);
if(!File.exists(fStartMenuPalmSync))
File.dirCreate(fStartMenuPalmSync);
/* clean up the shortcuts in the old place */
deleteThisFile("file:///", fFolderPath + "/" + scDescPalmSyncInstall);
deleteThisFile("file:///", fFolderPath + "/" + scDescPalmSyncUninstall);
/* create the shortcuts in the new sub folder */
File.windowsShortcut(filePalmSyncInstallExe, fStartMenuPalmSync, scDescPalmSyncInstall, fProgram, "", filePalmSyncInstallExe, 0);
File.windowsShortcut(filePalmSyncInstallExe, fStartMenuPalmSync, scDescPalmSyncUninstall, fProgram, "/u", filePalmSyncInstallExe, 1);
// only create the palm sync readme shortcut if the file exist
if(File.exists(filePalmSyncReadme))
{
/* create the shortcuts in the new sub folder */
File.windowsShortcut(filePalmSyncReadme, fStartMenuPalmSync, scDescPalmSyncReadme, fProgram, "", filePalmSyncReadme, 0);
}
}
//
// Disabled for now because mail does not have a different shortcut icon from Mozilla
//
//// create shortcut in the Quick Launch folder
//if(folderQuickLaunchExists)
// File.windowsShortcut(fileExe, fFolderQuickLaunch, scExeDesc, fProgram, "", fileExe, 0);
if(!restrictedAccess)
{
winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);
registerProgramFolderKey(winreg, fFolderPath);
}
winreg.setRootKey(winreg.HKEY_CURRENT_USER);
registerProgramFolderKey(winreg, fFolderPath);
// Register as a windows XP mail application
if( IsWinnt() )
{
subkey = "Software\\Clients\\Mail\\$ProductNameInternal$";
winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);
winreg.createKey(subkey,"");
winreg.createKey(subkey + "\\DefaultIcon", "");
winreg.createKey(subkey + "\\shell", "");
winreg.createKey(subkey + "\\shell\\open", "");
winreg.createKey(subkey + "\\shell\\open\\command", "");
winreg.createKey(subkey + "\\InstallInfo","");
winreg.setValueString(subkey, "", "$ProductName$ Mail");
// path does not need to be quoted per MS doc
data = fProgram + "chrome\\icons\\default\\messengerWindow.ico,0";
winreg.setValueString(subkey + "\\DefaultIcon", "", data);
data = "\"" + fProgram + "$MainExeFile$\" -mail";
winreg.setValueString(subkey + "\\shell\\open\\command", "", data);
data = "\"" + fProgram + "uninstall\\$UninstallFile$\" /ua \"$UserAgent$\" /hs mail";
winreg.setValueString(subkey + "\\InstallInfo", "HideIconsCommand", data);
// set this value to 0 because we're not creating the mail shortcuts yet.
winreg.setValueNumber(subkey + "\\InstallInfo", "IconsVisible", 0);
data = "\"" + fProgram + "$MainExeFile$\" -silent -nosplash -setDefaultMail";
winreg.setValueString(subkey + "\\InstallInfo", "ReinstallCommand", data);
data = "\"" + fProgram + "uninstall\\$UninstallFile$\" /ua \"$UserAgent$\" /ss mail";
winreg.setValueString(subkey + "\\InstallInfo", "ShowIconsCommand", data);
}
}
else
{
logComment("winreg is null");
}
}
function updateMapi()
{
var winreg;
var szValue;
var szMapiBackupDll;
var szDefaultMailClient;
var programMozMapi32File;
var mainExePath;
var sfpProgramMozMapi32File;
var sfpMainExePath;
var winsysMapi32File;
var mapiProxyFile;
var subkey;
var mailDefaultDescription = "$ProductName$ Mail";
winreg = getWinRegistry();
if(winreg != null)
{
mainExePath = getFolder("Program", "$MainExeFile$");
programMozMapi32File = getFolder("Program", "mozMapi32.dll");
winsysMapi32File = getFolder("Win System", "Mapi32.dll");
winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);
// If Mapi_backup_dll *and* the default var of
// HKEY_LOCAL_MACHINE\Software\Clients\Mail is set, then install
// mozMapi32.dll to the windows system dir as Mapi32.dll.
szMapiBackupDll = winreg.getValueString("SOFTWARE\\Mozilla\\Desktop", "Mapi_backup_dll");
szDefaultMailClient = winreg.getValueString("SOFTWARE\\Clients\\Mail", "");
logComment("szMapiBackupDll: " + szMapiBackupDll);
logComment("szDefaultMailClient: " + szDefaultMailClient);
if((szMapiBackupDll != null) && (szMapiBackupDll != "") &&
(szDefaultMailClient != null) && (szDefaultMailClient == "$ProductName$"))
{
// We do not want to log this file to be uninstalled because the
// uninstaller already has a special way to deal with restoring the
// appropriate previous Mapi32.dll.
addFile("",
"$Version$",
"bin/mozMapi32.dll", // file name in jar to extract
getFolder("Win System"), // Where to put this file (Returned from getFolder)
"Mapi32.dll", // new name when installed
DO_NOT_UNINSTALL);
}
sfpProgramMozMapi32File = File.windowsGetShortName(programMozMapi32File);
sfpMainExePath = File.windowsGetShortName(mainExePath);
subkey = "SOFTWARE\\Clients\\Mail\\$ProductName$";
winreg.createKey(subkey, "");
winreg.setValueString(subkey, "", mailDefaultDescription);
winreg.setValueString(subkey, "DLLPath", sfpProgramMozMapi32File);
winreg.createKey(subkey + "\\DefaultIcon", "");
winreg.setValueString(subkey + "\\DefaultIcon", "", sfpMainExePath + ",0");
winreg.createKey(subkey + "\\protocols", "");
winreg.createKey(subkey + "\\protocols\\mailto", "");
winreg.setValueString(subkey + "\\protocols\\mailto", "", "URL:MailTo Protocol");
winreg.createKey(subkey + "\\protocols\\mailto\\shell", "");
winreg.createKey(subkey + "\\protocols\\mailto\\shell\\open", "");
winreg.createKey(subkey + "\\protocols\\mailto\\shell\\open\\command", "");
winreg.setValueString(subkey + "\\protocols\\mailto\\shell\\open\\command", "", sfpMainExePath + " \"%1\"");
winreg.createKey(subkey + "\\shell", "");
winreg.createKey(subkey + "\\shell\\open", "");
winreg.createKey(subkey + "\\shell\\open\\command", "");
winreg.setValueString(subkey + "\\shell\\open\\command", "", sfpMainExePath + " -mail");
// Register MapiProxy.dll
mapiProxyFile = getFolder("Program", "MapiProxy.dll");
err = File.windowsRegisterServer(mapiProxyFile);
logComment("File.windowsRegisterServer(" + mapiProxyFile + ") returned: " + err);
}
}
function upgradeCleanup()
{
// Obsolete files from Netscape 6.0 and Netscape 6.01 that
// need to be cleaned up.
deleteThisFile("Program", "msgMapi.dll");
deleteThisFile("Components", "signed.dll");
deleteThisFile("Components", "smimestb.dll");
deleteThisFile("Components", "nsMapiRegistry.dll");
deleteThisFile("Components", "absyncsv.dll");
}
function updateWinIni()
{
var fWinIni = getWinProfile(getFolder("Windows"), "win.ini");
if(fWinIni != null)
{
fWinIni.writeString("Mail", "MAPI", "1");
fWinIni.writeString("Mail", "MAPIX", "1");
}
}
// main
var srDest;
var err;
var fProgram;
srDest = $SpaceRequired$:bin;
err = initInstall("SeaMonkey Mail", "Mail", "$Version$");
logComment("initInstall: " + err);
fProgram = getFolder("Program");
logComment("fProgram: " + fProgram);
if(verifyDiskSpace(fProgram, srDest))
{
setPackageFolder(fProgram);
upgradeCleanup();
err = addDirectory("",
"$Version$",
"bin", // dir name in jar to extract
fProgram, // Where to put this file (Returned from GetFolder)
"", // subdir name to create relative to fProgram
true); // Force Flag
logComment("addDirectory() returned: " + err);
// check return value
if( err == SUCCESS )
{
createShortcuts();
updateWinIni();
updateMapi();
// we don't want to fail on errors for the above
resetError();
// register chrome
registerChrome(CONTENT | DELAYED_CHROME,
getFolder("Chrome","messenger.jar"),
"content/messenger/");
registerChrome(CONTENT | DELAYED_CHROME,
getFolder("Chrome","messenger.jar"),
"content/messenger-region/");
registerChrome(CONTENT | DELAYED_CHROME,
getFolder("Chrome","messenger.jar"),
"content/messenger-smime/");
registerChrome(CONTENT | DELAYED_CHROME,
getFolder("Chrome","messenger.jar"),
"content/messenger-mdn/");
registerChrome(CONTENT | DELAYED_CHROME,
getFolder("Chrome","messenger.jar"),
"content/messenger-views/");
registerChrome(CONTENT | DELAYED_CHROME,
getFolder("Chrome","messenger.jar"),
"content/messenger-mapi/");
// log comments for uninstalling the registry keys created by mail for setting
// itself up in WinXP's Start menu
logComment("Create Registry Key: HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail\\$ProductName$ []");
logComment("Store Registry Value: HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail\\$ProductName$ []");
logComment("Store Registry Value: HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail\\$ProductName$ [DLLPath]");
logComment("Create Registry Key: HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail\\$ProductName$\\DefaultIcon []");
logComment("Store Registry Value: HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail\\$ProductName$\\DefaultIcon []");
logComment("Create Registry Key: HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail\\$ProductName$\\protocols []");
logComment("Create Registry Key: HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail\\$ProductName$\\protocols\\mailto []");
logComment("Store Registry Value: HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail\\$ProductName$\\protocols\\mailto []");
logComment("Create Registry Key: HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail\\$ProductName$\\protocols\\mailto\\shell []");
logComment("Create Registry Key: HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail\\$ProductName$\\protocols\\mailto\\shell\\open []");
logComment("Create Registry Key: HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail\\$ProductName$\\protocols\\mailto\\shell\\open\\command []");
logComment("Store Registry Value: HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail\\$ProductName$\\protocols\\mailto\\shell\\open\\command []");
logComment("Create Registry Key: HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail\\$ProductName$\\shell []");
logComment("Create Registry Key: HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail\\$ProductName$\\shell\\open []");
logComment("Create Registry Key: HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail\\$ProductName$\\shell\\open\\command []");
logComment("Store Registry Value: HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail\\$ProductName$\\shell\\open\\command []");
// check return value
err = getLastError();
if(err == SUCCESS)
{
err = performInstall();
logComment("performInstall() returned: " + err);
// Commenting this out for now until bug 182423 is fixed. This will at least prevent
// people who have not run PalmSyncInstall.exe to run into bug 182423. However,
// if they run the PalmSync uninstall by hand via the Start menu, then they will
// still run into the bug.
//if(err == SUCCESS)
//{
// // Log the uninstall command to run PalmSyncInstall.exe to uninstall itself.
// // This needs to be logged after all the files have been installed.
// logComment("Uninstall Command: \"" + fProgram + "PalmSyncInstall.exe\" /us");
//}
}
else
cancelInstall(err);
}
else
cancelInstall(err);
}
else
cancelInstall(INSUFFICIENT_DISK_SPACE);
// end main