views:

472

answers:

1

Hi All,

The setup of my Windows Mobile app is created using VS2008. It contains a couple of data files to be copied to the target device.

These files are readonly on the dev machine (because they are under source control). The setup preserves the readonly attribute, which is a problem in this case.

How can I tell the setup project to discard the readonly attribute of those files on the target machine?

TIA,

+1  A: 

You have to remove it before packaging. CABWIZ simply puts the file, as it (attributes and all) into the CAB. The INF format doesn't have any provision for the read-only attribute (or any attribute for that matter) only the behavior for the copy (overwrite, write if it doesn't exist, etc).

You can add a pre-build step and use it to launch a custom app (or batch file) to change the attribute before packaging (and a post-build to restore it if desired).

ctacke
Chris, thanks! A pre-build step for a setup project? Can this be done in VS? I suppose I'd have to create a macro that executes this step then compiles the project. Right?
Serge - appTranslator
I'd use the msbuild steps your solution is already using, just add a target to get it to change the stuff pre-build.
ctacke