diff options
author | Simon Clitherow <aphex@nildram.co.uk> | 2003-06-05 01:22:57 +0400 |
---|---|---|
committer | Simon Clitherow <aphex@nildram.co.uk> | 2003-06-05 01:22:57 +0400 |
commit | f40d9f57ee9654b6d90f1df4c7867073fb3f92ea (patch) | |
tree | da705515fbfead941227e1bed2178748094d2dee | |
parent | f28910922861843b7faa43814970d7c21986965f (diff) |
Registering .blend files now works for Windows -- hopefully!
You will need to re-register the blend files (blender.exe -R)
for the fix to come into action.
-rw-r--r-- | source/blender/blenlib/intern/winstuff.c | 9 | ||||
-rw-r--r-- | source/creator/creator.c | 14 |
2 files changed, 11 insertions, 12 deletions
diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index 3a4491dedaa..813e2942bc9 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -57,11 +57,11 @@ int BLI_getInstallationDir( char * str ) { size = sizeof(buffer); - lresult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\BlenderFoundation", 0, + lresult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\BlenderFoundation\\Blender", 0, KEY_ALL_ACCESS, &hkey); if (lresult == ERROR_SUCCESS) { - lresult = RegQueryValueEx(hkey, "Install_Dir", 0, NULL, (LPBYTE)buffer, &size); + lresult = RegQueryValueEx(hkey, "Inst_Dir", 0, NULL, (LPBYTE)buffer, &size); strcpy(str, buffer); RegCloseKey(hkey); return 1; @@ -82,12 +82,11 @@ void RegisterBlendExtension(char * str) { strncpy(dir, str, strlen(str)-11); - lresult = RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\BlenderFoundation", 0, + lresult = RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\BlenderFoundation\\Blender", 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwd); if (lresult == ERROR_SUCCESS) { - if (dwd != REG_OPENED_EXISTING_KEY) - lresult = RegSetValueEx(hkey, "Install_Dir", 0, REG_SZ, dir, strlen(dir)+1); + lresult = RegSetValueEx(hkey, "Inst_Dir", 0, REG_SZ, dir, strlen(dir)+1); RegCloseKey(hkey); } diff --git a/source/creator/creator.c b/source/creator/creator.c index dbe6e000450..c63795d0038 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -407,6 +407,7 @@ int main(int argc, char **argv) * - "-d": enables debugging. * - "-w": fullscreen mode. * - "-W": borderless window (MS windows only). + * - "-R": registers the blender extensions. (MS windows only). * - "-noaudion", "-nosound": disables audio. * - "-nofrozen": disables frozen python. */ @@ -459,6 +460,12 @@ int main(int argc, char **argv) G.windowstate = G_WINDOWSTATE_FULLSCREEN; #endif break; + case 'R': + /* Registering filetypes only makes sense on windows... */ +#ifdef WIN32 + RegisterBlendExtension(argv[0]); +#endif + break; case 'n': case 'N': if (strcasecmp(argv[a], "-noaudio") == 0|| strcasecmp(argv[a], "-nosound") == 0) { @@ -545,7 +552,6 @@ int main(int argc, char **argv) * - "-S": sets the starting scene name. * - "-s": sets the start frame. * - "-e": sets the end frame. - * - "-R": registers the blender extensions. (MS windows only) * - <file>: sets the blender file to open. */ for(a=1; a<argc; a++) { @@ -641,12 +647,6 @@ int main(int argc, char **argv) if (a < argc) (G.scene->r.efra) = atoi(argv[a]); } break; - case 'R': - /* Registering filetypes only makes sense on windows... */ -#ifdef WIN32 - RegisterBlendExtension(argv[0]); -#endif - break; } } /** |