diff options
author | Mal Duffin <malachyduffin@gmail.com> | 2008-08-02 21:08:16 +0400 |
---|---|---|
committer | Mal Duffin <malachyduffin@gmail.com> | 2008-08-02 21:08:16 +0400 |
commit | 03f9c6a3fc5968a4bfeff159341d47bf3b24d766 (patch) | |
tree | 3d4dd64a916c6d5da040703a96f34b24af8d9fd1 /source | |
parent | 341655eab72d4e77da8b7de8c1108daf06809118 (diff) |
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 ).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/header_info.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c index 6e264590082..4e43819cb71 100644 --- a/source/blender/src/header_info.c +++ b/source/blender/src/header_info.c @@ -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 *****************************/ |