From dbc32d1a0db1fb19576d30a0db4b8d79233b92b8 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Mon, 11 Dec 2023 23:55:53 -0300 Subject: [PATCH 1/3] Fixing win32 plugin loader. --- src/objects/application/application.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/src/objects/application/application.c b/src/objects/application/application.c index b60c38ce..05912917 100644 --- a/src/objects/application/application.c +++ b/src/objects/application/application.c @@ -278,35 +278,21 @@ static void pw3270Application_init(pw3270Application *app) { g_settings_bind(app->settings, "ui-style", app, "ui-style", G_SETTINGS_BIND_DEFAULT); } - // Load plugins from registry - /* - { - HKEY hKey; - DWORD cbData = 4096; - g_autofree gchar *path = g_malloc0(cbData); - - if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,G_STRINGIFY(PRODUCT_NAME)"\\plugin",0,KEY_READ,&hKey) == ERROR_SUCCESS) { - DWORD dwRet = RegQueryValueEx(hKey,"path",NULL,NULL,(LPBYTE) path, &cbData); - if(dwRet != ERROR_SUCCESS && *path) { - pw3270_load_plugins_from_path(app, path); - } - CloseHandle(hKey); - } - } - */ - // Load plugin from default paths. { const char *paths[] = { "plugins", G_STRINGIFY(PRODUCT_NAME) "-plugins", - "lib/plugins", - "lib/" G_STRINGIFY(PRODUCT_NAME) "-plugins", + "lib\\plugins", + "lib\\" G_STRINGIFY(PRODUCT_NAME) "-plugins", }; size_t ix; + g_autofree gchar * install = g_win32_get_package_installation_directory_of_module(NULL); + for(ix = 0; ix < G_N_ELEMENTS(paths);ix++) { - lib3270_autoptr(char) path = lib3270_build_data_filename("plugins",NULL); + g_autofree gchar * path = g_build_filename(install,paths[ix],NULL); + g_message("Checking '%s' for plugin files",path); if(g_file_test(path,G_FILE_TEST_IS_DIR)) { pw3270_load_plugins_from_path(app, path); break; From 35639cb947708059e93bc5957e1038ad1c492465 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Tue, 12 Dec 2023 00:04:47 -0300 Subject: [PATCH 2/3] Just forcing workflow to run. --- win/pw3270.nsi.in | 1 + 1 file changed, 1 insertion(+) diff --git a/win/pw3270.nsi.in b/win/pw3270.nsi.in index b275f461..39e3c19c 100644 --- a/win/pw3270.nsi.in +++ b/win/pw3270.nsi.in @@ -222,6 +222,7 @@ SubSection "@PRODUCT_NAME@" SecMain Section "Remote control" IPCPlugin ${DisableX64FSRedirection} + CreateDirectory "$INSTDIR\lib\@PRODUCT_NAME@-plugins" file "/oname=$INSTDIR\lib\@PRODUCT_NAME@-plugins\ipcserver.dll" "lib\@PRODUCT_NAME@-plugins\ipcserver.dll" From d4804172190d9ca441072e38ba51f239213dea52 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Tue, 12 Dec 2023 01:08:52 -0300 Subject: [PATCH 3/3] Fixing plugin load on windows. --- src/main/windows/tools.c | 3 ++- src/objects/settings/gsettings.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/windows/tools.c b/src/main/windows/tools.c index 09105ccb..2b39f4e3 100644 --- a/src/main/windows/tools.c +++ b/src/main/windows/tools.c @@ -35,8 +35,9 @@ return path; } - g_free(path); g_message("Cant find path for '%s'",path); + g_free(path); + return NULL; } diff --git a/src/objects/settings/gsettings.c b/src/objects/settings/gsettings.c index d503134b..4e87417f 100644 --- a/src/objects/settings/gsettings.c +++ b/src/objects/settings/gsettings.c @@ -100,13 +100,13 @@ schema_id, TRUE); - g_message("Loading '%s'",names[ix]); +// g_message("Loading '%s'",names[ix]); settings = g_settings_new_full(schema, NULL, NULL); g_settings_schema_source_unref(source); if(settings) { - g_message("Got gsettings from %s",names[ix]); +// g_message("Got gsettings from %s",names[ix]); return settings; } @@ -157,7 +157,7 @@ GSettings * pw3270_application_settings_new() { return settings_new(G_STRINGIFY(PRODUCT_ID)); - } + } GSettings * pw3270_application_window_settings_new() { return settings_new(G_STRINGIFY(PRODUCT_ID) ".window");