File.Copy() access denied from msi custom action

  • Thread starter Thread starter Narshe
  • Start date Start date
N

Narshe

I have a custom action for my msi installer where you select a
directory, and some files get copied to that directory. I'm using
System.IO.File.Copy() to copy them. If the files are already there,
they are supposed to get overwritten, but I'm getting an access denied
error.

The files that are currently there have RA permissions. If i remove the
read-only permission, the installer works fine.

How can I get my msi installer to overwrite the files, and not get a
permission error?
 
Narshe,

Why not check the attributes of the file first? If the files are
read-only, then change the attributes so that they are not, and then copy
the files over.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top