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/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; 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"); 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"