473,587 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4240
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.co m

"Narshe" <na****@gmail.c om> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.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
5447
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. I want to develop a webpage where people can send attachments that are stored on their local PC.
0
2639
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 Denied 401.2 and I have a Custom Error Page for this.
3
15979
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 - http://www.codeproject.com/useritems/ZetaImpersonator.asp 2. Using WebRequest object to write the file to the destination domain -...
2
3759
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 it on the web server but not from a client. Here is the code: Dim impersonationContext As System.Security.Principal.WindowsImpersonationContext...
2
3777
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 same time. It says Access Denied. I am using File.Copy ( Source , Destination , true ) command in my code, where Source : the current...
3
4042
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 same time. It says Access Denied. I am using File.Copy ( Source , Destination , true ) command in my code, where Source : the current...
1
4465
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 input elements in a form. I'm trying to just hide all the form input elements
4
4331
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. thanks, --thelma
6
4114
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" size="50"> I have the import button on which I have used onClick event to call javascript function submitValues() used to validate all the fields...
0
7843
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7967
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6621
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5713
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.