Adding DLL's to System Folder On Exe Startup
-
I have a VS.net C++ Project that requires certain DLL's exist on the users system to run. As part of the project I would like to detect the users OS and install the dll's in the required system folder(s) when the user starts up the application. Can I do this or should I just create an installation disk to handle it? :) Thanks. Jerry
-
I have a VS.net C++ Project that requires certain DLL's exist on the users system to run. As part of the project I would like to detect the users OS and install the dll's in the required system folder(s) when the user starts up the application. Can I do this or should I just create an installation disk to handle it? :) Thanks. Jerry
If you have statically linked your program to the dlls, then you will need an installation program I believe. If you are loading the dll files dynamically using LoadLibrary(...), then you can have the dll files in the exe as resources, and copy/install them onto the system if they are needed. this is this.
-
If you have statically linked your program to the dlls, then you will need an installation program I believe. If you are loading the dll files dynamically using LoadLibrary(...), then you can have the dll files in the exe as resources, and copy/install them onto the system if they are needed. this is this.
khan++ wrote: If you have statically linked your program to the dlls, then you will need an installation program I believe. No, you cannot link statically to dynamic link libraries. SLL's are compiled libraries that will be linked together with your program. It will make your executable larger... DLL's however are linked to at runtime. When you run your program, DLL's can be loaded at startup, on demand or manual. This requires extra files (DLLs) to be shipped with your product. Behind every great black man... ... is the police. - Conspiracy brother Blog[^]
-
I have a VS.net C++ Project that requires certain DLL's exist on the users system to run. As part of the project I would like to detect the users OS and install the dll's in the required system folder(s) when the user starts up the application. Can I do this or should I just create an installation disk to handle it? :) Thanks. Jerry
Hello, Why would you wan't to place the DLL's in the system folder? Most people hate it when 3rd party libraries are placed in those folders.. Anyway, I think that it is better to make an installation disk and do some checks when the DLL's are needed. Don't install the DLL's when you detect an error, but inform the user and let him take appropriate actions. Make sure that you have the DLL's ready on your installation disk, so the user can copy them when he / she needs them. Behind every great black man... ... is the police. - Conspiracy brother Blog[^]
-
khan++ wrote: If you have statically linked your program to the dlls, then you will need an installation program I believe. No, you cannot link statically to dynamic link libraries. SLL's are compiled libraries that will be linked together with your program. It will make your executable larger... DLL's however are linked to at runtime. When you run your program, DLL's can be loaded at startup, on demand or manual. This requires extra files (DLLs) to be shipped with your product. Behind every great black man... ... is the police. - Conspiracy brother Blog[^]
-
khan++ wrote: If you have statically linked your program to the dlls, then you will need an installation program I believe. No, you cannot link statically to dynamic link libraries. SLL's are compiled libraries that will be linked together with your program. It will make your executable larger... DLL's however are linked to at runtime. When you run your program, DLL's can be loaded at startup, on demand or manual. This requires extra files (DLLs) to be shipped with your product. Behind every great black man... ... is the police. - Conspiracy brother Blog[^]
He probably should have said 'implicitly' linked to the DLL. Static Linkage - Traditional LIB files - MAkes EXE larger. Implicit Linkage - DLL Files - Exe not necessarily larger, but won't run if DLL cna not be found and loaded. Dynamic Linkage - DLL Files - Your EXE does LoadLibrary and GetProcAddress to load the DLL and call functions. With this method, your own EXE could possibly deploy DLL.
-
Hello, Why would you wan't to place the DLL's in the system folder? Most people hate it when 3rd party libraries are placed in those folders.. Anyway, I think that it is better to make an installation disk and do some checks when the DLL's are needed. Don't install the DLL's when you detect an error, but inform the user and let him take appropriate actions. Make sure that you have the DLL's ready on your installation disk, so the user can copy them when he / she needs them. Behind every great black man... ... is the police. - Conspiracy brother Blog[^]
Also, the OS hates it. The OS might hate it so much, that the user running the program will not even have access rights to copy files to the system folder! That is a lot of hate :~ You could put the folders into a location ALL users have access to and then investigate "App Paths" registry entries for your EXE(s) to set up that folder as a location where DLL will be searched for loading.
-
Also, the OS hates it. The OS might hate it so much, that the user running the program will not even have access rights to copy files to the system folder! That is a lot of hate :~ You could put the folders into a location ALL users have access to and then investigate "App Paths" registry entries for your EXE(s) to set up that folder as a location where DLL will be searched for loading.
I think that developers should keep the DLL's in the application folder. I really hate to see one application have different folders in multiple system folders. IMHO one should set a registry key for a DLL that is installed and applications should check that DLL before installing, etc., etc.. This way, the files are manageble by the user. Also this technique allows different versions of DLL's with the same name to exist on the same system, thus avoiding DLL hell! Behind every great black man... ... is the police. - Conspiracy brother Blog[^]