On 18 January 2011 06:18, John Emmas wrote:
> Thanks guys. In fact, I only need this for the purpose of calculating a
> path that's relative to the location of the installed program. It's of less
> importance on Linux because apps tend to be installed using the same path on
> everyone's system
On Tue, Jan 18, 2011 at 05:18:17AM +, John Emmas wrote:
> In fact, I only need this for the purpose of calculating
> a path that's relative to the location of the installed program. It's
> of less importance on Linux because apps tend to be installed using
> the same path on everyone's system
Thanks guys. In fact, I only need this for the purpose of calculating a path
that's relative to the location of the installed program. It's of less
importance on Linux because apps tend to be installed using the same path on
everyone's system so generally, one can make an intelligent guess. H
While it's not really a solve-all, you can use
g_win32_get_package_installation_directory_of_module(NULL) on Windows
to get the application's install path (Which can sometimes be not fully
what you need if you have a path like: "C:\Program Files\my_app\bin",
which would give "C:\Program Files\my_ap
On Wed, 2011-01-12 at 13:13 +, John Emmas wrote:
> Is there any [...] function that would tell me the full path to the
> application - e.g. "/usr/bin/my_app/my_app" under Linux, or "C:
> \Program Files\my_app\my_app.exe" under Windows?
Not in general - it's best to decide you don't need this
The only way to get this on linux is to read symlink /proc/self/exe
(readlink()) On Windows, you can use GetModuleName(NULL, xx, yy). Don't
know if glib has anything for this.
On 01/12/2011 02:13 PM, John Emmas wrote:
Browsing through glib/gutils.c this morning, I noticed a function called g_g
Browsing through glib/gutils.c this morning, I noticed a function called
g_get_application_name() which will return the application's name (e.g.
"my_app" on Linux, or "my_app.exe" on Windows). Is there any similar function
that would tell me the full path to the application - e.g.
"/usr/bin/my