Skip to content
⌘ NSIS Forum Archive

Removed CompareDLLVersions ?

14 posts

Joost Verburg#

Removed CompareDLLVersions ?

Why is CompareDLLVersions removed in NSIS 1.6? I need it for my installers 😠 Is there other function I can use?

Thanx.
Joost
Hando#
Other DLL function (from the version history):
Removed CompareDLLVersions, CompareFileTimes, added GetDLLVersion, GetFileTime, GetDLLVersionLocal, GetFileTimeLocal, and IntCmpU.
F. Heidenreich#
You could use GetDLLVersion and GetDLLVersionLocal instead of CompareDLLVersions

See UpgradeDLL in functions.htm for an example.

~ Florian
Joost Verburg#
Thanks.

So i should use something like: If GetDLLLocalVersion(DLLName) > GetDLLVersion(DLLName) then CopyNewDLL ?

I'm new to the NSIS system, so i'll have to find out how I can do this is the NSIS language 😁
F. Heidenreich#
I think you could use it in this way:


ClearErrors
GetDLLVersionLocal "test.dll" $0 $1
GetDLLVersion "$SYSDIR\test.dll" $2 $3
IfErrors upgrade_dll
IntCmpU $0 $2 noupgradedll noupgrade_dll upgrade_dll
IntCmpU $1 $3 noupgrade_dll noupgrade_dll
upgrade_dll:
UnRegDLL "$SYSDIR\test.dll"
File /oname="$SYSDIR\test.dll" "test.dll"
RegDLL "$SYSDIR\test.dll"
noupgrade_dll:
~ Florian
Joost Verburg#
I just wrote some code similar to your code, with some reboot stuff included. But, I only compare $0 and $2, and it seems to work. Should I also compare $1 and $3 ?
Joost Verburg#
Strange, I've done some testing and now I'm using your code, but it always detects that the integers are equal, but they are not 🙁
Joost Verburg#
Problem solved 😉

I'll have to compare only the large integers, because only the build numbers are different.

IntCmpU $1 $3 noupgradedll noupgrade_dll upgrade_dll


Now the next problem 😁

How can I register a DLL on reboot ??
F. Heidenreich#
Hi Joost,

I don't know how to register a DLL on reboot, but you could use the RegDLL command to register your DLL immediately.

~ Florian
Joost Verburg#
That's true. When the DLL is not in use, I register it with RegDLL, but when the DLL is in use, it should be done after the new DLL is install (on reboot).
F. Heidenreich#
Only an idea 😉:

Try to write an entry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce to make a call to regsvr32.exe yourdll.dll.

~ Florian
Joost Verburg#
Good idea 😁

I have to find out how to make this 'silent'. And, is this being called AFTER the NSIS 'Rename on reboot'?

I'll check where NSIS puts the 'Rename on reboot' stuff 🙂
Joost Verburg#
In Win2000: It it stored in a PendingRenameOperations key.

Maybe I should write a piece of code that checks which one is called first.
Joost Verburg#
For the solution:
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.