Is there any NSIS Best Practices or Coding Standards around?
Asked Answered
W

1

6

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..

Wendy answered 22/10, 2008 at 23:36 Comment(1)
High-level overview nsis.sourceforge.io/Best_practicesMansard
U
3

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.

Ugrian answered 23/10, 2008 at 11:13 Comment(3)
I liked your answer even being the only one I got, It is actually very good.Wendy
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.Wendy
Thanks! I've looked around the NSIS forums and found a post where a user has posted his best practices: forums.winamp.com/showthread.php?threadid=246054Ugrian

© 2022 - 2024 — McMap. All rights reserved.