title: Methods for debugging NSIS installers?
body: <p>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.</p>
  
  <p>Until now I've used the following <em>Dr Printf</em>-like debugging technique:</p>
  
  <ul>
  <li>In a <code>.nsh</code> file that I include everywhere, I define a <code>NSIS_DEBUG_MSG</code> macro according to the value of a <code>DEBUG</code> define
  
  <ul>
  <li>if <code>DEBUG</code> is <em>on</em>, the macro will trigger a <em>MessageBox</em> with the debug message</li>
  <li>if <code>DEBUG</code> is <em>off</em>, the macro will do nothing</li>
  </ul></li>
  </ul>
  
  <p>This method has served me well but it presents some disadvantages:</p>
  
  <ul>
  <li>it requires me to fill the code that I feel it's the one failing with calls to <code>NSIS_DEBUG_MSG</code> and rebuild the installer several times until I get enough info to allow me to solve the problem</li>
  <li>it will do me no good if my problem is that the installer itself fails (if the installer program dies)</li>
  </ul>
  
  <p>So what I wanted to know is what debugging methods do you use for these installers so that hopefully I can improve mine.</p>