Commit dbc32d1a0db1fb19576d30a0db4b8d79233b92b8
1 parent
61064ce2
Exists in
develop
Fixing win32 plugin loader.
Showing
1 changed file
with
6 additions
and
20 deletions
Show diff stats
src/objects/application/application.c
... | ... | @@ -278,35 +278,21 @@ static void pw3270Application_init(pw3270Application *app) { |
278 | 278 | g_settings_bind(app->settings, "ui-style", app, "ui-style", G_SETTINGS_BIND_DEFAULT); |
279 | 279 | } |
280 | 280 | |
281 | - // Load plugins from registry | |
282 | - /* | |
283 | - { | |
284 | - HKEY hKey; | |
285 | - DWORD cbData = 4096; | |
286 | - g_autofree gchar *path = g_malloc0(cbData); | |
287 | - | |
288 | - if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,G_STRINGIFY(PRODUCT_NAME)"\\plugin",0,KEY_READ,&hKey) == ERROR_SUCCESS) { | |
289 | - DWORD dwRet = RegQueryValueEx(hKey,"path",NULL,NULL,(LPBYTE) path, &cbData); | |
290 | - if(dwRet != ERROR_SUCCESS && *path) { | |
291 | - pw3270_load_plugins_from_path(app, path); | |
292 | - } | |
293 | - CloseHandle(hKey); | |
294 | - } | |
295 | - } | |
296 | - */ | |
297 | - | |
298 | 281 | // Load plugin from default paths. |
299 | 282 | { |
300 | 283 | const char *paths[] = { |
301 | 284 | "plugins", |
302 | 285 | G_STRINGIFY(PRODUCT_NAME) "-plugins", |
303 | - "lib/plugins", | |
304 | - "lib/" G_STRINGIFY(PRODUCT_NAME) "-plugins", | |
286 | + "lib\\plugins", | |
287 | + "lib\\" G_STRINGIFY(PRODUCT_NAME) "-plugins", | |
305 | 288 | }; |
306 | 289 | size_t ix; |
307 | 290 | |
291 | + g_autofree gchar * install = g_win32_get_package_installation_directory_of_module(NULL); | |
292 | + | |
308 | 293 | for(ix = 0; ix < G_N_ELEMENTS(paths);ix++) { |
309 | - lib3270_autoptr(char) path = lib3270_build_data_filename("plugins",NULL); | |
294 | + g_autofree gchar * path = g_build_filename(install,paths[ix],NULL); | |
295 | + g_message("Checking '%s' for plugin files",path); | |
310 | 296 | if(g_file_test(path,G_FILE_TEST_IS_DIR)) { |
311 | 297 | pw3270_load_plugins_from_path(app, path); |
312 | 298 | break; | ... | ... |