[CMake] CPACK + NSIS: Can I install some files in a seperate (non-system) file tree or change directory permissions?

Leek, Jim leek2 at llnl.gov
Mon Jun 17 09:47:45 EDT 2013


I have another problem with my CPack installer for windows.

I want to install a couple of test input files for my program.  However, I need my program to be able to write into the same directory as that of the input files.  Since this directory is in a system directory (Program Files (x86)), on Windows 7, the files actually get written to the Virtual Store.  Which isn't horrible, but it makes it hard on the users running the script.  Is there some way for me to either: A) Install these examples into a non-system directory, or B) change the permissions to world writable on the Examples directory?


A)     I tried:
install(FILES psuadeForWin.in DESTINATION c:/myLibFiles/Examples/MOO)
But that complained: ABSOLUTE path INSTALL DESTINATION forbidden (by caller):
I tried setting:
set (CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION OFF)

set (CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION OFF)
But they didn't seem to have any effect.


B)     Then I tried this to change the permissions:

install (DIRECTORY "Examples" DESTINATION "." DIRECTORY_PERMISSIONS
OWNER_WRITE OWNER_READ OWNER_EXECUTE
GROUP_WRITE GROUP_READ GROUP_EXECUTE
WORLD_WRITE WORLD_READ WORLD_EXECUTE)

But that had no effect on Windows.



For those who care, a little more detail on why I need this functionality:
This program was not written by me, but I need to get a beta release out the door ASAP, so I don't have time fix much.
This program runs from the command line (it was written on Unix).  You run like this:
myProg inputFile.in
myProg then automatically runs a bunch of simulator program runs.  It needs a path to the simulator, and for new user purposes, it's easiest to have the simulator in the same Examples directory as the input file.
myProg then generates a file called myProgData in the current working directory
then you must rename myProgData to something else.  Say, fooData
then you can run:
myProg
> load fooData
> Do some computations

The rename step is the problem here.  The virtual store is transparent to myProg, but calling rename from the command line doesn't seem to work without a full absolute path into the Virtual Store.  If there's a better way to do the renaming, I can also avoid the above issues.  My only other idea is to have some sort of renaming script for which the virtual store is also transparent.

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


More information about the CMake mailing list