summaryrefslogtreecommitdiff
path: root/src/GvimExt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-10-14 19:05:44 +0200
committerBram Moolenaar <Bram@vim.org>2017-10-14 19:05:44 +0200
commit6199d43f4b59a9bb1c87d408c5b33fa19a23ebcd (patch)
tree9e3b891db8cf578f455cf15512286e8160eb8326 /src/GvimExt
parent2c33d7bb69c4c2c5b0e39b03cc4b0c04cfdfbb0b (diff)
downloadvim-git-6199d43f4b59a9bb1c87d408c5b33fa19a23ebcd.tar.gz
patch 8.0.1191: MS-Windows: missing 32 and 64 bit files in installerv8.0.1191
Problem: MS-Windows: missing 32 and 64 bit files in installer. Solution: Include both 32 and 64 bit GvimExt and related dll files. Remove old Windows code from the installer. (Ken Takata, closes #2144)
Diffstat (limited to 'src/GvimExt')
-rw-r--r--src/GvimExt/gvimext.cpp67
1 files changed, 15 insertions, 52 deletions
diff --git a/src/GvimExt/gvimext.cpp b/src/GvimExt/gvimext.cpp
index b682b7429..2b9f1ad8f 100644
--- a/src/GvimExt/gvimext.cpp
+++ b/src/GvimExt/gvimext.cpp
@@ -38,7 +38,7 @@ STGMEDIUM medium;
HRESULT hres = 0;
UINT cbFiles = 0;
-/* The buffers size used to be MAX_PATH (256 bytes), but that's not always
+/* The buffers size used to be MAX_PATH (260 bytes), but that's not always
* enough */
#define BUFSIZE 1100
@@ -203,7 +203,7 @@ dyn_libintl_init(char *dir)
if (hLibintlDLL)
return 1;
- // Load gettext library from the Vim runtime directory.
+ // Load gettext library from $VIMRUNTIME\GvimExt{64,32} directory.
// Add the directory to $PATH temporarily.
len = GetEnvironmentVariableW(L"PATH", NULL, 0);
len2 = MAX_PATH + 1 + len;
@@ -212,7 +212,11 @@ dyn_libintl_init(char *dir)
if (buf != NULL && buf2 != NULL)
{
GetEnvironmentVariableW(L"PATH", buf, len);
- _snwprintf(buf2, len2, L"%S;%s", dir, buf);
+#ifdef _WIN64
+ _snwprintf(buf2, len2, L"%S\\GvimExt64;%s", dir, buf);
+#else
+ _snwprintf(buf2, len2, L"%S\\GvimExt32;%s", dir, buf);
+#endif
SetEnvironmentVariableW(L"PATH", buf2);
hLibintlDLL = LoadLibrary(GETTEXT_DLL);
#ifdef GETTEXT_DLL_ALT
@@ -883,37 +887,7 @@ BOOL CShellExt::LoadMenuIcon()
return TRUE;
}
-#ifdef WIN32
-// This symbol is not defined in older versions of the SDK or Visual C++.
-
-#ifndef VER_PLATFORM_WIN32_WINDOWS
-# define VER_PLATFORM_WIN32_WINDOWS 1
-#endif
-
-static DWORD g_PlatformId;
-
-//
-// Set g_PlatformId to VER_PLATFORM_WIN32_NT (NT) or
-// VER_PLATFORM_WIN32_WINDOWS (Win95).
-//
- static void
-PlatformId(void)
-{
- static int done = FALSE;
-
- if (!done)
- {
- OSVERSIONINFO ovi;
-
- ovi.dwOSVersionInfoSize = sizeof(ovi);
- GetVersionEx(&ovi);
-
- g_PlatformId = ovi.dwPlatformId;
- done = TRUE;
- }
-}
-
-# ifndef __BORLANDC__
+#ifndef __BORLANDC__
static char *
searchpath(char *name)
{
@@ -922,28 +896,17 @@ searchpath(char *name)
// There appears to be a bug in FindExecutableA() on Windows NT.
// Use FindExecutableW() instead...
- PlatformId();
- if (g_PlatformId == VER_PLATFORM_WIN32_NT)
+ MultiByteToWideChar(CP_ACP, 0, (LPCSTR)name, -1,
+ (LPWSTR)widename, BUFSIZE);
+ if (FindExecutableW((LPCWSTR)widename, (LPCWSTR)"",
+ (LPWSTR)location) > (HINSTANCE)32)
{
- MultiByteToWideChar(CP_ACP, 0, (LPCTSTR)name, -1,
- (LPWSTR)widename, BUFSIZE);
- if (FindExecutableW((LPCWSTR)widename, (LPCWSTR)"",
- (LPWSTR)location) > (HINSTANCE)32)
- {
- WideCharToMultiByte(CP_ACP, 0, (LPWSTR)location, -1,
- (LPSTR)widename, 2 * BUFSIZE, NULL, NULL);
- return widename;
- }
- }
- else
- {
- if (FindExecutableA((LPCTSTR)name, (LPCTSTR)"",
- (LPTSTR)location) > (HINSTANCE)32)
- return location;
+ WideCharToMultiByte(CP_ACP, 0, (LPWSTR)location, -1,
+ (LPSTR)widename, 2 * BUFSIZE, NULL, NULL);
+ return widename;
}
return (char *)"";
}
-# endif
#endif
STDMETHODIMP CShellExt::InvokeGvim(HWND hParent,