NSIS 2.44
Delete an in-use dll for example -> Reboot flag is set. Now call InstallLib. It will register the lib on reboot even if it could succeed now.
Script:
Delete /REBOOTOK UnrelatedLocked.dll
!insertmacro InstallLib REGDLL NOTSHARED REBOOT_NOTPROTECTED ".\MyFine.dll" "$OutDir\UnlockedDestination.dll" $TEMP
I suggest saving the flag, clearing it, execute InstallLib code, then setting it again if it was originally set, if possible.
That's because the next library you're installing might be dependent on the first installed library. As the first library will only be available upon reboot, there's no sense in registering the new library as it'd just use the old one and might even crash.