- RegSetValueEx (hrootkey, "Path", 0, REG_SZ, dll_paths, len);
+ RegSetValueEx (hrootkey, "Path", 0, REG_EXPAND_SZ,
+ dll_paths, len);
+
+ /* Set the same path for runemacs.exe, as the Explorer shell
+ looks this up, so the above does not take effect when
+ emacs.exe is spawned from runemacs.exe. */
+ if (RegCreateKeyEx (HKEY_LOCAL_MACHINE, REG_RUNEMACS_PATH,
+ 0, "", REG_OPTION_NON_VOLATILE,
+ KEY_WRITE, NULL, &runemacs_key, NULL)
+ == ERROR_SUCCESS)
+ {
+ RegSetValueEx (runemacs_key, "Path", 0, REG_EXPAND_SZ,
+ dll_paths, len);
+
+ RegCloseKey (runemacs_key);
+ }