Fix Windows Python plugin DLL selection

This commit is contained in:
2026-07-07 13:31:52 -06:00
parent c3d8f27f48
commit 24951f5504
2 changed files with 24 additions and 5 deletions

View File

@@ -25,6 +25,7 @@
#ifdef WIN32 #ifdef WIN32
#include <io.h> #include <io.h>
#include <windows.h>
#else #else
#include <unistd.h> #include <unistd.h>
#endif #endif
@@ -56,6 +57,22 @@ typedef struct session zoitechat_context;
#endif #endif
#define DEBUG(x) {x;} #define DEBUG(x) {x;}
#ifdef WIN32
static gboolean
plugin_windows_is_windows7 (void)
{
OSVERSIONINFOEXA version;
memset (&version, 0, sizeof (version));
version.dwOSVersionInfoSize = sizeof (version);
if (!GetVersionExA ((OSVERSIONINFOA *)&version))
return FALSE;
return version.dwPlatformId == VER_PLATFORM_WIN32_NT &&
version.dwMajorVersion == 6 && version.dwMinorVersion == 1;
}
#endif
/* crafted to be an even 32 bytes */ /* crafted to be an even 32 bytes */
struct _zoitechat_hook struct _zoitechat_hook
@@ -491,8 +508,10 @@ plugin_auto_load (session *sess)
for_files (lib_dir, "hcfishlim.dll", plugin_auto_load_cb); for_files (lib_dir, "hcfishlim.dll", plugin_auto_load_cb);
for_files(lib_dir, "hclua.dll", plugin_auto_load_cb); for_files(lib_dir, "hclua.dll", plugin_auto_load_cb);
for_files (lib_dir, "hcperl.dll", plugin_auto_load_cb); for_files (lib_dir, "hcperl.dll", plugin_auto_load_cb);
for_files (lib_dir, "hcpython3.dll", plugin_auto_load_cb); if (plugin_windows_is_windows7 ())
for_files (lib_dir, "hcpython38.dll", plugin_auto_load_cb); for_files (lib_dir, "hcpython38.dll", plugin_auto_load_cb);
else
for_files (lib_dir, "hcpython3.dll", plugin_auto_load_cb);
for_files (lib_dir, "hcupd.dll", plugin_auto_load_cb); for_files (lib_dir, "hcupd.dll", plugin_auto_load_cb);
for_files (lib_dir, "hcsysinfo.dll", plugin_auto_load_cb); for_files (lib_dir, "hcsysinfo.dll", plugin_auto_load_cb);
#else #else

View File

@@ -181,8 +181,8 @@ Source: "plugins\hcperl.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Co
Source: "python\*.py"; DestDir: "{app}\python"; Flags: ignoreversion; Components: langs\python Source: "python\*.py"; DestDir: "{app}\python"; Flags: ignoreversion; Components: langs\python
Source: "plugins\hcpython3.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: langs\python Source: "plugins\hcpython3.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: langs\python; Check: not IsWindows7
Source: "plugins\hcpython38.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion skipifsourcedoesntexist; Components: langs\python Source: "plugins\hcpython38.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion skipifsourcedoesntexist; Components: langs\python; Check: IsWindows7
Source: "_cffi_backend.cp3*.pyd"; DestDir: "{app}"; Flags: ignoreversion; Components: langs\python Source: "_cffi_backend.cp3*.pyd"; DestDir: "{app}"; Flags: ignoreversion; Components: langs\python
Source: "zoitechat.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "zoitechat.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
@@ -382,7 +382,7 @@ begin
REDIST := 'https://aka.ms/vs/17/release/vc_redist.x64.exe'; REDIST := 'https://aka.ms/vs/17/release/vc_redist.x64.exe';
PERL := 'https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_54201_64bit/strawberry-perl-5.42.0.1-64bit.msi'; PERL := 'https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_54201_64bit/strawberry-perl-5.42.0.1-64bit.msi';
PY3 := PythonURL(); PY3 := PythonURL();
SPELL := 'https://github.com/zoitechat/gvsbuild/releases/download/zoitechat-2.16.2/ZoiteChat.Spelling.Dictionaries.r2.exe'; SPELL := 'https://github.com/hexchat/gvsbuild/releases/download/hexchat-2.16.2/HexChat.Spelling.Dictionaries.r2.exe';
if WizardIsComponentSelected('deps\vcredist2015') and not CheckVCInstall() then if WizardIsComponentSelected('deps\vcredist2015') and not CheckVCInstall() then
idpAddFile(REDIST, ExpandConstant('{tmp}\vcredist.exe')); idpAddFile(REDIST, ExpandConstant('{tmp}\vcredist.exe'));