Commit ceaf53219c269dde98e02935621cff80cc36ea0d
Committed by
GitHub
Exists in
develop
Merge pull request #56 from PerryWerneck/winpkg
Fixing win32 plugin loader.
Showing
4 changed files
with
12 additions
and
24 deletions
Show diff stats
src/main/windows/tools.c
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; | ... | ... |
src/objects/settings/gsettings.c
| ... | ... | @@ -100,13 +100,13 @@ |
| 100 | 100 | schema_id, |
| 101 | 101 | TRUE); |
| 102 | 102 | |
| 103 | - g_message("Loading '%s'",names[ix]); | |
| 103 | +// g_message("Loading '%s'",names[ix]); | |
| 104 | 104 | settings = g_settings_new_full(schema, NULL, NULL); |
| 105 | 105 | |
| 106 | 106 | g_settings_schema_source_unref(source); |
| 107 | 107 | |
| 108 | 108 | if(settings) { |
| 109 | - g_message("Got gsettings from %s",names[ix]); | |
| 109 | +// g_message("Got gsettings from %s",names[ix]); | |
| 110 | 110 | return settings; |
| 111 | 111 | } |
| 112 | 112 | |
| ... | ... | @@ -157,7 +157,7 @@ |
| 157 | 157 | |
| 158 | 158 | GSettings * pw3270_application_settings_new() { |
| 159 | 159 | return settings_new(G_STRINGIFY(PRODUCT_ID)); |
| 160 | - } | |
| 160 | + } | |
| 161 | 161 | |
| 162 | 162 | GSettings * pw3270_application_window_settings_new() { |
| 163 | 163 | return settings_new(G_STRINGIFY(PRODUCT_ID) ".window"); | ... | ... |
win/pw3270.nsi.in
| ... | ... | @@ -222,6 +222,7 @@ SubSection "@PRODUCT_NAME@" SecMain |
| 222 | 222 | Section "Remote control" IPCPlugin |
| 223 | 223 | |
| 224 | 224 | ${DisableX64FSRedirection} |
| 225 | + | |
| 225 | 226 | CreateDirectory "$INSTDIR\lib\@PRODUCT_NAME@-plugins" |
| 226 | 227 | file "/oname=$INSTDIR\lib\@PRODUCT_NAME@-plugins\ipcserver.dll" "lib\@PRODUCT_NAME@-plugins\ipcserver.dll" |
| 227 | 228 | ... | ... |