![]() |
#1 |
Senior Member
Join Date: Apr 2009
Location: Bulgaria
Posts: 191
|
LibraryLocal deprecated
Hi!
Since I use the latest version of NSIS I get a lot of warnings that LibraryLocal is deprecated and !getdllversion should be used instead. All works as before, but these warnings are annoying and I want to fix them. I tried to find some information how LibraryLocal should be replaced by !getdllversions, but there is no enough information. !getdllversion is good described in the documentation of NSIS, but I can't find enough information for LibraryLocal. So my question is, can I get a short example how to replace one with the other? |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,333
|
LibraryLocal is a helper application that extracts version information from PE files. It is/was used by Library.nsh when you install/register certain COM, TLB or OCX files (Appendix B in the documentation).
Are you using Library.nsh? Do you have LIBRARY_USELIBRARYLOCALHELPER defined anywhere? Without it I don't think the latest NSIS 3 version will use LibraryLocal anywhere by default but you could be using a 3rd-party header that uses it perhaps? An outdated Library.nsh file could also cause this. IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Senior Member
Join Date: Apr 2009
Location: Bulgaria
Posts: 191
|
I'm using a macro InstallLib that uses internally another macro __InstallLib_Helper_GetVersion that calls LibraryLocal.exe. I use this macro to install DLLs. I found it long time ago and it always worked. To be honest, I even don't understand it. It looks quite complicated. Probably now this can be programmed much simpler, but I'm afraid to change my script that was good tested and with proven quality during the years. So is there an easy solution to replace only this call of LibraryLocal.exe inside of the macro __InstallLib_Helper_GetVersion?
|
![]() |
![]() |
![]() |
#4 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,333
|
Does your __InstallLib_Helper_GetVersion macro start with "!ifdef LIBRARY_USELIBRARYLOCALHELPER" ?
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#5 |
Senior Member
Join Date: Apr 2009
Location: Bulgaria
Posts: 191
|
No. Here is the macro:
PHP Code:
|
![]() |
![]() |
![]() |
#6 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,333
|
Then there is something wrong with your installation! Try re-installing v3. You have a new LibraryLocal.exe but a old Library.nsh somehow.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#7 |
Senior Member
Join Date: Apr 2009
Location: Bulgaria
Posts: 191
|
I reinstalled NSIS V3 (first uninstalled the existing version and checked that there is nothing left). But the result is the same. I also searched my HDD for Library.nsh, but the only file that was found is in Program Files/NSIS/Includes.
|
![]() |
![]() |
![]() |
#8 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,333
|
I don't know what to tell you, both LibraryLocal.exe and Library.nsh changed in SVN r6913 and NSIS v3.03 was released some time after that change.
Just looking at nsis-3.03-setup.exe that I just downloaded in 7-zip I can confirm that it contains the correct Library.nsh. IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#9 |
Senior Member
Join Date: Apr 2009
Location: Bulgaria
Posts: 191
|
Hi Anders!
Actually you said enough according to the information that I provided to you. I found the problem. The answer is somewhere in this discussion, but unfortunately I couldn't figure it out immediately. Many years ago (>10 years) I made a small extension in the InstallLib macro. It was required to update DLLs with the same version that are already installed. Therefore I modified the script and added a define LIBRARY_VERSION_UPDATEWHENEQUAL that enables this behavior. I copied all the code of the InstallLib macro in my own file and I stopped using Library.nsh to avoid problems with the new versions. Then I completely forgot for this... until now... So it is exactly as you said - I'm using an old version of Library.nsh (not directly, but a code from it). I tried to use again the original Library.nsh and there are no more warnings. But the question now is - can I install DLLs with the same version without my modifications? If I can do this, I will remove my own code and I will not have such problems in the future. |
![]() |
![]() |
![]() |
#10 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,333
|
Why would it ever make sense to update when the version has not changed? Do you not trust the version number? Or is it because you want to force re-registration?
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#11 |
Senior Member
Join Date: Apr 2009
Location: Bulgaria
Posts: 191
|
During the development, my colleagues don't change the version of the dlls on every commit, but just when they decide that there is something new in principle. Meantime, when we build the installation (automatically via build server) some newer dlls are not installed, because the version is not changed (but they are actually newer). Of course, this leads to problems with the software after the installation, therefore I got a requirement to reinstall also the dlls with the same versions. It was not my decision.
|
![]() |
![]() |
![]() |
#12 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,333
|
I don't have time to deal with this right now but I would probably accept a simple patch, here or on the SF tracker.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#13 |
Senior Member
Join Date: Apr 2009
Location: Bulgaria
Posts: 191
|
I don't know if my patch is completely correct, but it worked so many years (probably not tested in any conditions). I made it in macro InstallLib. The original code is:
PHP Code:
PHP Code:
|
![]() |
![]() |
![]() |
#14 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,333
|
That does not seem correct to me, the version is a 64-bit number and you are only checking 32 of them in a different way.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#15 |
Senior Member
Join Date: Apr 2009
Location: Bulgaria
Posts: 191
|
Yes, you are right. As I said, I solved my problem many years ago. Still works for my needs. But I prefer an universal solution and I want to discard my special fix.
|
![]() |
![]() |
![]() |
#16 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,333
|
Try this. (Removed attachment, it's included in v3.04 now).
I named the option define LIBRARY_INSTALL_EQUAL_VERSION IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#17 |
Senior Member
Join Date: Apr 2009
Location: Bulgaria
Posts: 191
|
It looks that it works as it is expected, but I made some very fast tests. I completely removed my specific version of InstallLib and not I use the new Library.nsh file in all my installers. Soon or later the installers will be tested and I will report if I see problems.
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|