Copies all required DLLS for Save Game as Runtime.
Under Windows, all DLLs are copied to the same folder as the runtime .EXE, so that the process becomes a single click and deploy solution. Linux doesn't require this ( thx for info centralnoise ) and will update to work on OS/X after I do a bit of research on .a and .so files ( thx for info kaito ).
This commit is contained in:
parent
341655eab7
commit
03f9c6a3fc
@ -540,6 +540,40 @@ static void check_packAll()
|
||||
}
|
||||
}
|
||||
|
||||
static void copy_game_dll(char *dll_filename, char *source_dir, char *dest_dir)
|
||||
{
|
||||
char source_filename[FILE_MAX];
|
||||
char dest_filename[FILE_MAX];
|
||||
|
||||
strcpy( source_filename, source_dir );
|
||||
strcat( source_filename, dll_filename );
|
||||
|
||||
strcpy( dest_filename, dest_dir );
|
||||
strcat( dest_filename, dll_filename );
|
||||
|
||||
if(!BLI_exists(dest_filename)) {
|
||||
BLI_copy_fileops( source_filename, dest_filename );
|
||||
}
|
||||
}
|
||||
|
||||
static void copy_all_game_dlls(char *str)
|
||||
{
|
||||
#define GAME_DLL_COUNT 7
|
||||
char *game_dll_list[GAME_DLL_COUNT]={"gnu_gettext.dll", "libpng.dll", "libtiff.dll", "pthreadVC2.dll", "python25.dll", "SDL.dll", "zlib.dll"};
|
||||
|
||||
char dest_dir[FILE_MAX];
|
||||
char source_dir[FILE_MAX];
|
||||
int i;
|
||||
|
||||
strcpy(source_dir, get_install_dir());
|
||||
strcat(source_dir, "\\");
|
||||
BLI_split_dirfile_basic(str, dest_dir, NULL);
|
||||
|
||||
for (i= 0; i< GAME_DLL_COUNT; i++) {
|
||||
copy_game_dll(game_dll_list[i], source_dir, dest_dir );
|
||||
};
|
||||
}
|
||||
|
||||
static int write_runtime(char *str, char *exename)
|
||||
{
|
||||
char *freestr= NULL;
|
||||
@ -587,7 +621,14 @@ static void write_runtime_check(char *str)
|
||||
#endif
|
||||
|
||||
write_runtime(str, player);
|
||||
|
||||
#ifdef _WIN32
|
||||
// get a list of the .DLLs in the Blender folder and copy all of these to the destination folder if they don't exist
|
||||
copy_all_game_dlls(str);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* end keyed functions */
|
||||
|
||||
/************************** MAIN MENU *****************************/
|
||||
|
Loading…
Reference in New Issue
Block a user