Archive: UpgradeDll sample script


UpgradeDll sample script
Trying to implement a method to install VB runtimes leads me to the UpgradeDll-, the AddSharedDll- and the un.RemovedSharedDll macros described in the NSIS documentation. Because I'm an bloody newbie describing the NSIS macros and functions alone couldnt help me that much.
I'm sure, that the best way to understand both, the use of those functions and the general handling of a nsis-script would be a sample.

I'am using NSIS 2.0b3 with the Modern GUI, so is there any sample script aviable which could teach me right from scratch how to implement the UpgradeDll-Macros in a NSIS-script?


http://nsis.sourceforge.net/archive/....php?pageid=47


First I want to thank Joost for his fast replay.

Perhaps I described my needs very bad above.
What I'm rather looking for is a whole! working sample script involving the UpdateDll Macros not only a part of a script. Something that starts with
!include "MUI.nsh" and ends with something like
!insertmacro 'MUI_UNFINISHHEADER' having the all the functionality of the Upgrade-Macros implemented between would be very nice.

All the examples for the Modern UI in the NSIS documentation written by Joost Verburg (i.E. 'Basic.nsi' or 'Language.nsi') are great examples of "whole" working scripts with the described functionality in it.

Has somebody such a sample concerning the UpgradeDll-functions for me?


To use the UpgradeDLL macro:

1) Copy the macro to a file called "UpgradeDLL.nsh" (keeping it in a separate file makes your script easier to read)
2) !insert "UpgradeDLL.nsh" ;Add to the top of your script
3) Now you can use the macro using !insertmacro UpgradeDLL "dllname.dll" "$SYSDIR\dllname.dll"

Btw, upgrade to the latest NSIS 2 version (unfinishheader doesn't exist anymore in the latest version :) ).


Thank you, Joost. Following your advices leads me to success.