Archive: a common nsis function script...


Hi there,

With the arrival of variables and functions, I started this thing that I call "Common NSIS Functions".

It's a .nsi regrouping usefull functions that some might want in an installer. Rather than redoing it everytime, you simply call the function et voila.

That is very good for newbies too. One could just write down !include commonfunctions.nsi and use the functions he needs without bugging with hardcode.

Finaly, it can reduces the size of your installation by reusing functions more than one time in your installation. And unusued functions takes praticaly no space in your installation (take justin for that one)

e.g.
!include commonfunctions.nsi
blablabla

#Add File association
#$0 = extention
#$1 = application name
#$2 = command to execute
StrCpy $0 ".bdz"
StrCpy $1 "BDzReader
StrCpy $2 "$INSTDIR\BDz.exe \%1\"
AddFileAssociation

etc.

I post this here to have feedbacks and by any chance some people wanting to add functions in this .nsi that could become something really useful. (And give power to an eventual frontend to nsis that could offer more options via this commonfunctions.nsi)


peace


What I'm planning to do is simple: provide a wild range of functions to enlarge the power of nsis using is always changing and evoluting script system

What I have already done is nothing really fantastic, I started doing it last night: the "AddFileAssociation"and "RemoveFileAssociation" functions were added.

What you can do? Discuss, write, optimise functions with me and the others (right now the others is a null variable ;) ... In fact crediting of each function will be in the commonfunctions.nsi ...
e.g.

#version: 0.1
#date: 00/00/00
#author: Mathieu Pellerin
Function AddFileAssociation
blabla
EndFunction

What would be interesting is to start a mailing list or use the nsis forum (though I think a mailing list would be the best) and do brainstorming of functions that could be written, submition of functions, update of functions, optimisation of functions, etc. ... we could have daily "update" of commonfunctions.nsi and some weekly official update with functions tested and ->accepted<- by all the contributor of the project.

That's quite it for now, email me back if it sounds good :) I think it can become really good.

peace