0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.0.1191: MS-Windows: missing 32 and 64 bit files in installer

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)
This commit is contained in:
Bram Moolenaar
2017-10-14 19:05:44 +02:00
parent 2c33d7bb69
commit 6199d43f4b
8 changed files with 306 additions and 370 deletions

View File

@@ -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,