From 9148ecba0cd3cef6a7df52910ee767b6037261cb Mon Sep 17 00:00:00 2001 From: "ssu%netscape.com" Date: Thu, 4 Oct 2001 22:04:55 +0000 Subject: [PATCH] backing out my previous check in. --- xpinstall/packager/common/share.t | 19 ++++----- xpinstall/src/makefile.win | 1 - xpinstall/src/nsInstall.cpp | 68 +----------------------------- xpinstall/src/nsInstallTrigger.cpp | 3 +- xpinstall/src/nsJSFile.cpp | 1 - 5 files changed, 10 insertions(+), 82 deletions(-) diff --git a/xpinstall/packager/common/share.t b/xpinstall/packager/common/share.t index 17c687a13b2..53c34cc4879 100644 --- a/xpinstall/packager/common/share.t +++ b/xpinstall/packager/common/share.t @@ -27,29 +27,26 @@ function deleteThisFile(dirKey, file) var fFileToDelete; fFileToDelete = getFolder(dirKey, file); - logComment("File to delete: " + fFileToDelete); - if(File.isFile(fFileToDelete)) + logComment(file + " file: " + fFileToDelete); + if(File.exists(fFileToDelete)) { - File.remove(fFileToDelete); + fileDelete(fFileToDelete); return(true); } else return(false); } -// this function deletes a folder if it exists -function deleteThisFolder(dirKey, folder, recursiveDelete) +// this function deletes a folder (recursively) if it exists +function deleteThisFolder(dirKey, folder) { var fToDelete; - if(typeof recursiveDelete == "undefined") - recursiveDelete = true; - fToDelete = getFolder(dirKey, folder); - logComment("folder to delete: " + fToDelete); - if(File.isDirectory(fToDelete)) + logComment(folder + " folder: " + fToDelete); + if(File.exists(fToDelete)) { - File.dirRemove(fToDelete, recursiveDelete); + File.dirRemove(fToDelete, true); return(true); } else diff --git a/xpinstall/src/makefile.win b/xpinstall/src/makefile.win index b9644581bd9..9267e94e941 100644 --- a/xpinstall/src/makefile.win +++ b/xpinstall/src/makefile.win @@ -118,7 +118,6 @@ OBJS = \ WIN_LIBS= \ ole32.lib \ - version.lib \ $(NULL) include <$(DEPTH)\config\rules.mak> diff --git a/xpinstall/src/nsInstall.cpp b/xpinstall/src/nsInstall.cpp index 8bbed3ad90f..7ed80969483 100644 --- a/xpinstall/src/nsInstall.cpp +++ b/xpinstall/src/nsInstall.cpp @@ -22,7 +22,6 @@ * Daniel Veditz * Douglas Turner * Pierre Phaneuf - * Sean Su */ @@ -1814,75 +1813,10 @@ nsInstall::FileOpFileExists(nsInstallFolder& aTarget, PRBool* aReturn) return NS_OK; } -#ifdef XP_WIN -#include -#endif - PRInt32 nsInstall::FileOpFileGetNativeVersion(nsInstallFolder& aTarget, nsString* aReturn) { - PRInt32 rv = NS_OK; - -#ifdef XP_WIN - PRBool flagExists; - nsCOMPtr localTarget(aTarget.GetFileSpec()); - UINT uLen; - UINT dwLen; - DWORD dwHandle; - LPVOID lpData; - LPVOID lpBuffer; - VS_FIXEDFILEINFO *lpBuffer2; - DWORD dwMajor = 0; - DWORD dwMinor = 0; - DWORD dwRelease = 0; - DWORD dwBuild = 0; - nsXPIDLCString nativeTargetPath; - char *nativeVersionString = nsnull; - - if(localTarget == nsnull) - return(rv); - - flagExists = PR_FALSE; - localTarget->Exists(&flagExists); - if(flagExists) - { - localTarget->GetPath(getter_Copies(nativeTargetPath)); - uLen = 0; - /* GetFileVersionInfoSize() requires a char *, but the api doesn't - * indicate that it will modify it */ - dwLen = GetFileVersionInfoSize((char *)nativeTargetPath.get(), &dwHandle); - lpData = (LPVOID)PR_Malloc(sizeof(long)*dwLen); - if(!lpData) - return(nsInstall::OUT_OF_MEMORY); - - /* GetFileVersionInfo() requires a char *, but the api doesn't - * indicate that it will modify it */ - if(GetFileVersionInfo((char *)nativeTargetPath.get(), dwHandle, dwLen, lpData) != 0) - { - if(VerQueryValue(lpData, "\\", &lpBuffer, &uLen) != 0) - { - lpBuffer2 = (VS_FIXEDFILEINFO *)lpBuffer; - dwMajor = HIWORD(lpBuffer2->dwFileVersionMS); - dwMinor = LOWORD(lpBuffer2->dwFileVersionMS); - dwRelease = HIWORD(lpBuffer2->dwFileVersionLS); - dwBuild = LOWORD(lpBuffer2->dwFileVersionLS); - } - } - - nativeVersionString = PR_smprintf("%d.%d.%d.%d", dwMajor, dwMinor, dwRelease, dwBuild); - if(!nativeVersionString) - rv = nsInstall::OUT_OF_MEMORY; - else - { - aReturn->Assign(NS_ConvertASCIItoUCS2(nativeVersionString)); - PR_smprintf_free(nativeVersionString); - } - - PR_FREEIF(lpData); - } -#endif - - return(rv); + return NS_OK; } PRInt32 diff --git a/xpinstall/src/nsInstallTrigger.cpp b/xpinstall/src/nsInstallTrigger.cpp index 5e7855e7553..7cbc681a9b0 100644 --- a/xpinstall/src/nsInstallTrigger.cpp +++ b/xpinstall/src/nsInstallTrigger.cpp @@ -189,8 +189,7 @@ nsInstallTrigger::UpdateEnabled(PRBool* aReturn) } else { - // no prefs manager: we're in the install wizard and always work - *aReturn = PR_TRUE; + *aReturn = PR_FALSE; /* no prefs manager. set to false */ } return NS_OK; diff --git a/xpinstall/src/nsJSFile.cpp b/xpinstall/src/nsJSFile.cpp index 68bbb71c107..3c73f7090ef 100644 --- a/xpinstall/src/nsJSFile.cpp +++ b/xpinstall/src/nsJSFile.cpp @@ -1483,7 +1483,6 @@ static JSFunctionSpec FileOpMethods[] = {"exists", InstallFileOpFileExists, 1}, {"execute", InstallFileOpFileExecute, 2}, {"nativeVersion", InstallFileOpFileGetNativeVersion, 1}, - {"windowsVersion", InstallFileOpFileGetNativeVersion, 1}, {"diskSpaceAvailable", InstallFileOpFileGetDiskSpaceAvailable,1}, {"modDate", InstallFileOpFileGetModDate, 1}, {"size", InstallFileOpFileGetSize, 1},