[CMake] Using Cpack and NSIS to create installers for UAC-controlled directories under Windows Vista

Linebarger, John jmlineb at sandia.gov
Sun Jul 12 16:22:11 EDT 2009


Hello!  I have a customer who is running 64-bit Windows Vista Ultimate SP2, and wants installers for 64-bit ParaView and OverView-branded applications.  I am able to use NSIS to successfully build installers for 64-bit Windows Vista executables (although the installer itself is a 32-bit application because NSIS is 32-bit).

However, I'm running into strange behavior actually installing the application under Vista, evidently due to UAC (User Access Controls).  I can install it into C:\Program Files or C:\Program Files (x86), but when I try to run the application, it crashes with a null pointer exception.  But when I install it into another directory, one that is not protected by UAC (like D:\Program Files or D:\Program Files (x86)), all is well--the application executes normally.  My guess is that the application is trying to write something relative to the install directory, and crashes because UAC is preventing it.

In addition, when I try to build the install target for my executable in Visual Studio, it errors when I try to install it to a UAC-controlled directory, but does not error when I try to install it to a non-UAC-controlled directory.

What facilities exist in CMake/Cpack/NSIS to tame the UAC beast under Vista?  I'd like for everything to "just work" exactly like it does under 32-bit Windows XP.  My guess is that there may be two levels of issues here--one that grants privileges that UAC respects at install time, and the other that grants such privileges at run time.

Thanks!  Enjoy!

John M. Linebarger


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090712/dc4f0075/attachment.htm>


More information about the CMake mailing list