Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config.h.mingw.in6
-rw-r--r--src/gcompris/binreloc.c40
2 files changed, 43 insertions, 3 deletions
diff --git a/config.h.mingw.in b/config.h.mingw.in
index 9b941e2..c568119 100644
--- a/config.h.mingw.in
+++ b/config.h.mingw.in
@@ -7,9 +7,6 @@
/* Supported languages */
#define ALL_LINGUAS "am ar az bg ca cs da de el en_CA en_GB es et fi fr ga gu he hi hr hu it lt mk ml ms nl nb nn pa pl pt pt_BR ro ru sk sl sq sr sr@Latn sv tr wa zh_CN"
-/* Global assetml directory */
-#define ASSETML_DIR "share/assetml"
-
/* "Enable debug messages." */
/* #undef DEBUG */
@@ -141,3 +138,6 @@
/* sdl mixer is enabled */
#define USE_SDLMIXER
+
+/* Use binary relocation */
+#define ENABLE_BINRELOC 1
diff --git a/src/gcompris/binreloc.c b/src/gcompris/binreloc.c
index cb12ad0..4bc275d 100644
--- a/src/gcompris/binreloc.c
+++ b/src/gcompris/binreloc.c
@@ -41,6 +41,45 @@ _br_find_exe (GbrInitError *error)
*error = GBR_INIT_ERROR_DISABLED;
return NULL;
#else
+#ifdef WIN32
+ /* I *thought* this program code already included the
+ relocation code for windows. Unfortunately this is not
+ the case and we have to add this manually. This is only
+ one possibility; other ways of looking up the full path
+ of gnucash-bin.exe probably exist.*/
+ gchar *prefix;
+ gchar *result;
+
+ /* From the glib docs: When passed NULL, this function looks
+ up installation the directory of the main executable of
+ the current process */
+ prefix = g_win32_get_package_installation_directory_of_module (NULL);
+ result = g_build_filename (prefix,
+ "bin", "gnucash-bin.exe",
+ (char*)NULL);
+ g_free (prefix);
+ return result;
+#elif MAC_INTEGRATION
+ gchar *prefix = NULL, *result = NULL;
+ g_type_init();
+ bundle = ige_mac_bundle_new();
+ if (!bundle) {
+ *error = GBR_INIT_ERROR_MAC_NOT_BUNDLE;
+ return NULL;
+ }
+ if (!ige_mac_bundle_get_is_app_bundle (bundle)) {
+ g_object_unref(bundle);
+ bundle = NULL;
+ *error = GBR_INIT_ERROR_MAC_NOT_APP_BUNDLE;
+ return NULL;
+ }
+ ige_mac_bundle_setup_environment(bundle);
+ prefix = g_strdup(ige_mac_bundle_get_path(bundle));
+ result = g_build_filename(prefix, "Contents/MacOS",
+ "gnucash-bin", NULL);
+ g_free(prefix);
+ return result;
+#else
char *path, *path2, *line, *result;
size_t buf_size;
ssize_t size;
@@ -164,6 +203,7 @@ _br_find_exe (GbrInitError *error)
g_free (line);
fclose (f);
return path;
+#endif /* G_OS_WINDOWS */
#endif /* ENABLE_BINRELOC */
}