diff --git a/toolkit/toolkit-makefiles.sh b/toolkit/toolkit-makefiles.sh index ca47e94a322d..1136132a96fe 100644 --- a/toolkit/toolkit-makefiles.sh +++ b/toolkit/toolkit-makefiles.sh @@ -519,9 +519,7 @@ MAKEFILES_xpcom_tests=" MAKEFILES_xpinstall=" xpinstall/Makefile xpinstall/public/Makefile - xpinstall/res/Makefile xpinstall/src/Makefile - xpinstall/stub/Makefile " MAKEFILES_xpfe=" diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 67bf4786271f..deba1d10abb9 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -129,10 +129,6 @@ #include "nsINIParser.h" -#ifdef MOZ_XPINSTALL -#include "InstallCleanupDefines.h" -#endif - #include #ifdef XP_UNIX @@ -1158,69 +1154,6 @@ DumpHelp() DumpArbitraryHelp(); } -#ifdef MOZ_XPINSTALL -// don't modify aAppDir directly... clone it first -static int -VerifyInstallation(nsIFile* aAppDir) -{ - static const char lastResortMessage[] = - "A previous install did not complete correctly. Finishing install."; - - // Maximum allowed / used length of alert message is 255 chars, due to restrictions on Mac. - // Please make sure that file contents and fallback_alert_text are at most 255 chars. - - char message[256]; - PRInt32 numRead = 0; - const char *messageToShow = lastResortMessage; - - nsresult rv; - nsCOMPtr messageFile; - rv = aAppDir->Clone(getter_AddRefs(messageFile)); - if (NS_SUCCEEDED(rv)) { - messageFile->AppendNative(NS_LITERAL_CSTRING("res")); - messageFile->AppendNative(CLEANUP_MESSAGE_FILENAME); - PRFileDesc* fd = 0; - - nsCOMPtr lf (do_QueryInterface(messageFile)); - if (lf) { - rv = lf->OpenNSPRFileDesc(PR_RDONLY, 0664, &fd); - if (NS_SUCCEEDED(rv)) { - numRead = PR_Read(fd, message, sizeof(message)-1); - if (numRead > 0) { - message[numRead] = 0; - messageToShow = message; - } - } - } - } - - ShowOSAlert(messageToShow); - - nsCOMPtr cleanupUtility; - aAppDir->Clone(getter_AddRefs(cleanupUtility)); - if (!cleanupUtility) return 1; - - cleanupUtility->AppendNative(CLEANUP_UTIL); - - ScopedXPCOMStartup xpcom; - rv = xpcom.Initialize(); - if (NS_FAILED(rv)) return 1; - - { // extra scoping needed to release things before xpcom shutdown - //Create the process framework to run the cleanup utility - nsCOMPtr cleanupProcess - (do_CreateInstance(NS_PROCESS_CONTRACTID)); - rv = cleanupProcess->Init(cleanupUtility); - if (NS_FAILED(rv)) return 1; - - rv = cleanupProcess->Run(PR_FALSE,nsnull, 0, nsnull); - if (NS_FAILED(rv)) return 1; - } - - return 0; -} -#endif - #ifdef DEBUG_warren #ifdef XP_WIN #define _CRTDBG_MAP_ALLOC @@ -2876,33 +2809,6 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData) return 1; } -#ifdef MOZ_XPINSTALL - //---------------------------------------------------------------- - // We need to check if a previous installation occured and - // if so, make sure it finished and cleaned up correctly. - // - // If there is an xpicleanup.dat file left around, that means the - // previous installation did not finish correctly. We must cleanup - // before a valid mozilla can run. - // - // Show the user a platform-specific Alert message, then spawn the - // xpicleanup utility, then exit. - //---------------------------------------------------------------- - { - nsCOMPtr registryFile; - rv = dirProvider.GetAppDir()->Clone(getter_AddRefs(registryFile)); - if (NS_SUCCEEDED(rv)) { - registryFile->AppendNative(CLEANUP_REGISTRY); - - PRBool exists; - rv = registryFile->Exists(&exists); - if (NS_SUCCEEDED(rv) && exists) { - return VerifyInstallation(dirProvider.GetAppDir()); - } - } - } -#endif - #ifdef MOZ_ENABLE_XREMOTE // handle -remote now that xpcom is fired up diff --git a/xpinstall/Makefile.in b/xpinstall/Makefile.in index 5b39662c6e90..b721d286d019 100644 --- a/xpinstall/Makefile.in +++ b/xpinstall/Makefile.in @@ -24,6 +24,7 @@ # Daniel Veditz # Douglas Turner # Samir Gehani +# Dave Townsend # # Alternatively, the contents of this file may be used under the terms of # either of the GNU General Public License Version 2 or later (the "GPL"), @@ -47,14 +48,6 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk MODULE = xpinstall -DIRS = public src cleanup - -ifndef MOZ_ENABLE_LIBXUL -DIRS += stub -endif - -ifndef MOZ_XUL_APP -DIRS += res -endif +DIRS = public src include $(topsrcdir)/config/rules.mk diff --git a/xpinstall/cleanup/InstallCleanup.cpp b/xpinstall/cleanup/InstallCleanup.cpp deleted file mode 100644 index b031cd70e6bb..000000000000 --- a/xpinstall/cleanup/InstallCleanup.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Navigator. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Don Bragg - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "InstallCleanup.h" - -int PerformScheduledTasks(HREG reg) -{ - int deleteComplete = DONE; - int replaceComplete = DONE; - - deleteComplete = DeleteScheduledFiles( reg ); - replaceComplete = ReplaceScheduledFiles( reg ); - if ((deleteComplete == DONE) && (replaceComplete == DONE)) - return DONE; - else - return TRY_LATER; -} - - -//---------------------------------------------------------------------------- -// ReplaceScheduledFiles -//---------------------------------------------------------------------------- -int ReplaceScheduledFiles( HREG reg ) -{ - RKEY key; - int rv = DONE; - - /* replace files if any listed */ - if (REGERR_OK == NR_RegGetKey(reg,ROOTKEY_PRIVATE,REG_REPLACE_LIST_KEY,&key)) - { - char keyname[MAXREGNAMELEN]; - char doomedFile[MAXREGPATHLEN]; - char srcFile[MAXREGPATHLEN]; - - uint32 bufsize; - REGENUM state = 0; - while (REGERR_OK == NR_RegEnumSubkeys( reg, key, &state, - keyname, sizeof(keyname), REGENUM_CHILDREN)) - { - bufsize = sizeof(srcFile); - REGERR err1 = NR_RegGetEntry( reg, (RKEY)state, - REG_REPLACE_SRCFILE, &srcFile, &bufsize); - - bufsize = sizeof(doomedFile); - REGERR err2 = NR_RegGetEntry( reg, (RKEY)state, - REG_REPLACE_DESTFILE, &doomedFile, &bufsize); - - if ( err1 == REGERR_OK && err2 == REGERR_OK ) - { - int result = NativeReplaceFile( srcFile, doomedFile ); - if (result == DONE) - { - // This one is done - NR_RegDeleteKey( reg, key, keyname ); - } - } - } - - /* delete list node if empty */ - state = 0; - if (REGERR_NOMORE == NR_RegEnumSubkeys( reg, key, &state, keyname, - sizeof(keyname), REGENUM_CHILDREN )) - { - NR_RegDeleteKey(reg, ROOTKEY_PRIVATE, REG_REPLACE_LIST_KEY); - rv = DONE; - } - else - { - rv = TRY_LATER; - } - } - return rv; -} - -//---------------------------------------------------------------------------- -// DeleteScheduledFiles -//---------------------------------------------------------------------------- -int DeleteScheduledFiles( HREG reg ) -{ - REGERR err; - RKEY key; - REGENUM state = 0; - int rv = DONE; - - /* perform scheduled file deletions */ - if (REGERR_OK == NR_RegGetKey(reg,ROOTKEY_PRIVATE,REG_DELETE_LIST_KEY,&key)) - { - // the delete key exists, so we loop through its children - // and try to delete all the listed files - - char namebuf[MAXREGNAMELEN]; - char valbuf[MAXREGPATHLEN]; - - while (REGERR_OK == NR_RegEnumEntries( reg, key, &state, namebuf, - sizeof(namebuf), 0 ) ) - { - uint32 bufsize = sizeof(valbuf); // gets changed, must reset - err = NR_RegGetEntry( reg, key, namebuf, valbuf, &bufsize ); - if ( err == REGERR_OK ) - { - rv = NativeDeleteFile(valbuf); - if (rv == DONE) - NR_RegDeleteEntry( reg, key, namebuf); - } - } - - /* delete list node if empty */ - state = 0; - err = NR_RegEnumEntries(reg, key, &state, namebuf, sizeof(namebuf), 0); - if ( err == REGERR_NOMORE ) - { - NR_RegDeleteKey(reg, ROOTKEY_PRIVATE, REG_DELETE_LIST_KEY); - rv = DONE; - } - else - { - rv = TRY_LATER; - } - } - return rv; -} - diff --git a/xpinstall/cleanup/InstallCleanup.h b/xpinstall/cleanup/InstallCleanup.h deleted file mode 100644 index 15e3908eea5f..000000000000 --- a/xpinstall/cleanup/InstallCleanup.h +++ /dev/null @@ -1,56 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Navigator. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Don Bragg - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef INSTALL_CLEANUP_H -#define INSTALL_CLEANUP_H - -#include -#include - -#include "prtypes.h" -#include "VerReg.h" - -#define DONE 0 -#define TRY_LATER -1 - -int PerformScheduledTasks(HREG); -int DeleteScheduledFiles(HREG); -int ReplaceScheduledFiles(HREG); -int NativeReplaceFile(const char* replacementFile, const char* doomedFile ); -int NativeDeleteFile(const char* aFileToDelete); - -#endif //INSTALL_CLEANUP_H - diff --git a/xpinstall/cleanup/InstallCleanupDefines.h b/xpinstall/cleanup/InstallCleanupDefines.h deleted file mode 100644 index 5e2bbcc857f3..000000000000 --- a/xpinstall/cleanup/InstallCleanupDefines.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef INSTALLCLEANUPDEFINES_H -#define INSTALLCLEANUPDEFINES_H - -// simple hack for xpicleanup.exe -#ifndef NS_LITERAL_CSTRING -#define NS_LITERAL_CSTRING(x) (x) -#endif - -#define CLEANUP_MESSAGE_FILENAME NS_LITERAL_CSTRING("cmessage.txt") - -#define CLEANUP_REGISTRY NS_LITERAL_CSTRING("xpicleanup.dat") - -#if defined (XP_WIN) -#define CLEANUP_UTIL NS_LITERAL_CSTRING("xpicleanup.exe") - -#elif defined (XP_OS2) -#define CLEANUP_UTIL NS_LITERAL_CSTRING("xpicleanup.exe") - -#else -#define CLEANUP_UTIL NS_LITERAL_CSTRING("xpicleanup") - -#endif - - -#endif diff --git a/xpinstall/cleanup/InstallCleanupMac.cpp b/xpinstall/cleanup/InstallCleanupMac.cpp deleted file mode 100644 index eb4d82e3ec86..000000000000 --- a/xpinstall/cleanup/InstallCleanupMac.cpp +++ /dev/null @@ -1,558 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Don Bragg - * Samir Gehani - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include -#include -#include -#include -#include "MoreFiles.h" -#include "MoreFilesExtras.h" -#include "FullPath.h" -#include -#include -#include -#include -#include -#include -#include - -#include "InstallCleanup.h" -#include "InstallCleanupDefines.h" - -#define kSleepMax 60 // sleep 1 second - -Boolean gAppleEventsFlag, gQuitFlag; -long gSleepVal; - - -int strcasecmp(const char *str1, const char *str2); -OSErr GetFSSpecFromPath(char *aPath, FSSpec *aSpec); -void my_c2pstrcpy(Str255 aDstPStr, const char *aSrcCStr); -OSErr GetCWD(short *aVRefNum, long *aDirID); -OSErr GetCleanupReg(FSSpec *aCleanupReg); - -int strcasecmp(const char *str1, const char *str2) -{ - char currentChar1, currentChar2; - - while (1) { - - currentChar1 = *str1; - currentChar2 = *str2; - - if ((currentChar1 >= 'a') && (currentChar1 <= 'z')) - currentChar1 += ('A' - 'a'); - - if ((currentChar2 >= 'a') && (currentChar2 <= 'z')) - currentChar2 += ('A' - 'a'); - - if (currentChar1 == '\0') - break; - - if (currentChar1 != currentChar2) - return currentChar1 - currentChar2; - - str1++; - str2++; - - } - - return currentChar1 - currentChar2; -} - -OSErr GetFSSpecFromPath(const char *aPath, FSSpec *aSpec) -{ - if (!aPath || !aSpec) - return paramErr; - - // 1> verify path is not an empty string - // 2> verify path has leaf - // 3> verify path does not start with leading ':' - - if ((!*aPath) || - (*(aPath + strlen(aPath) - 1) == ':') || - (*aPath == ':')) - { - return paramErr; - } - - // path is kosher: get FSSpec for it - return FSpLocationFromFullPath(strlen(aPath), (const void *) aPath, aSpec); -} - -void -my_c2pstrcpy(Str255 aDstPStr, const char *aSrcCStr) -{ - if (!aSrcCStr) - return; - - memcpy(&aDstPStr[1], aSrcCStr, strlen(aSrcCStr) > 255 ? 255 : strlen(aSrcCStr)); - aDstPStr[0] = strlen(aSrcCStr); -} - -OSErr -GetCWD(short *aVRefNum, long *aDirID) -{ - OSErr err = noErr; - ProcessSerialNumber psn; - ProcessInfoRec pInfo; - FSSpec tmp; - - if (!aVRefNum || !aDirID) - return paramErr; - - *aVRefNum = 0; - *aDirID = 0; - - /* get cwd based on curr ps info */ - if (!(err = GetCurrentProcess(&psn))) - { - pInfo.processName = nil; - pInfo.processAppSpec = &tmp; - pInfo.processInfoLength = (sizeof(ProcessInfoRec)); - - if(!(err = GetProcessInformation(&psn, &pInfo))) - { - *aVRefNum = pInfo.processAppSpec->vRefNum; - *aDirID = pInfo.processAppSpec->parID; - } - } - - return err; -} - -OSErr -GetCleanupReg(FSSpec *aCleanupReg) -{ - OSErr err = noErr; - short efVRefNum = 0; - long efDirID = 0; - - if (!aCleanupReg) - return paramErr; - - err = GetCWD(&efVRefNum, &efDirID); - if (err == noErr) - { - Str255 pCleanupReg; - my_c2pstrcpy(pCleanupReg, CLEANUP_REGISTRY); - err = FSMakeFSSpec(efVRefNum, efDirID, pCleanupReg, aCleanupReg); - } - - return err; -} - - -#pragma mark - - -//---------------------------------------------------------------------------- -// Native Mac file deletion function -//---------------------------------------------------------------------------- -int NativeDeleteFile(const char* aFileToDelete) -{ - OSErr err; - FSSpec delSpec; - - if (!aFileToDelete) - return DONE; - - // stat the file - err = GetFSSpecFromPath(aFileToDelete, &delSpec); - if (err != noErr) - { - // return fine if it doesn't exist - return DONE; - } - - // else try to delete it - err = FSpDelete(&delSpec); - if (err != noErr) - { - // tell user to try again later if deletion failed - return TRY_LATER; - } - - return DONE; -} - -//---------------------------------------------------------------------------- -// Native Mac file replacement function -//---------------------------------------------------------------------------- -int NativeReplaceFile(const char* aReplacementFile, const char* aDoomedFile ) -{ - OSErr err; - FSSpec replSpec, doomSpec, tgtDirSpec; - long dirID; - Boolean isDir; - - if (!aReplacementFile || !aDoomedFile) - return DONE; - - err = GetFSSpecFromPath(aReplacementFile, &replSpec); - if (err != noErr) - return DONE; - - // stat replacement file - err = FSpGetDirectoryID(&replSpec, &dirID, &isDir); - if (err != noErr || isDir) - { - // return fine if it doesn't exist - return DONE; - } - - // check if the replacement file and doomed file are the same - if (strcasecmp(aReplacementFile, aDoomedFile) == 0) - { - // return fine if they are the same - return DONE; - } - - // try and delete doomed file (NOTE: this call also stats) - err = GetFSSpecFromPath(aDoomedFile, &doomSpec); - if (err == noErr) - { - // (will even try to delete a dir with this name) - err = FSpDelete(&doomSpec); - - // if deletion failed tell user to try again later - if (err != noErr) - return TRY_LATER; - } - - // get the target dir spec (parent directory of doomed file) - err = FSMakeFSSpec(doomSpec.vRefNum, doomSpec.parID, "\p", &tgtDirSpec); - if (err == noErr) - { - // now try and move replacment file to path of doomed file - err = FSpMoveRename(&replSpec, &tgtDirSpec, doomSpec.name); - if (err != noErr) - { - // if move failed tell user to try agian later - return TRY_LATER; - } - } - - return DONE; -} - - -#pragma mark - - -//---------------------------------------------------------------------------- -// Routines for recovery on reboot -//---------------------------------------------------------------------------- -OSErr -GetProgramSpec(FSSpecPtr aProgSpec) -{ - OSErr err = noErr; - ProcessSerialNumber psn; - ProcessInfoRec pInfo; - - if (!aProgSpec) - return paramErr; - - /* get cwd based on curr ps info */ - if (!(err = GetCurrentProcess(&psn))) - { - pInfo.processName = nil; - pInfo.processAppSpec = aProgSpec; - pInfo.processInfoLength = (sizeof(ProcessInfoRec)); - - err = GetProcessInformation(&psn, &pInfo); - } - - return err; -} - -void -PutAliasInStartupItems(FSSpecPtr aAlias) -{ - OSErr err; - FSSpec fsProg, fsAlias; - long strtDirID = 0; - short strtVRefNum = 0; - FInfo info; - AliasHandle aliasH; - - if (!aAlias) - return; - - // find cwd - err = GetProgramSpec(&fsProg); - if (err != noErr) - return; // fail silently - - // get startup items folder - err = FindFolder(kOnSystemDisk, kStartupFolderType, kCreateFolder, - &strtVRefNum, &strtDirID); - if (err != noErr) - return; - - // check that an alias to ourselves doesn't already - // exist in the Startup Items folder - err = FSMakeFSSpec(strtVRefNum, strtDirID, fsProg.name, &fsAlias); - if (err == noErr) - { - // one's already there; not sure it's us so delete and recreate - // (being super paranoid; but hey it's a mac) - err = FSpDelete(&fsAlias); - if (err != noErr) - return; // fail silently - } - - // create the alias file - err = NewAliasMinimal(&fsProg, &aliasH); - if (err != noErr) - return; - - FSpGetFInfo(&fsProg, &info); - FSpCreateResFile(&fsAlias, info.fdCreator, info.fdType, smRoman); - short refNum = FSpOpenResFile(&fsAlias, fsRdWrPerm); - if (refNum != -1) - { - UseResFile(refNum); - AddResource((Handle)aliasH, rAliasType, 0, fsAlias.name); - ReleaseResource((Handle)aliasH); - UpdateResFile(refNum); - CloseResFile(refNum); - } - else - { - ReleaseResource((Handle)aliasH); - FSpDelete(&fsAlias); - return; // non-fatal error - } - - // mark newly created file as an alias file - FSpGetFInfo(&fsAlias, &info); - info.fdFlags |= kIsAlias; - FSpSetFInfo(&fsAlias, &info); - - *aAlias = fsAlias; -} - -void -RemoveAliasFromStartupItems(FSSpecPtr aAlias) -{ - // try to delete the alias - FSpDelete(aAlias); -} - - -#pragma mark - - -//---------------------------------------------------------------------------- -// Apple event handlers to be installed -//---------------------------------------------------------------------------- - -static pascal OSErr DoAEOpenApplication(const AppleEvent * theAppleEvent, AppleEvent * replyAppleEvent, long refCon) -{ -#pragma unused (theAppleEvent, replyAppleEvent, refCon) - return noErr; -} - -static pascal OSErr DoAEOpenDocuments(const AppleEvent * theAppleEvent, AppleEvent * replyAppleEvent, long refCon) -{ -#pragma unused (theAppleEvent, replyAppleEvent, refCon) - return errAEEventNotHandled; -} - -static pascal OSErr DoAEPrintDocuments(const AppleEvent * theAppleEvent, AppleEvent * replyAppleEvent, long refCon) -{ -#pragma unused (theAppleEvent, replyAppleEvent, refCon) - return errAEEventNotHandled; -} - -static pascal OSErr DoAEQuitApplication(const AppleEvent * theAppleEvent, AppleEvent * replyAppleEvent, long refCon) -{ -#pragma unused (theAppleEvent, replyAppleEvent, refCon) - gQuitFlag = true; - return noErr; -} - - -//---------------------------------------------------------------------------- -// install Apple event handlers -//---------------------------------------------------------------------------- - -static void InitAppleEventsStuff(void) -{ - OSErr retCode; - - if (gAppleEventsFlag) { - - retCode = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, - NewAEEventHandlerUPP(DoAEOpenApplication), 0, false); - - if (retCode == noErr) - retCode = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, - NewAEEventHandlerUPP(DoAEOpenDocuments), 0, false); - - if (retCode == noErr) - retCode = AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments, - NewAEEventHandlerUPP(DoAEPrintDocuments), 0, false); - if (retCode == noErr) - retCode = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, - NewAEEventHandlerUPP(DoAEQuitApplication), 0, false); - - if (retCode != noErr) DebugStr("\pInstall event handler failed"); - // a better way to indicate an error is to post a notification - } -} - - -//---------------------------------------------------------------------------- -// high-level event dispatching -//---------------------------------------------------------------------------- - -static void DoHighLevelEvent(EventRecord * theEventRecPtr) -{ - (void) AEProcessAppleEvent(theEventRecPtr); -} - - -#pragma mark - - -void main(void) -{ - OSErr retCode; - long gestResponse; - FSSpec aliasToSelf; - FSSpec fsCleanupReg; - - EventRecord mainEventRec; - Boolean eventFlag, bDone = false, bHaveCleanupReg = false; - - HREG reg; - int rv = DONE; - -#if !TARGET_CARBON - // initialize QuickDraw globals - InitGraf(&qd.thePort); -#endif - - // initialize application globals - gQuitFlag = false; - gSleepVal = kSleepMax; - - // is the Apple Event Manager available? - retCode = Gestalt(gestaltAppleEventsAttr, &gestResponse); - if (retCode == noErr && - (gestResponse & (1 << gestaltAppleEventsPresent)) != 0) - gAppleEventsFlag = true; - else gAppleEventsFlag = false; - - // install Apple event handlers - InitAppleEventsStuff(); - - // put an alias to ourselves in the Startup Items folder - // so that if we are shutdown before finishing we do our - // tasks at startup - FSMakeFSSpec(0, 0, "\p", &aliasToSelf); // initialize - PutAliasInStartupItems(&aliasToSelf); - - if ( REGERR_OK == NR_StartupRegistry() ) - { - char *regName = ""; - Boolean regNameAllocd = false; - Handle pathH = 0; - short pathLen = 0; - - // check if XPICleanup data file exists - retCode = GetCleanupReg(&fsCleanupReg); - if (retCode == noErr) - { - bHaveCleanupReg = true; - - // get full path to give to libreg open routine - retCode = FSpGetFullPath(&fsCleanupReg, &pathLen, &pathH); - if (retCode == noErr && pathH) - { - HLock(pathH); - if (*pathH) - { - regName = (char *) malloc(sizeof(char) * (pathLen + 1)); - if (regName) - regNameAllocd = true; - else - retCode = memFullErr; - strncpy(regName, *pathH, pathLen); - *(regName + pathLen) = 0; - } - HUnlock(pathH); - DisposeHandle(pathH); - } - } - - if ( (retCode == noErr) && (REGERR_OK == NR_RegOpen(regName, ®)) ) - { - // main event loop - - while (!gQuitFlag) - { - eventFlag = WaitNextEvent(everyEvent, &mainEventRec, gSleepVal, nil); - - if (mainEventRec.what == kHighLevelEvent) - DoHighLevelEvent(&mainEventRec); - - rv = PerformScheduledTasks(reg); - if (rv == DONE) - { - bDone = true; - gQuitFlag = true; - } - } - NR_RegClose(®); - NR_ShutdownRegistry(); - } - - if (regNameAllocd) - free(regName); - } - - // clean up the alias to ouselves since we have - // completed our tasks successfully - if (bDone) - { - if (bHaveCleanupReg) - FSpDelete(&fsCleanupReg); - RemoveAliasFromStartupItems(&aliasToSelf); - } -} - diff --git a/xpinstall/cleanup/InstallCleanupOS2.cpp b/xpinstall/cleanup/InstallCleanupOS2.cpp deleted file mode 100644 index 75aa0bb0d136..000000000000 --- a/xpinstall/cleanup/InstallCleanupOS2.cpp +++ /dev/null @@ -1,144 +0,0 @@ - -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Don Bragg - * IBM Corp. - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "InstallCleanup.h" -#include "InstallCleanupDefines.h" -#define INCL_DOSERRORS -#define INCL_DOS -#include -#include -#include -//---------------------------------------------------------------------------- -// Native OS/2 file deletion function -//---------------------------------------------------------------------------- -int NativeDeleteFile(const char* aFileToDelete) -{ - struct stat st; - if (stat(aFileToDelete, &st) != 0) - { - return DONE;// No file to delete, do nothing. - } - else - { - if(DosDelete(aFileToDelete) != NO_ERROR) - return TRY_LATER; - } - return DONE; -} - -//---------------------------------------------------------------------------- -// Native OS/2 file replacement function -//---------------------------------------------------------------------------- -int NativeReplaceFile(const char* replacementFile, const char* doomedFile ) -{ - // replacement file must exist, doomed file doesn't have to - struct stat st; - if (stat(replacementFile, &st) != 0) - return DONE; - - // don't have to do anything if the files are the same - if (stricmp(replacementFile, doomedFile) == 0) - return DONE; - - if (DosDelete(doomedFile) != NO_ERROR) - { - if (stat(doomedFile, &st) == 0) - return TRY_LATER; - } - - // doomedFile is gone move new file into place - if (DosMove(replacementFile, doomedFile) != NO_ERROR) - return TRY_LATER; // this shouldn't happen - - return DONE; -} - -int main(int argc, char *argv[], char *envp[]) -{ - HREG reg; - BOOL foundSpecialFile = FALSE; - struct stat st; - - int status = DONE; - - if ( REGERR_OK == NR_StartupRegistry()) - { - char regFilePath[CCHMAXPATH]; - - strcpy(regFilePath, argv[0]); - char* lastSlash = strrchr(regFilePath, '\\'); - if (lastSlash) { - // path does contain backslash - lastSlash++; - *lastSlash = 0; // strip off the executable name - } else { - // no backslash in path, just strip off everything - *regFilePath = 0; - } - strcat(regFilePath, CLEANUP_REGISTRY); // append reg file name - - if (stat(regFilePath, &st) != 0) - strcpy(regFilePath, ""); // an empty reg file tells RegOpen to get the "default" - else - foundSpecialFile = TRUE; - - if ( REGERR_OK == NR_RegOpen(regFilePath, ®) ) - { - int numAttempts = 0; - do - { - status = PerformScheduledTasks(reg); - if (status != DONE) { - DosSleep(1000); // Sleep for 1 second - numAttempts++; - } - } while ((status == TRY_LATER) && numAttempts <= 5); - - NR_RegClose(®); - } - NR_ShutdownRegistry(); - if (status == DONE) { - DosDelete(regFilePath); - } - } - return(0); -} - diff --git a/xpinstall/cleanup/InstallCleanupUnix.cpp b/xpinstall/cleanup/InstallCleanupUnix.cpp deleted file mode 100644 index 39a443d50a30..000000000000 --- a/xpinstall/cleanup/InstallCleanupUnix.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Don Bragg - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - - -#include "InstallCleanup.h" -#include -#include -#include - -//---------------------------------------------------------------------------- -// Native Unix file deletion function -//---------------------------------------------------------------------------- -int NativeDeleteFile(const char* aFileToDelete) -{ - struct stat fileStack; - if (stat(aFileToDelete, &fileStack) != 0) - { - return DONE;// No file to delete, do nothing. - } - else - { - if(unlink(aFileToDelete) != 0) - return TRY_LATER; - } - return DONE; -} - -//---------------------------------------------------------------------------- -// Native Unix file replacement function -//---------------------------------------------------------------------------- -int NativeReplaceFile(const char* replacementFile, const char* doomedFile ) -{ - struct stat fileStack; - - // replacement file must exist, doomed file doesn't have to - if (stat(replacementFile, &fileStack) != 0) - return DONE; - - // don't have to do anything if the files are the same - if (strcmp(replacementFile, doomedFile) == 0) - return DONE; - - if (unlink(doomedFile) != 0) - { - if (stat(doomedFile, &fileStack) == 0) - return TRY_LATER; - } - else - { - // doomedFile is gone move new file into place - if (rename(replacementFile, doomedFile) != 0) - return TRY_LATER; // this shouldn't happen - } - - return DONE; -} - -int main(int argc,char* argv[]) -{ - HREG reg; - int status = DONE; - struct stat fileStack; - - if ( REGERR_OK == NR_StartupRegistry()) - { - char regFilePath[256]; - strcpy(regFilePath, argv[0]); - strcat(regFilePath, ".dat"); - if ( stat(regFilePath, &fileStack) != 0) - regFilePath[0] = '\0'; - if ( REGERR_OK == NR_RegOpen(regFilePath, ®) ) - { - do { - status = PerformScheduledTasks(reg); - if (status != DONE) - sleep(1); - } while (status == TRY_LATER); - NR_RegClose(®); - } - NR_ShutdownRegistry(); - unlink(regFilePath); - } - return(0); -} - diff --git a/xpinstall/cleanup/InstallCleanupWin.cpp b/xpinstall/cleanup/InstallCleanupWin.cpp deleted file mode 100644 index 0c69c7666f73..000000000000 --- a/xpinstall/cleanup/InstallCleanupWin.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Navigator. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Don Bragg - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "InstallCleanup.h" -#include "InstallCleanupDefines.h" -#include -#include -//---------------------------------------------------------------------------- -// Native Windows file deletion function -//---------------------------------------------------------------------------- -int NativeDeleteFile(const char* aFileToDelete) -{ - if (GetFileAttributes(aFileToDelete) == 0xFFFFFFFF) - { - return DONE;// No file to delete, do nothing. - } - else - { - if(!DeleteFile(aFileToDelete)) - return TRY_LATER; - } - return DONE; -} - -//---------------------------------------------------------------------------- -// Native Windows file replacement function -//---------------------------------------------------------------------------- -int NativeReplaceFile(const char* replacementFile, const char* doomedFile ) -{ - // replacement file must exist, doomed file doesn't have to - if (GetFileAttributes(replacementFile) == 0xFFFFFFFF) - return DONE; - - // don't have to do anything if the files are the same - if (CompareString(LOCALE_SYSTEM_DEFAULT, - NORM_IGNORECASE | SORT_STRINGSORT, - replacementFile, -1, - doomedFile, -1) == CSTR_EQUAL) - return DONE; - - if (!DeleteFile(doomedFile)) - { - if (GetFileAttributes(doomedFile) != 0xFFFFFFFF) // file exists - return TRY_LATER; - } - - // doomedFile is gone move new file into place - if (!MoveFile(replacementFile, doomedFile)) - return TRY_LATER; // this shouldn't happen - - return DONE; -} - - -int WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR args, int) -{ - HREG reg; - HKEY hkRunOnceHandle; - DWORD dwDisp; - bool foundSpecialFile = FALSE; - - int status = DONE; - - if ( REGERR_OK == NR_StartupRegistry()) - { - DWORD charsWritten; - char appPath[_MAX_PATH]; - charsWritten = GetModuleFileName(NULL, appPath, _MAX_PATH); - if (charsWritten > 0) - { - char regFilePath[_MAX_PATH]; - - strcpy(regFilePath, appPath); - char* lastSlash = strrchr(regFilePath, '\\'); - if (lastSlash) { - // path does contain backslash - lastSlash++; - *lastSlash = 0; // strip off the executable name - } else { - // no backslash in path, just strip off everything - *regFilePath = 0; - } - strcat(regFilePath, CLEANUP_REGISTRY); //append reg file name - - if ( GetFileAttributes(regFilePath) == 0xFFFFFFFF ) // file doesn't exist - strcpy(regFilePath, ""); // an empty reg file tells RegOpen to get the "default" - else - foundSpecialFile = TRUE; - - if ( REGERR_OK == NR_RegOpen(regFilePath, ®) ) - { - RegCreateKeyEx(HKEY_CURRENT_USER, - "Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce", - 0, - NULL, - REG_OPTION_NON_VOLATILE, - KEY_WRITE, - NULL, - &hkRunOnceHandle, - &dwDisp); - - LPCTSTR cleanupKeyName = "mozilla_cleanup"; - - RegSetValueEx(hkRunOnceHandle, - cleanupKeyName, - 0, - REG_SZ, - (const unsigned char*)appPath, - strlen(appPath)); - - do - { - status = PerformScheduledTasks(reg); - if (status != DONE) - Sleep(1000); // Sleep for 1 second - } while (status == TRY_LATER); - - RegDeleteValue(hkRunOnceHandle, cleanupKeyName); - NR_RegClose(®); - } - NR_ShutdownRegistry(); - DeleteFile(regFilePath); - } - } - return(0); -} - diff --git a/xpinstall/cleanup/Makefile.in b/xpinstall/cleanup/Makefile.in deleted file mode 100644 index 7abc5aecdb08..000000000000 --- a/xpinstall/cleanup/Makefile.in +++ /dev/null @@ -1,96 +0,0 @@ -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is Mozilla Communicator client code, released -# March 31, 1998. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 1998 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Samir Gehani -# -# Alternatively, the contents of this file may be used under the terms of -# either of the GNU General Public License Version 2 or later (the "GPL"), -# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = xpinstall -PROGRAM = xpicleanup$(BIN_SUFFIX) -GRE_MODULE = 1 -REQUIRES = libreg \ - $(NULL) - -CPPSRCS = \ - InstallCleanup.cpp \ - $(NULL) - -EXPORTS = InstallCleanupDefines.h \ - $(NULL) - -ifeq ($(OS_ARCH),OS2) -CPPSRCS += InstallCleanupOS2.cpp -else -ifeq ($(OS_ARCH),WINNT) -CPPSRCS += InstallCleanupWin.cpp -MOZ_WINCONSOLE = 0 -USE_STATIC_LIBS = 1 -else -CPPSRCS += InstallCleanupUnix.cpp -endif -endif - -LIBS = \ - $(DEPTH)/modules/libreg/standalone/$(LIB_PREFIX)mozregsa_s.$(LIB_SUFFIX) \ - $(NULL) - -DEFINES += -DSTANDALONE_REGISTRY - -include $(topsrcdir)/config/rules.mk - -ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) -LIBS += $(DEPTH)/xpcom/MoreFiles/$(LIB_PREFIX)macmorefiles_s.$(LIB_SUFFIX) -LDFLAGS += $(TK_LIBS) -endif - -ifeq ($(OS_ARCH),WINNT) -ifndef GNU_CC -LDFLAGS += /SUBSYSTEM:WINDOWS -endif -endif - -libs:: - $(INSTALL) $(srcdir)/cmessage.txt $(DIST)/bin/res - -install:: - $(SYSINSTALL) $(IFLAGS1) $(srcdir)/cmessage.txt $(DESTDIR)$(mozappdir)/res - diff --git a/xpinstall/cleanup/cmessage.txt b/xpinstall/cleanup/cmessage.txt deleted file mode 100644 index 9805846103b2..000000000000 --- a/xpinstall/cleanup/cmessage.txt +++ /dev/null @@ -1 +0,0 @@ -The program must close to allow a previous installation attempt to complete. Please restart. \ No newline at end of file diff --git a/xpinstall/public/Makefile.in b/xpinstall/public/Makefile.in index 1bd754bd0c08..dcc1763e7cd7 100644 --- a/xpinstall/public/Makefile.in +++ b/xpinstall/public/Makefile.in @@ -23,6 +23,7 @@ # Contributor(s): # Daniel Veditz # Douglas Turner +# Dave Townsend # # Alternatively, the contents of this file may be used under the terms of # either of the GNU General Public License Version 2 or later (the "GPL"), @@ -51,19 +52,14 @@ GRE_MODULE = 1 XPIDLSRCS = \ nsIXPIDialogService.idl \ nsIXPIProgressDialog.idl \ - nsIXPINotifier.idl \ nsIXPInstallManager.idl \ nsIXPIInstallInfo.idl \ - nsPIXPIProxy.idl \ - nsPIXPIStubHook.idl \ nsPICertNotification.idl \ $(NULL) EXPORTS = \ nsIDOMInstallTriggerGlobal.h \ - nsIDOMInstallVersion.h \ nsSoftwareUpdateIIDs.h \ - nsISoftwareUpdate.h \ $(NULL) PREF_JS_EXPORTS = $(srcdir)/xpinstall.js diff --git a/xpinstall/public/nsIDOMInstallTriggerGlobal.h b/xpinstall/public/nsIDOMInstallTriggerGlobal.h index 83c92b428494..09d47ca9a122 100644 --- a/xpinstall/public/nsIDOMInstallTriggerGlobal.h +++ b/xpinstall/public/nsIDOMInstallTriggerGlobal.h @@ -20,6 +20,7 @@ * the Initial Developer. All Rights Reserved. * * Contributor(s): + * Dave Townsend * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), @@ -46,8 +47,8 @@ #define NS_IDOMINSTALLTRIGGERGLOBAL_IID \ - { 0xe8c7941c, 0xaaa0, 0x4faf, \ - {0x83, 0xe8, 0x01, 0xbe, 0x8b, 0xbe, 0x8a, 0x57}} + { 0x23bb93a4, 0xdaee, 0x4a47, \ + {0x87, 0xe76, 0xb1, 0x72, 0x35, 0x86, 0x2d, 0xac}} class nsIDOMInstallTriggerGlobal : public nsISupports { public: @@ -69,18 +70,6 @@ public: NS_IMETHOD StartInstall(nsIXPIInstallInfo* aInstallInfo, PRBool* aReturn)=0; - NS_IMETHOD Install(nsIScriptGlobalObject* globalObject, nsXPITriggerInfo* aInfo, PRBool* aReturn)=0; - - NS_IMETHOD InstallChrome(nsIScriptGlobalObject* globalObject, PRUint32 aType, nsXPITriggerItem* aItem, PRBool* aReturn)=0; - - NS_IMETHOD StartSoftwareUpdate(nsIScriptGlobalObject* globalObject, const nsString& aURL, PRInt32 aFlags, PRBool* aReturn)=0; - - NS_IMETHOD CompareVersion(const nsString& aRegName, PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn)=0; - NS_IMETHOD CompareVersion(const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn)=0; - NS_IMETHOD CompareVersion(const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn)=0; - - NS_IMETHOD GetVersion(const nsString& component, nsString& version)=0; - }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMInstallTriggerGlobal, diff --git a/xpinstall/public/nsIDOMInstallVersion.h b/xpinstall/public/nsIDOMInstallVersion.h deleted file mode 100644 index 52fba25f357f..000000000000 --- a/xpinstall/public/nsIDOMInstallVersion.h +++ /dev/null @@ -1,127 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -/* AUTO-GENERATED. DO NOT EDIT!!! */ - -#ifndef nsIDOMInstallVersion_h__ -#define nsIDOMInstallVersion_h__ - -#include "nsISupports.h" -#include "nsString.h" -#include "nsIScriptContext.h" - -class nsIDOMInstallVersion; - -#define NS_IDOMINSTALLVERSION_IID \ - { 0x18c2f986, 0xb09f, 0x11d2, \ - {0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}} - -class nsIDOMInstallVersion : public nsISupports { -public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMINSTALLVERSION_IID) - enum { - EQUAL = 0, - BLD_DIFF = 1, - BLD_DIFF_MINUS = -1, - REL_DIFF = 2, - REL_DIFF_MINUS = -2, - MINOR_DIFF = 3, - MINOR_DIFF_MINUS = -3, - MAJOR_DIFF = 4, - MAJOR_DIFF_MINUS = -4 - }; - - NS_IMETHOD GetMajor(PRInt32* aMajor)=0; - NS_IMETHOD SetMajor(PRInt32 aMajor)=0; - - NS_IMETHOD GetMinor(PRInt32* aMinor)=0; - NS_IMETHOD SetMinor(PRInt32 aMinor)=0; - - NS_IMETHOD GetRelease(PRInt32* aRelease)=0; - NS_IMETHOD SetRelease(PRInt32 aRelease)=0; - - NS_IMETHOD GetBuild(PRInt32* aBuild)=0; - NS_IMETHOD SetBuild(PRInt32 aBuild)=0; - - NS_IMETHOD Init(const nsString& aVersionString)=0; - - NS_IMETHOD ToString(nsString& aReturn)=0; - - NS_IMETHOD CompareTo(nsIDOMInstallVersion* aVersionObject, PRInt32* aReturn)=0; - NS_IMETHOD CompareTo(const nsString& aString, PRInt32* aReturn)=0; - NS_IMETHOD CompareTo(PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn)=0; -}; - -NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMInstallVersion, NS_IDOMINSTALLVERSION_IID) - -#define NS_DECL_IDOMINSTALLVERSION \ - NS_IMETHOD GetMajor(PRInt32* aMajor); \ - NS_IMETHOD SetMajor(PRInt32 aMajor); \ - NS_IMETHOD GetMinor(PRInt32* aMinor); \ - NS_IMETHOD SetMinor(PRInt32 aMinor); \ - NS_IMETHOD GetRelease(PRInt32* aRelease); \ - NS_IMETHOD SetRelease(PRInt32 aRelease); \ - NS_IMETHOD GetBuild(PRInt32* aBuild); \ - NS_IMETHOD SetBuild(PRInt32 aBuild); \ - NS_IMETHOD Init(const nsString& aVersionString); \ - NS_IMETHOD ToString(nsString& aReturn); \ - NS_IMETHOD CompareTo(nsIDOMInstallVersion* aVersionObject, PRInt32* aReturn); \ - NS_IMETHOD CompareTo(const nsString& aString, PRInt32* aReturn); \ - NS_IMETHOD CompareTo(PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn); \ - - - -#define NS_FORWARD_IDOMINSTALLVERSION(_to) \ - NS_IMETHOD GetMajor(PRInt32* aMajor) { return _to##GetMajor(aMajor); } \ - NS_IMETHOD SetMajor(PRInt32 aMajor) { return _to##SetMajor(aMajor); } \ - NS_IMETHOD GetMinor(PRInt32* aMinor) { return _to##GetMinor(aMinor); } \ - NS_IMETHOD SetMinor(PRInt32 aMinor) { return _to##SetMinor(aMinor); } \ - NS_IMETHOD GetRelease(PRInt32* aRelease) { return _to##GetRelease(aRelease); } \ - NS_IMETHOD SetRelease(PRInt32 aRelease) { return _to##SetRelease(aRelease); } \ - NS_IMETHOD GetBuild(PRInt32* aBuild) { return _to##GetBuild(aBuild); } \ - NS_IMETHOD SetBuild(PRInt32 aBuild) { return _to##SetBuild(aBuild); } \ - NS_IMETHOD Init(const nsString& aVersionString) { return _to##Init(aVersionString); } \ - NS_IMETHOD ToString(nsString& aReturn) { return _to##ToString(aReturn); } \ - NS_IMETHOD CompareTo(nsIDOMInstallVersion* aVersionObject, PRInt32* aReturn) { return _to##CompareTo(aVersionObject, aReturn); } \ - NS_IMETHOD CompareTo(const nsString& aString, PRInt32* aReturn) { return _to##CompareTo(aString, aReturn); } \ - NS_IMETHOD CompareTo(PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn) { return _to##CompareTo(aMajor, aMinor, aRelease, aBuild, aReturn); } \ - - -extern nsresult NS_InitInstallVersionClass(nsIScriptContext *aContext, void **aPrototype); - -extern "C" nsresult NS_NewScriptInstallVersion(nsIScriptContext *aContext, nsISupports *aSupports, nsISupports *aParent, void **aReturn); - -#endif // nsIDOMInstallVersion_h__ diff --git a/xpinstall/public/nsISoftwareUpdate.h b/xpinstall/public/nsISoftwareUpdate.h deleted file mode 100644 index bd5d8844b362..000000000000 --- a/xpinstall/public/nsISoftwareUpdate.h +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released - * March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Daniel Veditz - * Douglas Turner - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsISoftwareUpdate_h__ -#define nsISoftwareUpdate_h__ - -#include "nsISupports.h" -#include "nsIFactory.h" - -#include "nsIXPINotifier.h" -#include "nsCOMPtr.h" -#include "nsIModule.h" -#include "nsIGenericFactory.h" -#include "nsILocalFile.h" -#include "nsDirectoryServiceUtils.h" -#include "nsDirectoryServiceDefs.h" - -#define NS_IXPINSTALLCOMPONENT_CONTRACTID "@mozilla.org/xpinstall;1" -#define NS_IXPINSTALLCOMPONENT_CLASSNAME "Mozilla XPInstall Component" - -#define XPINSTALL_ENABLE_PREF "xpinstall.enabled" -#define XPINSTALL_WHITELIST_ADD "xpinstall.whitelist.add" -#define XPINSTALL_WHITELIST_ADD_103 "xpinstall.whitelist.add.103" -#define XPINSTALL_WHITELIST_REQUIRED "xpinstall.whitelist.required" -#define XPINSTALL_BLACKLIST_ADD "xpinstall.blacklist.add" - - -#define XPI_NO_NEW_THREAD 0x1000 - -#define NS_ISOFTWAREUPDATE_IID \ -{ 0xfc7c086f, \ - 0xdae0, \ - 0x45e0, \ - {0x99, 0x10, 0xd5, 0xda, 0x91, 0xc8, 0x27, 0x46}\ -} - -class nsIPrincipal; - -class nsISoftwareUpdate : public nsISupports -{ - public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISOFTWAREUPDATE_IID) - - NS_IMETHOD InstallJar(nsIFile* localFile, - const PRUnichar* URL, - const PRUnichar* arguments, - nsIPrincipal* aPrincipalDisplayed, - PRUint32 flags, - nsIXPIListener* aListener = 0) = 0; - - NS_IMETHOD InstallChrome(PRUint32 aType, - nsIFile* aFile, - const PRUnichar* URL, - const PRUnichar* aName, - PRBool aSelect, - nsIXPIListener* aListener = 0) = 0; - - NS_IMETHOD RegisterListener(nsIXPIListener *aListener) = 0; - - /* FIX: these should be in a private interface */ - virtual void InstallJarCallBack() = 0; - NS_IMETHOD GetMasterListener(nsIXPIListener **aListener) = 0; - NS_IMETHOD SetActiveListener(nsIXPIListener *aListener) = 0; -}; - -NS_DEFINE_STATIC_IID_ACCESSOR(nsISoftwareUpdate, NS_ISOFTWAREUPDATE_IID) - -#endif // nsISoftwareUpdate_h__ - diff --git a/xpinstall/public/nsIUpdateNotification.idl b/xpinstall/public/nsIUpdateNotification.idl deleted file mode 100644 index d96552bb4c68..000000000000 --- a/xpinstall/public/nsIUpdateNotification.idl +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released - * March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsISupports.idl" - -[uuid(6cb61472-042c-11d4-ac85-00c04fa0d26b)] -interface nsIUpdateNotification : nsISupports -{ - void displayUpdateDialog(); -}; diff --git a/xpinstall/public/nsIXPINotifier.idl b/xpinstall/public/nsIXPINotifier.idl deleted file mode 100644 index 9d2cee8283d3..000000000000 --- a/xpinstall/public/nsIXPINotifier.idl +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released - * March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Douglas Turner - * Daniel Veditz - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsISupports.idl" - -[uuid(eea90d40-b059-11d2-915e-c12b696c9333)] -interface nsIXPIListener : nsISupports -{ - void onInstallStart(in wstring URL); - void onInstallDone(in wstring URL, in long status); - void onPackageNameSet(in wstring URL, in wstring UIPackageName, in wstring version); - void onItemScheduled(in wstring message ); - void onFinalizeProgress(in wstring message, in long itemNum, in long totNum ); - void onLogComment(in wstring comment); -}; diff --git a/xpinstall/public/nsPIXPIProxy.idl b/xpinstall/public/nsPIXPIProxy.idl deleted file mode 100644 index 44bc961a13fd..000000000000 --- a/xpinstall/public/nsPIXPIProxy.idl +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released - * March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998-2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Daniel Veditz - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsISupports.idl" - -/** - * nsPIXPIProxy - * - * Used to handle miscellaneous things that XPInstall needs to perform - * over on the main UI thread. - */ -[scriptable,uuid(6F9D2890-167D-11d5-8DAF-000064657374)] -interface nsPIXPIProxy : nsISupports -{ - void refreshPlugins(in boolean reloadPages); - void notifyRestartNeeded(); - - /** - * Puts up an alert dialog with an OK button. - * - * @param title - * Text to appear in the title of the dialog. - * @param text - * Text to appear in the body of the dialog. - */ - void alert(in wstring title, in wstring text); - - /** - * Puts up a dialog with up to 3 buttons and an optional, labeled checkbox. - * - * @param aDialogTitle - * Text to appear in the title of the dialog. - * @param aText - * Text to appear in the body of the dialog. - * @param aButtonFlags - * A combination of Button Flags. - * @param aButton0Title - * Used when button 0 uses TITLE_IS_STRING - * @param aButton1Title - * Used when button 1 uses TITLE_IS_STRING - * @param aButton2Title - * Used when button 2 uses TITLE_IS_STRING - * @param aCheckMsg - * Text to appear with the checkbox. Null if no checkbox. - * @param aCheckState - * Contains the initial checked state of the checkbox when this method - * is called and the final checked state after this method returns. - * - * @return index of the button pressed. - * - * Buttons are numbered 0 - 2. The implementation can decide whether the - * sequence goes from right to left or left to right. Button 0 is the - * default button unless one of the Button Default Flags is specified. - * - * The value for aButtonFlags is constructed using the constants defined by - * nsIPromptService. - * - * @see nsIPromptService - */ - PRInt32 confirmEx(in wstring aDialogTitle, - in wstring aText, - in unsigned long aButtonFlags, - in wstring aButton0Title, - in wstring aButton1Title, - in wstring aButton2Title, - in wstring aCheckMsg, - inout boolean aCheckState); -}; diff --git a/xpinstall/public/nsPIXPIStubHook.idl b/xpinstall/public/nsPIXPIStubHook.idl deleted file mode 100644 index 23049ab44aef..000000000000 --- a/xpinstall/public/nsPIXPIStubHook.idl +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released - * March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Daniel Veditz - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsISupports.idl" - -interface nsIFile; - -/** - * nsPIXPIStubHook - * - * Used by the Install Wizard to point at the eventual target dir and - * override the default assumption that the wizard itself is the program. - */ -[uuid(089929F0-4ED9-11d3-ABDD-000064657374)] -interface nsPIXPIStubHook : nsISupports -{ - void StubInitialize(in nsIFile dir, in string logName); -}; diff --git a/xpinstall/public/nsSoftwareUpdateIIDs.h b/xpinstall/public/nsSoftwareUpdateIIDs.h index e5e3a77d1177..5d5f2e9e143b 100644 --- a/xpinstall/public/nsSoftwareUpdateIIDs.h +++ b/xpinstall/public/nsSoftwareUpdateIIDs.h @@ -22,6 +22,7 @@ * Contributor(s): * Daniel Veditz * Douglas Turner + * Dave Townsend * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), @@ -40,22 +41,6 @@ #ifndef nsSoftwareUpdateIIDs_h___ #define nsSoftwareUpdateIIDs_h___ -#define NS_SoftwareUpdate_CID \ -{ /* 18c2f989-b09f-11d2-bcde-00805f0e1353 */ \ - 0x18c2f989, \ - 0xb09f, \ - 0x11d2, \ - {0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53} \ -} - -#define NS_SoftwareUpdateInstall_CID \ -{ /* 18c2f98b-b09f-11d2-bcde-00805f0e1353 */ \ - 0x18c2f98b, \ - 0xb09f, \ - 0x11d2, \ - {0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53} \ -} - #define NS_SoftwareUpdateInstallTrigger_CID \ { /* 18c2f98d-b09f-11d2-bcde-00805f0e1353 */ \ 0x18c2f98d, \ @@ -64,14 +49,6 @@ {0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53} \ } -#define NS_SoftwareUpdateInstallVersion_CID \ -{ /* 18c2f98f-b09f-11d2-bcde-00805f0e1353 */ \ - 0x18c2f98f, \ - 0xb09f, \ - 0x11d2, \ - {0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53} \ -} - #define NS_XPInstallManager_CID \ { /* {6a4d4c1e-a74a-4320-8124-16233a0183d6} */ \ 0x6a4d4c1e, \ diff --git a/xpinstall/res/Makefile.in b/xpinstall/res/Makefile.in deleted file mode 100644 index 9bb503a95823..000000000000 --- a/xpinstall/res/Makefile.in +++ /dev/null @@ -1,46 +0,0 @@ -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 1998 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either of the GNU General Public License Version 2 or later (the "GPL"), -# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -include $(topsrcdir)/config/rules.mk - diff --git a/xpinstall/res/content/SoftwareUpdate-Source-1.rdf b/xpinstall/res/content/SoftwareUpdate-Source-1.rdf deleted file mode 100644 index 95a4f38c6773..000000000000 --- a/xpinstall/res/content/SoftwareUpdate-Source-1.rdf +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - 3.4.1.12 - /AOL/ - - - - - - 1.1.2.0 - /PGP/ROCKS/ - - - - - - - diff --git a/xpinstall/res/content/SoftwareUpdates.rdf b/xpinstall/res/content/SoftwareUpdates.rdf deleted file mode 100644 index b3f96b193189..000000000000 --- a/xpinstall/res/content/SoftwareUpdates.rdf +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - diff --git a/xpinstall/res/content/institems.js b/xpinstall/res/content/institems.js deleted file mode 100644 index d82607ab065d..000000000000 --- a/xpinstall/res/content/institems.js +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released - * March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -// dialog param block -var gParam; -var gBundle; - -function addTreeItem(num, aName, aUrl, aCertName) -{ - // first column is the package name - var item = document.createElement("description"); - item.setAttribute("value", aName); - item.setAttribute("tooltiptext", aName); - item.setAttribute("class", "confirmName"); - item.setAttribute("crop", "center"); - - // second column is for the cert name - var certName = document.createElement("description"); - var certNameValue = aCertName ? aCertName : gBundle.getString("Unsigned"); - certName.setAttribute("value", certNameValue); - certName.setAttribute("tooltiptext", certNameValue); - certName.setAttribute("crop", "center"); - - // third column is the host serving the file - var urltext = aUrl.replace(/^([^:]*:\/*[^\/]+).*/, "$1"); - var url = document.createElement("description"); - url.setAttribute("value", aUrl); - url.setAttribute("tooltiptext", aUrl); - url.setAttribute("class", "confirmURL"); - url.setAttribute("crop", "center"); - - // create row and add it to the grid - var row = document.createElement("row"); - row.appendChild(item); - row.appendChild(certName); - row.appendChild(url); - - document.getElementById("xpirows").appendChild(row); -} - -function onLoad() -{ - var row = 0; - var moduleName, URL, IconURL, certName, numberOfDialogTreeElements; - - gBundle = document.getElementById("xpinstallBundle"); - gParam = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock); - - gParam.SetInt(0, 1); // Set the default return to Cancel - - numberOfDialogTreeElements = gParam.GetInt(1); - - for (var i=0; i < numberOfDialogTreeElements; i++) - { - moduleName = gParam.GetString(i); - URL = gParam.GetString(++i); - IconURL = gParam.GetString(++i); // Advance the enumeration, parameter is unused just now. - certName = gParam.GetString(++i); - - addTreeItem(row++, moduleName, URL, certName); - } - - // Move default+focus from |accept| to |cancel| button. - var aButton = document.documentElement.getButton("accept"); - aButton.setAttribute("default", false); - aButton.setAttribute("label", gBundle.getString("OK")); - aButton.setAttribute("disabled", true); - - aButton = document.documentElement.getButton("cancel"); - aButton.focus(); - aButton.setAttribute("default", true); - - // start timer to re-enable buttons - var delayInterval = 2000; - try { - var prefs = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefBranch); - delayInterval = prefs.getIntPref("security.dialog_enable_delay"); - } catch (e) {} - setTimeout(reenableInstallButtons, delayInterval); -} - -function reenableInstallButtons() -{ - document.documentElement.getButton("accept").setAttribute("disabled", false); -} - -function onAccept() -{ - // set the accept button in the param block - if (gParam) - gParam.SetInt(0, 0); - - return true; -} - -function onCancel() -{ - // set the cancel button in the param block - if (gParam) - gParam.SetInt(0, 1); - - return true; -} diff --git a/xpinstall/res/content/institems.xul b/xpinstall/res/content/institems.xul deleted file mode 100644 index df09e4549131..000000000000 --- a/xpinstall/res/content/institems.xul +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/xpinstall/res/content/xpistatus.js b/xpinstall/res/content/xpistatus.js deleted file mode 100644 index 30eb0306bea5..000000000000 --- a/xpinstall/res/content/xpistatus.js +++ /dev/null @@ -1,190 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released - * March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gManager; -var gBundle; -var gCanClose = false; -var gCancelled = false; - -// implements nsIXPIProgressDialog -var progressHooks = -{ - onStateChange: function( aIndex, aState, aValue ) - { - const state = Components.interfaces.nsIXPIProgressDialog; - var status = document.getElementById("status"+aIndex); - var progress = document.getElementById("progress"+aIndex); - - switch( aState ) { - case state.DOWNLOAD_START: - status.setAttribute("value", - gBundle.getString("progress.downloading")); - progress.setAttribute("value","0%"); - break; - - case state.DOWNLOAD_DONE: - status.setAttribute("value", - gBundle.getString("progress.downloaded")); - progress.setAttribute("value","100%"); - break; - - case state.INSTALL_START: - status.setAttribute("value", - gBundle.getString("progress.installing")); - progress.setAttribute("mode","undetermined"); - break; - - case state.INSTALL_DONE: - progress.setAttribute("mode","determined"); - progress.hidden = true; - var msg; - try - { - msg = gBundle.getString("error"+aValue); - } - catch (e) - { - msg = gBundle.stringBundle.formatStringFromName( - "unknown.error", [aValue], 1 ); - } - status.setAttribute("value",msg); - break; - - case state.DIALOG_CLOSE: - // nsXPInstallManager is done with us, but we'll let users - // dismiss the dialog themselves so they can see the status - // (unless we're closing because the user cancelled) - document.documentElement.getButton("accept").disabled = false; - document.documentElement.getButton("cancel").disabled = true; - document.documentElement.getButton("accept").focus(); - gCanClose = true; - - if (gCancelled) - window.close(); - - break; - } - }, - - onProgress: function( aIndex, aValue, aMaxValue ) - { - var percent = Math.round( 100 * (aValue/aMaxValue) ); - var node = document.getElementById("progress"+aIndex); - node.setAttribute("value", percent); - }, - - QueryInterface: function( iid ) - { - if (iid.equals(Components.interfaces.nsISupports) || - iid.equals(Components.interfaces.nsIXPIProgressDialog)) - return this; - - Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; - return null; - } -} - - -function onLoad() -{ - document.documentElement.getButton("accept").disabled = true; - document.documentElement.getButton("cancel").focus(); - gBundle = document.getElementById("xpinstallBundle"); - - var param = window.arguments[0].QueryInterface( - Components.interfaces.nsIDialogParamBlock ); - if ( !param ) - dump (" error getting param block interface \n"); - - var i = 0; - var row = 0; - var numElements = param.GetInt(1); - while ( i < numElements ) - { - var moduleName = param.GetString(i++); - var URL = param.GetString(i++); - var IconURL = param.GetString(i++); // Advance the enumeration, parameter is unused just now. - var certName = param.GetString(i++); - addTreeItem(row++, moduleName, URL); - } - - gManager = window.arguments[1]; - - // inform nsXPInstallManager we're open for business - gManager.observe( progressHooks, "xpinstall-progress", "open" ); -} - -function addTreeItem(aRow, aName, aUrl) -{ - // first column is the package name - var item = document.createElement("description"); - item.setAttribute("class", "packageName"); - item.setAttribute("id", "package"+aRow); - item.setAttribute("value", aName); - item.setAttribute("tooltiptext", aUrl); - - // second column is the status - var status = document.createElement('description'); - status.setAttribute("class", "packageStatus"); - status.setAttribute("id", "status"+aRow); - status.setAttribute("value", gBundle.getString("progress.queued")); - - // third row is a progress meter - var progress = document.createElement("progressmeter"); - progress.setAttribute("class", "packageProgress"); - progress.setAttribute("id", "progress"+aRow); - progress.setAttribute("value", "0%"); - - // create row and add it to the grid - var row = document.createElement("row"); - row.appendChild(item); - row.appendChild(status); - row.appendChild(progress); - document.getElementById("xpirows").appendChild(row); -} - -function onCancel() -{ - gCancelled = true; - if (gManager) - gManager.observe( progressHooks, "xpinstall-progress", "cancel"); - - // window is closed by native impl after cleanup - return gCanClose; -} diff --git a/xpinstall/res/content/xpistatus.xul b/xpinstall/res/content/xpistatus.xul deleted file mode 100644 index 67c656d089f9..000000000000 --- a/xpinstall/res/content/xpistatus.xul +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - -