Although NSIS allows you to build quite powerful installers, the "so low level language that it reminds me of assembly" that NSIS uses is quite prone to making mistakes and therefore, when you want your installer to do something more complex other than writing files, debugging is a must.
Until now I've used the following Dr Printf-like debugging technique:
.nsh
file that I include everywhere, I define a NSIS_DEBUG_MSG
macro according to the value of a DEBUG
define
DEBUG
is on, the macro will trigger a MessageBox with the debug messageDEBUG
is off, the macro will do nothingThis method has served me well but it presents some disadvantages:
NSIS_DEBUG_MSG
and rebuild the installer several times until I get enough info to allow me to solve the problemSo what I wanted to know is what debugging methods do you use for these installers so that hopefully I can improve mine.
During my time using NSIS, there is these things noticeable:
I have found out that nothing is more powerful than parsing !verbose 3 level output with self-made tool ;)
I have found out that you can NOT depend on any NSIS-based debugging method. It may crash .. and your installer will crash along with it. No pretty, eh'? :(
I have found out that enabling/disabling debugging on-demand is also very powerful weapon against idsses as it allows to distinguish between unstable and failed NSIS build ( it is easier to use CI terminology though... :) ).
I have found out that verbose output w/o realtime automated NSIS testing is like driving Cadillac with bicycle engine :)
Hope it helps for those accidentally visiting this question :)
EDIT: It's always good idea to start with 3rd party tools. For example, no need to hassle around GUI as it is always easier to use tools like:
EDIT #2: I have found out that pretty effective method for debugging is to use direct documentation automatization. Currently I use the following components:
The result is that I got screenshot after nsDialog:Show
plus I got updated images in wiki :) .. only stuff left is to fetch info from svnlook
:)
EDIT #3: And the need of svnlook is also worked-around by building a svn log --xml exporting DLL using NSIS v2.44 header for Delphi and Lazarus IDE 0.9.30.2 :) Kudos to Lazarus!
Woohoo! :)
EDIT #4: Hit this small discussion here: http://forums.winamp.com/showthread.php?t=325521
What have saved me much time is to use the logs that are created by NSIS. Both the log while compiling the scripts, and the installation log. They allows me to check that the macros I have defined is in use, and that the installation actually run the scrips they should.
It might seem too little, but this is actually everything I need to keep my installation software of 50+ nsh files running, along with the divide an conquer principle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With