Skip to content

Commit

Permalink
Merge pull request #57 from PerryWerneck/develop
Browse files Browse the repository at this point in the history
Fixing win32 plugin load.
  • Loading branch information
PerryWerneck authored Dec 12, 2023
2 parents c33f934 + 5dac243 commit 5beda80
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 24 deletions.
3 changes: 2 additions & 1 deletion src/main/windows/tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
return path;
}

g_free(path);
g_message("Cant find path for '%s'",path);
g_free(path);

return NULL;

}
Expand Down
26 changes: 6 additions & 20 deletions src/objects/application/application.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/objects/settings/gsettings.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions win/pw3270.nsi.in
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 5beda80

Please sign in to comment.