Hi,
1. reboot problem
2. register queue
ad 1.: in short: I couldn't reproduce the problem and you seem to be right.
I have a log file from a customer and I spoke him on phone. The log showed that msvbvm60.dll could not be installed. The nsis line is:
!insertmacro InstallLib REGDLL NOTSHARED REBOOT_PROTECTED \
"${VBFILESDIR}\Msvbvm60.dll" "$SYSDIR\Msvbvm60.dll" $SYSDIR
(Don't worry about the NOTSHARED -- I increment the dll counter myself for some reason.)
The log said:
IfFileExists: file "C:\WINDOWS\system32\Msvbvm60.dll" exists, jumping 0
Call: 521
File: overwriteflag=2, allowskipfilesflag=0, name="C:\WINDOWS\system32\Msvbvm60.dll"
File: skipped: "C:\WINDOWS\system32\Msvbvm60.dll" (overwriteflag=2)
Call: 521
File: overwriteflag=2, allowskipfilesflag=0, name="C:\WINDOWS\system32\nsp7.tmp"
File: wrote 1386496 to "C:\WINDOWS\system32\nsp7.tmp"
Rename: C:\WINDOWS\system32\nsp7.tmp->C:\WINDOWS\system32\Msvbvm60.dll
Rename on reboot: C:\WINDOWS\system32\nsp7.tmp->C:\WINDOWS\system32\Msvbvm60.dll
IfFileExists: file "" does not exist, jumping 0
File: overwriteflag=2, allowskipfilesflag=0, name="C:\WINDOWS\system32\NSIS.Library.RegTool.exe"
File: wrote 19451 to "C:\WINDOWS\system32\NSIS.Library.RegTool.exe"
WriteRegStr: set -2147483646\Software\Microsoft\Windows\CurrentVersion\RunOnce\NSIS.Library.RegTool to "C:\WINDOWS\system32\NSIS.Library.RegTool.exe"
WriteRegStr: set -2147483646\Software\NSIS.Library.RegTool\C:\WINDOWS\system32\Msvbvm60.dll to D
This occured in endless loop because the installer automatically started after Reboot. The customer could gave me some information:
i) He had Outlook and some other background software running (some systray icons).
ii) His msvbvm60.dll was outdated. It had an older date and the version number was lower than the one within the installer.
iii) His msvbvm60.dll had the ReadOnly flag (after calling the installer which produced the log above!)
He killed Outlook and he removed the ReadOnly flag manually. Then he executed the installer again and it worked without rebooting. I can't exactly say what he did or what really solved the problem.
I tried to reproduce this but as you said the Readonly attribute gets removed before Reboot (if file in use). If file is not in use it gets overwritten regardless of Readonly state.
Very strange.
ad 2. Queuing regdll:
It is not enough to make InstallLib/LibTool stable regarding the queue order. Think about my initial setup:
dllA
dllB (registering this requires a registered and installed dllA)
if dllA cannot be copied it is scheduled for replace after reboot, but the installer continues with dllB. It copies dllB but RegDll will fail because dllA is not copied/registered. But RegDll won't be called after reboot for dllB, so dllA is correctly installed after reboot but dllB never gets installed correctly. The nsis/InstallLib way of installing COM-Dlls which are possibly in use does not work with COM-Dlls which have such dependencies. Unfortunately this is the case for most ActiveX controls as they depend on ole32/oleaut32 which may be outdated on older systems (win98). I thought about building another little "RegDll subinstaller" which I will package into the installer and run after Reboot. But this does not work (queue problem, again) together with LibTool or other unqueued RunOnce actions. Conclusion/Suggestion: Make LibTool beware of the queue order and allow LibTool to be entered easily from outside InstallLib. I think an external macro should do this (!macro AddLibToolAction ...) and could be called by InstallLib macro as submacro and by the installer script itself.
Sorry, much text, hope it got clear..