NSIS installers and Windows Vista

Ever seen this dialog?  The dreaded “This program might not have installed correctly” message.

If you’ve built an NSIS installer and tried it on Vista you probably have.  This error seems to be shown whenever you run an installer that doesn’t have requestedPrivileges node in it’s manifest.  While the installs don’t seem to suffer the uninstaller definitely does suffer and does not correctly manage to remove the links from the start menu unless you run it from the Control Panel->Add/Remove Programs option.

The way to avoid it is to make sure you specify the priviledge that you want.  This is really easily done with a simple RequestExecutionLevel directive in your installer file.  You either want highest or admin for something that is expected to deal with the start menu or program files.  I’m still not sure which is the best because highest is something that is generally not recommend.  Having said that I’m not entirely sure I want my program to fail to install because the user isn’t an administrator.

The NSIS help file is a little misleading on this point.  It does state the technical differences but suggests that none and admin are equally valid.  I’d rather it suggested that admin was the better option.

Raymond answered the question I was just thinking

In a rather convenient post Raymond has answered the question I was just thinking, how do I add hotkeys for items where I don’t want to display a label.  Adding a label with an accellerator before a control in the tab sequence is a really useful way to add quick navigation to a form but sometime you just don’t want the label.  I had been thinking of something along the lines of a label that I didn’t display but I just hadn’t had the thought of hiding it!