[CMake] cpack issues

Andrea Crotti andrea.crotti.0 at gmail.com
Tue Feb 21 17:10:25 EST 2012


On 02/21/2012 06:25 PM, Eric Noulard wrote:
> 2012/2/21 Andrea Crotti<andrea.crotti.0 at gmail.com>:
>> I'm trying to finally create an installer for my project, with CPack and
>> NSIS.
>>
>> The project is really really simple, I just need to copy over a directory
>> somewhere.
>> And I did something like:
>>
>> get_filename_component(userprofile $ENV{USERPROFILE} REALPATH)
>>
>> install(
>>   DIRECTORY ${EGG_BUILD_DIRECTORY}
>>   DESTINATION ${userprofile}/${PROJECT_NAME}
>>   )
> Is "userprofile" an absolute path? (sorry I'm not working on Windows very often)
> if this is the case this will not work.
>
> DO NEVER install with absolute install path on Windows:
>     1) the installed pieces won't be put in the installer
>     2) the files/dirs/whatever MAY (if you have enough privilege) be
> installed on the machine
>         on which you are trying to build the package!!
>
> I think we should forcibly forbid absolute install path on
> windows...but that's another story.

I see, well I just wanted to get something running quickly to see if the 
packaging actually works.
Anyway my assumption was that $ENV{USERPROFILE} would be the userprofile 
directory on the machine
where I will run the installer, but I understand now why this is a very 
stupid assumption.

With the relative path I got an actual installer in the end, but I get 
another error when I try to run it
that I will investigate further tomorrow..
Thanks a lot for now.


More information about the CMake mailing list