After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 733934 - win32: improve the package installation dir lookup
win32: improve the package installation dir lookup
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: win32
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2014-07-29 19:04 UTC by Ignacio Casal Quinteiro (nacho)
Modified: 2017-09-16 13:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
win32: improve the package installation dir lookup (1.74 KB, patch)
2014-07-29 19:04 UTC, Ignacio Casal Quinteiro (nacho)
reviewed Details | Review
win32: improve the package installation dir lookup (1.98 KB, patch)
2014-07-31 10:59 UTC, Ignacio Casal Quinteiro (nacho)
committed Details | Review

Description Ignacio Casal Quinteiro (nacho) 2014-07-29 19:04:47 UTC
Modules like gedit have the main private library in root/lib/gedit,
checking only for the parent whether it is lib or bin is not enough.
What I do here is to iterate through the parents until I find
lib or bin or the root in which case I just take the parent.
Comment 1 Ignacio Casal Quinteiro (nacho) 2014-07-29 19:04:54 UTC
Created attachment 281975 [details] [review]
win32: improve the package installation dir lookup
Comment 2 LRN 2014-07-29 19:09:18 UTC
Review of attachment 281975 [details] [review]:

Patch is OK.
Comment 3 Emmanuele Bassi (:ebassi) 2014-07-31 10:53:45 UTC
Review of attachment 281975 [details] [review]:

it would be nice to have a better commit message, to be honest, with examples of installation directories that would fail with the existing code.

the code itself looks okay.
Comment 4 Ignacio Casal Quinteiro (nacho) 2014-07-31 10:59:39 UTC
Created attachment 282135 [details] [review]
win32: improve the package installation dir lookup

As an example, the core of gedit is in a private library
placed in %INSTALLDIR%/lib/gedit/libgedit.dll

Before this patch we would get %INSTALLDIR%/lib/gedit as the
installation package dir, while what we actually want is to get
%INSTALLDIR%
Comment 5 Emmanuele Bassi (:ebassi) 2014-07-31 11:01:14 UTC
Review of attachment 282135 [details] [review]:

looks good to me.
Comment 6 Ignacio Casal Quinteiro (nacho) 2014-07-31 11:05:59 UTC
Attachment 282135 [details] pushed as 786590f - win32: improve the package installation dir lookup
Comment 7 Patrick Griffis (tingping) 2014-12-21 06:03:46 UTC
This commit should really have updated the docs. I created bug 739835 from the confusion it caused. The current docs explicitly go against all of this behavior and it has caused some strange behavior for some users naming a folder bin 5 directories up from the actual program (which is an odd use-case I admit).

Current docs being:

>If that directory's last component is "bin" or "lib", its parent directory is returned, otherwise the directory itself.

>It thus makes sense to pass only the handle to a "public" DLL of a software package to this function,
>as such DLLs typically are known to be installed in a "bin" or occasionally "lib" subfolder of the
>installation folder. DLLs that are of the dynamically loaded module or plugin variety are often
>located in more private locations deeper down in the tree, from which it is impossible for GLib to >deduce the root of the package installation.