QTfrontend/main.cpp
changeset 3693 09892cdb8f95
parent 3681 1ee5b476e6b5
child 3697 d5b30d6373fc
--- a/QTfrontend/main.cpp	Sat Jul 31 10:39:20 2010 +0200
+++ b/QTfrontend/main.cpp	Sat Jul 31 10:42:40 2010 +0200
@@ -404,10 +404,19 @@
         app.installTranslator(&Translator);
     }
 
+    // Win32 registry setup (used for xfire detection etc. - don't set it if we're running in "portable" mode with a custom config dir)
+#ifdef _WIN32
+    if(cConfigDir->length() == 0)
+    {
+        QSettings registry(QSettings::NativeFormat, QSettings::UserScope, "Hedgewars Project", "Hedgewars");
+        QFileInfo f(argv[0]);
+        registry.setValue("file", f.absoluteFilePath());
+        registry.setValue("path", f.absolutePath());
+    }
+#endif
 
     HWForm *Form = new HWForm();
 
-
     Form->show();
     return app.exec();
 }