From 24f43a62140e1df47ddcbb607fecb982532a9d7f Mon Sep 17 00:00:00 2001 From: kichik Date: Mon, 16 Apr 2007 20:15:00 +0000 Subject: [PATCH] fixed bug #1701290 - linux FTBFS: stubs and librarylocal git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5088 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/Library/LibraryLocal/LibraryLocal.cpp | 18 +++++++++++------- Source/Platform.h | 4 ++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Contrib/Library/LibraryLocal/LibraryLocal.cpp b/Contrib/Library/LibraryLocal/LibraryLocal.cpp index 9a29c37c..aba75ba1 100644 --- a/Contrib/Library/LibraryLocal/LibraryLocal.cpp +++ b/Contrib/Library/LibraryLocal/LibraryLocal.cpp @@ -6,12 +6,15 @@ */ -#include +#include "../../../Source/Platform.h" + #include #include #include +#include #include "../../../Source/ResourceEditor.h" +#include "../../../Source/ResourceVersionInfo.h" #include "../../../Source/winchar.h" using namespace std; @@ -141,8 +144,8 @@ int main(int argc, char* argv[]) mode = argv[1]; filename = argv[2]; - char buf[MAX_PATH]; - GetCurrentDirectory(MAX_PATH, buf); + char buf[1024]; + getcwd(buf, 1024); filepath = buf; if ((filename.substr(0, 1).compare("\\") != 0) && (filename.substr(1, 1).compare(":") != 0)) { @@ -184,14 +187,15 @@ int main(int argc, char* argv[]) // Validate filename - WIN32_FIND_DATA wfd; - HANDLE hFind = FindFirstFile(filepath.c_str(), &wfd); + ifstream fs(filepath.c_str()); - if (hFind != INVALID_HANDLE_VALUE) + if (fs.is_open()) { filefound = 1; - FindClose(hFind); + fs.close(); } + + // Work int versionfound = 0; DWORD low = 0, high = 0; diff --git a/Source/Platform.h b/Source/Platform.h index c0f98a01..b99f5451 100644 --- a/Source/Platform.h +++ b/Source/Platform.h @@ -550,6 +550,10 @@ typedef DWORDLONG ULONGLONG,*PULONGLONG; # define HKEY_DYN_DATA ((HKEY)0x80000006) #endif +#ifndef KEY_WOW64_64KEY +# define KEY_WOW64_64KEY 0x100 +#endif + // show modes #ifndef SW_SHOWNORMAL