473,394 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

File.Copy() access denied from msi custom action

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?

Nov 17 '05 #1
2 4235
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Narshe" <na****@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
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?

Nov 17 '05 #2
I actually tried this already. It won't let me change the attributes
either.

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
0
by: C | last post by:
Hi, I have an ASP.Net app. I use <authentication mode="Windows" /> to detect if a user has the rights to access certain pages. If they do not have access they get an error stating Access...
3
by: Divya | last post by:
Hello, I am trying to copy a file from one domain to another. I have the username and password of the destination domain. I tried a few approaches - 1. Using the Impersonator Class -...
2
by: Stephen Witter | last post by:
I had previously posted this on the security ng, but haven't had a hit so I was wondering if someone here would be willing to take a stab. I am trying to copy a file to a network drive. I can do...
2
by: Shailesh Gajare | last post by:
Hi All, I have creating an ASP.Net application with two web servers. I am uploading a file which is being uploaded on one of the server, I want to copy the uploaded file on the other server at the...
3
by: Shailesh Gajare | last post by:
Hi All, I have creating an ASP.Net application with two web servers. I am uploading a file which is being uploaded on one of the server, I want to copy the uploaded file on the other server at the...
1
by: Rob Mitchell | last post by:
(Sorry if this appears twice) Hi, I know this has probably been beaten to death but I was working with Class by Stickman -- http://www.the-stickman.com which uses DOM to create multiple file...
4
by: Thelma Lubkin | last post by:
I need to copy a file in a VBA module of an Access form, and I haven't been able to find out how to do it: just cp /Path1/file1 /Path2/file2 Please show me how to do this in VBA for Windows....
6
by: passionateforjava | last post by:
Hi All, I am using struts application wherein I need to import file for some purpose.I have used input type="file" for the same which goes like: <input type="file" id="uploadFile" name="uploadFile"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.