[CMake] CMake/CPack 2.8.4 - Windows - Can't package files as read-only?

Alan Garny alan.garny at dpag.ox.ac.uk
Sat Apr 30 13:54:48 EDT 2011


> > > Ok, I have just given it a try and... it's working fine. From there,
> > > I thought I would check the contents of the _CPack_Packages folder
> > > which is created when running my CMakeLists.txt file. That folder
> > > contains a
> > > win32 folder which itself contains both a ZIP and NSIS folder. Both
> > > of these folders eventually contain my read-only files with... the
> > > right permissions (i.e. read-only). However, these files, when
> > > unzipped/installed from the ZIP/NSIS files, don't have the right
> > > permissions (i.e. read-write rather than read-only), as previously
> > > mentioned. So, I get the feeling that the problem is with the
> > > ZIP/NSIS generation. In fact, I have had a quick look at the
> > > project.nsi file which got generated and I couldn't see anything
> > > that sets the permissions for my read-only files (something which
> > > should have been added, I believe -- at least, I had to do it for
> > > another project where I
> had to
> > create a .nsi file 'by hand').
> >
> > Ok thank you for this investigation.
> > This is worth a bug report, however if ZIP is working on Linux I do
> > not
> see why it
> > shouldn't work on Windows because it's created with the very same
> libarchive.
> 
> Sure, but as you know there are some differences between the two operating
> systems, especially when it comes to permissions. So, maybe the ZIP
library
> doesn't handle permissions properly on Windows...?
> 
> > For NSIS the story is different and as you noted may be the generated
> > NSIS
> file
> > must be fixed in order to put appropriate permission.
> >
> > However as far as I know CPack generator do not handle file
> > permissions themselves, they do rely on what they find the
> > _CPack_Packages/ specific subdirs. So if the permission are properly
> > set in there they should be
> preserved
> > by the CPack generator.
> 
> As mentioned last time, the permissions are properly set for my files
under
> _CPack_Packages\win32\NSIS and _CPack_Packages\win32\ZIP, so for me the
> problem is related to the NSIS script and the ZIP library themselves.
> Anyway, I am going to create a bug report sometime today or tomorrow, with
a
> CMake/CPack file that can reproduce the problem.

Just for reference, I have created a bug report for the above:
http://public.kitware.com/Bug/view.php?id=12142.

Alan



More information about the CMake mailing list