Archive: Debug versions?


Debug versions?
Question about the source below. If you aren't into the source read-on.

Ok, I need an install with some customized functions. So I called them from my exe with ShellExecute, and was I though I was finshed. No problems yet.

My boss doesn't like the idea of "another" exe, so he insisted that I add some keywords execute my functions. Blah, blah. So I added them, and still no problem.

Now I want to debug my code and then the problems start.

First off the stuff wouldn't build at all until I took out
/entrypoint:"WinMain", and increased the compilier stack size with /Zm500.

Now that I got it to build, I couldn't execute the debug version of my install because VSS thad it didn't have the symbols. I assumed that it was because stuff (headers, data, and other stuff) is tacked on the end of the .exe. So I put that carp into a seperate file, and have exehead look on the seperate file, instead on the end of itself.

So with a bit of hacking I can now debug the install.

Now I want to do the same with the uninstall, but before I wonder/wander into the code again, I wanted to see if others have ventured this deep into the code.

Is this a lost cause?
Is there an easier way?

The easier question is how do I create an uninstall file with a debug exehead. I see that they are almost the same, but not quite. What functions should I start looking at.

Tony Stratton


You could just debug your code in a seperate exe file if that is appropriate (e.g. you dont need to use some function of NSIS). I think you may be mistaken about the uninstall exe header though, it is the same except it has the uninstall icon.. run a file comparer and I think you will find (as I did)..
changes occur in the range 862Ch through 88FEh, which incidentally falls in the primary icon reosurce.
Failing that just browse through the source to see what happens (try searching for NSIS_CONFIG_UNINSTALL_SUPPORT, the main uninstaller generation is in ui.c, begins line 822, allocs mem for exe header, reads from orig. installer exe after getting pointer to string for name of exe in string table, if the there is an uninstall icon specified then expand and copy to specified offset in new exe uninstall file etc etc etc) ..