- Returned multi-user support on Win2k/XP.

Now uses 'Application Data/Blender Foundation/Blender' instead of old
  "Not A Number" dir.

- Updated windows installer to make this change transparent for the
  users. It copies /.blender to the new location and displays a short
  message to advise them of the change
  (http://homepages.nildram.co.uk/~aphex/installer_msg.jpg).

- Installer also includes fix for opening blend files from explorer (patch provided by Valentin Ungureanu (vung) - thanks!)

Note to CVS users on Win2k/XP:  Although blender will continue to work
without changes, you should ideally copy the /.blender dir to
<app data>/Blender Foundation/Blender for the sake of correctness :)
This commit is contained in:
Simon Clitherow
2004-04-20 19:12:48 +00:00
parent d694335cc2
commit 255cd235a3
7 changed files with 242 additions and 111 deletions

View File

@@ -497,11 +497,19 @@ char *BLI_gethome(void) {
if(ret) {
if (BLI_exists(ret)) return ret;
}
/*
"change-over" period - blender still checks in
old locations, but Ctrl+U now saves in ~/.blender
*/
/* add user profile support for WIN 2K / NT */
ret = getenv("USERPROFILE");
if (ret) {
if (BLI_exists(ret)) { /* from fop, also below... */
sprintf(dir, "%s/Application Data/Blender Foundation/Blender", ret);
BLI_recurdir_fileops(dir);
if (BLI_exists(dir)) {
strcat(dir,"/.blender");
if(BLI_exists(dir)) return(dir);
}
}
}
BLI_getInstallationDir(dir);
@@ -511,26 +519,6 @@ char *BLI_gethome(void) {
if (BLI_exists(dir)) return(dir);
}
/*
everything below this point to be removed -
blender should use the same %HOME% across
all versions of Windows... (aphex)
*/
/* add user profile support for WIN 2K / NT */
ret = getenv("USERPROFILE");
if (ret) {
if (BLI_exists(ret)) { /* from fop, also below... */
sprintf(dir, "%s/Application Data/Not a Number/Blender", ret);
BLI_recurdir_fileops(dir);
if (BLI_exists(dir)) {
return(dir);
} else {
return(ret);
}
}
}
/*
Saving in the Windows dir is less than desirable.
Use as a last resort ONLY! (aphex)

View File

@@ -1493,16 +1493,7 @@ int BLO_write_file(char *dir, int write_flags, char **error_r)
return 0;
}
#if 0
BLI_getInstallationDir(tmpdir);
if(BLI_exists(tmpdir))
strcat(tmpdir,"/.blender/");
BLI_make_file_string(G.sce, userfilename, tmpdir, ".B.blend");
#else
BLI_make_file_string(G.sce, userfilename, BLI_gethome(), ".B.blend");
#endif
write_user_block= BLI_streq(dir, userfilename);

View File

@@ -118,9 +118,7 @@ FTF_TTFont::FTF_TTFont(void)
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");
BLI_make_file_string("/", messagepath, BLI_gethome(), "/locale");
if(BLI_exist(messagepath) == NULL) {
#endif
#ifdef __APPLE__

View File

@@ -210,6 +210,17 @@ void start_interface_font(void) {
if(!result) { // else try loading font from current dir
result = FTF_SetFont(U.fontname, U.fontsize);
}
// try home dir (special case for .bfont.ttf) (aphex)
if(!result) {
strcpy(tstr, BLI_gethome());
if (strstr(tstr,".blender") == 0) {
strcat(tstr,".blender/");
}
strcat(tstr, U.fontname);
result = FTF_SetFont(tstr, U.fontsize);
}
} else {
U.language= 0;
U.fontsize= 11;
@@ -226,13 +237,14 @@ void start_interface_font(void) {
strncpy(U.fontname, tstr, 255);
#elif defined (WIN32)
BLI_getInstallationDir(tstr);
strcat(tstr, "/.blender/.bfont.ttf\0");
strcat(tstr, BLI_gethome());
strcat(tstr, "/.bfont.ttf\0");
printf("path: %s\n", tstr);
result = FTF_SetFont(tstr, U.fontsize);
sprintf(U.fontname, ".blender/.bfont.ttf\0");
sprintf(U.fontname, "/.bfont.ttf\0");
#else
sprintf(U.fontname, ".blender/.bfont.ttf\0");
sprintf(U.fontname, "/.bfont.ttf\0");
result = FTF_SetFont(U.fontname, U.fontsize);
#endif
@@ -331,11 +343,8 @@ int read_languagefile(void) {
strcat(name, "/Contents/Resources/.Blanguages");
#elif defined (WIN32)
/* Check the installation dir in Windows */
result = BLI_getInstallationDir(name);
if (!result)
strcpy(name,"/.blender/.Blanguages");
else
strcat(name,"/.blender/.Blanguages");
strcat(name, BLI_gethome());
strcpy(name,"/.Blanguages");
#else
strcpy(name, ".blender/.Blanguages");
#endif

View File

@@ -419,23 +419,9 @@ void BIF_write_homefile(void)
char *err, tstr[FILE_MAXDIR+FILE_MAXFILE];
int write_flags;
/* "change-over" period for Windows - Ctrl+U now saves in ~/.blender,
but blender still checks the old locations.
To be removed at v2.4 or so! ;)
*/
#if 0
char dir[FILE_MAXDIR+FILE_MAXFILE];
BLI_getInstallationDir(dir);
strcat(dir,"/.blender/");
BLI_make_file_string("/", tstr, dir, ".B.blend");
#else
BLI_make_file_string("/", tstr, BLI_gethome(), ".B.blend");
#endif
/* force save as regular blend file */
/* force save as regular blend file */
write_flags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_LOCK | G_FILE_SIGN);
BLO_write_file(tstr, write_flags, &err);
}