+
+/* Opening the htmluri in windows via cmd /start uri opens
+ the windows command shell for a moment. The alternative is
+ to start a script via wscript. This will not be visible*/
+#ifdef _WIN32
+static gboolean open_windows_help (const gchar *helpuri,
+ GError **err)
+{
+ gchar *vbsfilename = NULL;
+ gchar *vbs = NULL;
+ gboolean result;
+ vbsfilename = g_build_filename (g_get_tmp_dir (),
+ "pspp-help-open.vbs",
+ NULL);
+ vbs = g_strdup_printf("CreateObject(\"WScript.Shell\").Run \"%s\"",
+ helpuri);
+ result = g_file_set_contents (vbsfilename,
+ vbs,
+ strlen(vbs),
+ err);
+ g_free (vbs);
+ if (!result)
+ goto error;
+
+ gchar *argv[] = {"wscript",vbsfilename,0};
+
+ result = g_spawn_async (NULL, argv,
+ NULL, G_SPAWN_SEARCH_PATH,
+ NULL, NULL, NULL, err);
+ error:
+ g_free (vbsfilename);
+ return result;
+}
+#endif
+