views:

219

answers:

1

I'm creating several NSIS installers and as my expertise in this thing grows up I'm no longer happy with just making things work, I would like to see if there are some best practices or coding standards around this language, like how to write conditionals, variable names, unistallers, etc..

+2  A: 

As far as I know, there is no specific coding standard for NSIS available -- but there are a lot of tutorials and examples to learn from. As with every other language you're trying to master, I think reading other's code helps a lot and inspires you to think in different directions.

From my own experience with NSIS, I can also suggest to tidy up your installer scripts regularly. As you learn new things, old workarounds become obsolete and can be replaced by proper solutions. Also watch out for new developments. Before we were able to use nsDialogs, InstallOptions was the way to go when it came to user-defined dialogs -- and now it's so much easier to do with less code.

Since you're aiming at creating several installers, I'd also try to reuse as much code as possible in the different installers. Modularising shared functionality is possible with .nsh files and fosters a good and clean code base.

fhe
I liked your answer even being the only one I got, It is actually very good.
levhita
PD: I'am currently going out of tutorial-land, you now, that place where you start to code a little bit by yourself instead of just customizing someone else example. I actually had spotted some things that might be called best-practices, just nothing formally documented.
levhita
Thanks! I've looked around the NSIS forums and found a post where a user has posted his best practices: http://forums.winamp.com/showthread.php?threadid=246054
fhe