* (C) 2002 Ximian, Inc. (http://www.ximian.com)
*/
#include <config.h>
+#include <windows.h>
#include <mono/metadata/metadata.h>
#include <mono/os/util.h>
/*
* mono_set_rootdir:
- * @vm_filename: The pathname of the code invoking us (argv [0])
*
* Informs the runtime of the root directory for the Mono installation,
* the vm_file
*/
void
-mono_set_rootdir (const char *vm_filename)
+mono_set_rootdir (void)
{
- char *dir = g_dirname (vm_filename);
- char *root = g_strconcat (dir, "/lib");
+ char moddir[MAXPATHLEN], *bindir, *installdir, *root;
+
+ GetModuleFileName (NULL, moddir, sizeof(moddir));
+ bindir = g_path_get_dirname (moddir);
+ installdir = g_path_get_dirname (bindir);
+ root = g_build_path (G_DIR_SEPARATOR_S, installdir, "lib", NULL);
mono_assembly_setrootdir (root);
g_free (root);
- g_free (dir);
+ g_free (installdir);
+ g_free (bindir);
}