- fixed 'double-click on blend file' errors on Windows -- INTERNATIONAL stuff now also checks the installation directory for /.blender, etc
- registering .blend files for WinNT/2000/XP now works correctly (settings remain after a reboot).
This commit is contained in:
@@ -44,8 +44,7 @@ RSC=rc.exe
|
|||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
LINK32=link.exe -lib
|
LINK32=link.exe -lib
|
||||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\..\lib\windows\freetype\include" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\bpython\include" /I "..\..\..\source\blender\makesdna" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "WITH_FREETYPE2" /J /FD /c
|
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\..\lib\windows\freetype\include" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\bpython\include" /I "..\..\..\source\blender\makesdna" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "WITH_FREETYPE2" /J /FD /c
|
||||||
# SUBTRACT CPP /YX
|
|
||||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
@@ -69,8 +68,7 @@ LIB32=link.exe -lib
|
|||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
LINK32=link.exe -lib
|
LINK32=link.exe -lib
|
||||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\bpython\include" /I "..\..\..\source\blender\makesdna" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /J /FD /GZ /c
|
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\bpython\include" /I "..\..\..\source\blender\makesdna" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /J /FD /GZ /c
|
||||||
# SUBTRACT CPP /Fr /YX
|
|
||||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
|
@@ -212,6 +212,10 @@ void BLI_where_am_i(char *fullname, char *name);
|
|||||||
char* BLI_getbundle(void);
|
char* BLI_getbundle(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
int BLI_getInstallationDir( char * str );
|
||||||
|
#endif
|
||||||
|
|
||||||
/* BLI_storage.h */
|
/* BLI_storage.h */
|
||||||
int BLI_filesize(int file);
|
int BLI_filesize(int file);
|
||||||
double BLI_diskfree(char *dir);
|
double BLI_diskfree(char *dir);
|
||||||
|
@@ -51,6 +51,8 @@ CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
|
|||||||
# path to freetype font stuff
|
# path to freetype font stuff
|
||||||
CPPFLAGS += -I$(NAN_FREETYPE)/include
|
CPPFLAGS += -I$(NAN_FREETYPE)/include
|
||||||
CPPFLAGS += -I$(NAN_FREETYPE)/include/freetype2
|
CPPFLAGS += -I$(NAN_FREETYPE)/include/freetype2
|
||||||
|
# path to blenkernel
|
||||||
|
CPPFLAGS += -I$(SRCHOME)/blender/blenkernel
|
||||||
CPPFLAGS += -I../../include/
|
CPPFLAGS += -I../../include/
|
||||||
|
|
||||||
ifdef WITH_FREETYPE2
|
ifdef WITH_FREETYPE2
|
||||||
|
@@ -46,15 +46,53 @@
|
|||||||
#include "BLI_util.h"
|
#include "BLI_util.h"
|
||||||
#include "BLI_winstuff.h"
|
#include "BLI_winstuff.h"
|
||||||
|
|
||||||
|
#include "BKE_utildefines.h" /* FILE_MAXDIR + FILE_MAXFILE */
|
||||||
|
|
||||||
|
int BLI_getInstallationDir( char * str ) {
|
||||||
|
LONG lresult;
|
||||||
|
HKEY hkey = 0;
|
||||||
|
LONG type;
|
||||||
|
char buffer[FILE_MAXDIR+FILE_MAXFILE];
|
||||||
|
DWORD size;
|
||||||
|
|
||||||
|
size = sizeof(buffer);
|
||||||
|
|
||||||
|
lresult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\BlenderFoundation", 0,
|
||||||
|
KEY_ALL_ACCESS, &hkey);
|
||||||
|
|
||||||
|
if (lresult == ERROR_SUCCESS) {
|
||||||
|
lresult = RegQueryValueEx(hkey, "Install_Dir", 0, NULL, (LPBYTE)buffer, &size);
|
||||||
|
strcpy(str, buffer);
|
||||||
|
RegCloseKey(hkey);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void RegisterBlendExtension(char * str) {
|
void RegisterBlendExtension(char * str) {
|
||||||
LONG lresult;
|
LONG lresult;
|
||||||
HKEY hkey = 0;
|
HKEY hkey = 0;
|
||||||
DWORD dwd = 0;
|
DWORD dwd = 0;
|
||||||
|
char *dir;
|
||||||
char buffer[128];
|
char buffer[128];
|
||||||
|
|
||||||
|
/* Add installation dir to registry --aphex */
|
||||||
|
|
||||||
|
strncpy(dir, str, strlen(str)-11);
|
||||||
|
|
||||||
|
lresult = RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\BlenderFoundation", 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);
|
||||||
|
RegCloseKey(hkey);
|
||||||
|
}
|
||||||
|
|
||||||
lresult = RegCreateKeyEx(HKEY_CLASSES_ROOT, "blendfile\\shell\\open\\command", 0,
|
lresult = RegCreateKeyEx(HKEY_CLASSES_ROOT, "blendfile\\shell\\open\\command", 0,
|
||||||
"", REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwd);
|
"", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwd);
|
||||||
|
|
||||||
if (lresult == ERROR_SUCCESS) {
|
if (lresult == ERROR_SUCCESS) {
|
||||||
sprintf(buffer, "\"%s\" \"%%1\"", str);
|
sprintf(buffer, "\"%s\" \"%%1\"", str);
|
||||||
@@ -63,7 +101,7 @@ void RegisterBlendExtension(char * str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lresult = RegCreateKeyEx(HKEY_CLASSES_ROOT, "blendfile\\DefaultIcon", 0,
|
lresult = RegCreateKeyEx(HKEY_CLASSES_ROOT, "blendfile\\DefaultIcon", 0,
|
||||||
"", REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwd);
|
"", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwd);
|
||||||
|
|
||||||
if (lresult == ERROR_SUCCESS) {
|
if (lresult == ERROR_SUCCESS) {
|
||||||
sprintf(buffer, "\"%s\",1", str);
|
sprintf(buffer, "\"%s\",1", str);
|
||||||
@@ -72,7 +110,7 @@ void RegisterBlendExtension(char * str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lresult = RegCreateKeyEx(HKEY_CLASSES_ROOT, ".blend", 0,
|
lresult = RegCreateKeyEx(HKEY_CLASSES_ROOT, ".blend", 0,
|
||||||
"", REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwd);
|
"", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwd);
|
||||||
|
|
||||||
if (lresult == ERROR_SUCCESS) {
|
if (lresult == ERROR_SUCCESS) {
|
||||||
sprintf(buffer, "%s", "blendfile");
|
sprintf(buffer, "%s", "blendfile");
|
||||||
|
@@ -43,8 +43,6 @@
|
|||||||
#include "BKE_utildefines.h"
|
#include "BKE_utildefines.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "BLI_blenlib.h"
|
|
||||||
|
|
||||||
#define DOMAIN_NAME "blender"
|
#define DOMAIN_NAME "blender"
|
||||||
|
|
||||||
#define SYSTEM_ENCODING_DEFAULT "UTF-8"
|
#define SYSTEM_ENCODING_DEFAULT "UTF-8"
|
||||||
@@ -117,6 +115,13 @@ FTF_TTFont::FTF_TTFont(void)
|
|||||||
BLI_make_file_string("/", messagepath, BLI_gethome(), ".blender/locale");
|
BLI_make_file_string("/", messagepath, BLI_gethome(), ".blender/locale");
|
||||||
|
|
||||||
if(BLI_exist(messagepath) == NULL) { // locale not in home dir
|
if(BLI_exist(messagepath) == NULL) { // locale not in home dir
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
/* message catalogs are stored in the installation dir */
|
||||||
|
BLI_getInstallationDir(messagepath);
|
||||||
|
strcat(messagepath, "/.blender/locale");
|
||||||
|
if(BLI_exist(messagepath) == NULL) {
|
||||||
|
#endif
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
/* message catalogs are stored inside the application bundle */
|
/* message catalogs are stored inside the application bundle */
|
||||||
bundlepath = BLI_getbundle();
|
bundlepath = BLI_getbundle();
|
||||||
@@ -129,6 +134,9 @@ FTF_TTFont::FTF_TTFont(void)
|
|||||||
if(BLI_exist(messagepath) == NULL) { // locale not in LOCALEDIR
|
if(BLI_exist(messagepath) == NULL) { // locale not in LOCALEDIR
|
||||||
strcpy(messagepath, "message"); // old compatibility as last
|
strcpy(messagepath, "message"); // old compatibility as last
|
||||||
}
|
}
|
||||||
|
#ifdef WIN32
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -41,6 +41,7 @@
|
|||||||
|
|
||||||
#include "BLI_blenlib.h"
|
#include "BLI_blenlib.h"
|
||||||
#include "BLI_linklist.h" /* linknode */
|
#include "BLI_linklist.h" /* linknode */
|
||||||
|
#include "BLI_winstuff.h"
|
||||||
|
|
||||||
#include "BIF_language.h"
|
#include "BIF_language.h"
|
||||||
#include "BIF_space.h" /* allqueue() */
|
#include "BIF_space.h" /* allqueue() */
|
||||||
@@ -174,13 +175,19 @@ void start_interface_font(void) {
|
|||||||
U.fontsize= 11;
|
U.fontsize= 11;
|
||||||
U.encoding= 0;
|
U.encoding= 0;
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#if defined (__APPLE__)
|
||||||
bundlepath = BLI_getbundle();
|
bundlepath = BLI_getbundle();
|
||||||
strcpy(tstr, bundlepath);
|
strcpy(tstr, bundlepath);
|
||||||
strcat(tstr, "/Contents/Resources/");
|
strcat(tstr, "/Contents/Resources/");
|
||||||
strcat(tstr, ".bfont.ttf");
|
strcat(tstr, ".bfont.ttf");
|
||||||
result = FTF_SetFont(tstr, U.fontsize);
|
result = FTF_SetFont(tstr, U.fontsize);
|
||||||
|
|
||||||
|
sprintf(U.fontname, ".blender/.bfont.ttf\0");
|
||||||
|
#elif defined (WIN32)
|
||||||
|
BLI_getInstallationDir(tstr);
|
||||||
|
strcat(tstr, "/.blender/.bfont.ttf\0");
|
||||||
|
result = FTF_SetFont(tstr, U.fontsize);
|
||||||
|
|
||||||
sprintf(U.fontname, ".blender/.bfont.ttf\0");
|
sprintf(U.fontname, ".blender/.bfont.ttf\0");
|
||||||
#else
|
#else
|
||||||
sprintf(U.fontname, ".blender/.bfont.ttf\0");
|
sprintf(U.fontname, ".blender/.bfont.ttf\0");
|
||||||
@@ -273,10 +280,14 @@ int read_languagefile(void) {
|
|||||||
if(lines == NULL) {
|
if(lines == NULL) {
|
||||||
/* If not found in home, try current dir
|
/* If not found in home, try current dir
|
||||||
* (Resources folder of app bundle on OS X) */
|
* (Resources folder of app bundle on OS X) */
|
||||||
#ifdef __APPLE__
|
#if defined (__APPLE__)
|
||||||
char *bundlePath = BLI_getbundle();
|
char *bundlePath = BLI_getbundle();
|
||||||
strcpy(name, bundlePath);
|
strcpy(name, bundlePath);
|
||||||
strcat(name, "/Contents/Resources/.Blanguages");
|
strcat(name, "/Contents/Resources/.Blanguages");
|
||||||
|
#elif defined (WIN32)
|
||||||
|
/* Check the installation dir in Windows */
|
||||||
|
BLI_getInstallationDir(name);
|
||||||
|
strcat(name,"/.blender/.Blanguages");
|
||||||
#else
|
#else
|
||||||
strcpy(name, ".blender/.Blanguages");
|
strcpy(name, ".blender/.Blanguages");
|
||||||
#endif
|
#endif
|
||||||
@@ -287,8 +298,8 @@ int read_languagefile(void) {
|
|||||||
strcpy(name, ".Blanguages");
|
strcpy(name, ".Blanguages");
|
||||||
lines= BLI_read_file_as_lines(name);
|
lines= BLI_read_file_as_lines(name);
|
||||||
if(lines == NULL) {
|
if(lines == NULL) {
|
||||||
error("File \".Blanguages\" not found");
|
error("File \".Blanguages\" not found");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user