cpeel2300
11th December 2006 15:54 UTC
InstallLib problem/query/issue
Hi all - long time NSIS user, first time poster...
I have query regarding the InstallLib macro which is causing me some problems. I have an installer which simply copies and registers a number of ActiveX DLLs, TLBs and various other bits and pieces.
Everything works fine if no applications have any of the DLLs locked, however things seem to go wrong if even one of the DLLs is in use. I've only just noticed this as I've just put together version 3.0 of the installer and new DLLs which can't already be on the user's PC were being copied but weren't being registered.
I'm no NSIS guru so taking a look at Library.nsh didn't really help but it seems that the macro simply adds _all_ files to the NSIS.Library.RegTool.v2 registry key once any one of them fails.
Is this by design? It's causing me a lot of problems as I'm happy for the user to have to reboot if DLL's A, B and C are already installed and in use but it's frustrating to make them reboot when new DLLs X and Y are installed and can't have already been in use.
Would really appreciate some help on this one!
Thanks in advance
Chris
kichik
12th December 2006 18:37 UTC
It's by design, in case the DLL files depend on each other. If B depends on A but A is to be replaced at reboot, B might fail registering due to the old version of A. So, when the reboot flag is set, which means some DLL should be replaced at reboot, the Library macros set all DLL files to be registered at reboot.
cpeel2300
13th December 2006 18:05 UTC
Thanks for the reply!
Is there any way to avoid this? I appreciate it's a bit unusual but it would really help me out. I'm no good as NSIS macro programming but am happy to give it a try if someone can point me in the right direction.
kichik
14th December 2006 19:47 UTC
You can remove the IfReboot check in Library.nsh. You were able to understand what happens there, changing it is just one small step forward.
cpeel2300
15th December 2006 10:06 UTC
Thanks - will take a look at the macro and see how I get on :)
onad
15th December 2006 12:54 UTC
For some DLL's to unload it is an option to kill explorer shell, uninstall the DLL and restart the explorer shell again, tricky but possible. No reboot needed for install of some ActiveX dll's this way.
BuilderBob
25th August 2008 13:11 UTC
Hi people, I've just wasted 3 hours on this :). If the reboot flag is on for whatever reason, dll will be registered at startup. It messed up my manual "Rename->Delete renamed file on reboot->Copy new file and register" from my old thread.
I rename a busy dll and then delete it. This sets the reboot flag, so when I call InstallLib it will do it on reboot even if it doesn't have to.
Can you please document it? It was fun reading and adding debug messages inside Library.nsh, but I could have checked my facebook instead ;).