cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
SaintBernard
Level 4

How to Catch Access is denied Error

During my install I am copying an Adobe file *.joboptions
To C:\Documents and Settings\All Users\Application Data\Adobe\Adobe PDF\Settings

But the directory is set to Read Only.
The odd thing is I get the error message:

Feature: Adobe Acrobat 9.0
Component: Adobe Acrobat 9.0joboptions
File: C:\Documents and Settings\All Users\Application Data\Adobe\Adobe PDF\Settings\MYFILE.joboptions
Error: Access is denied

I get this message twice then the install exits but the funny thing is, that it manages to copy the file.

So do I:
1. Just try to catch this error?
2. Tell install in some way to ignore read only?
3. Set the directory attribute before copying then set it back?

And how do I do this?
Labels (1)
0 Kudos

(6) Replies
SaintBernard
Level 4

Wow I discovered the fix for

Feature: Adobe Acrobat 9.0
Component: Adobe Acrobat 9.0joboptions
File: C:\Documents and Settings\All Users\Application Data\Adobe\Adobe PDF\Settings\MYFILE.joboptions
Error: Access is denied

I had to set the "Potentially Locked property " to yes

I sure wish it had given a better error message.
0 Kudos
SaintBernard
Level 4

That did not fix the problem.

What I find is before it errors it has already copied the file.

Then it errors again.

So then I abort and reinstall and the file is already present and it installs
with out error.

I have not been able to --
1. Catch this error?
2. Tell install in some way to ignore read only?


The only fix I can think of is to Xcopy the file on my own.
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

Have you tried overriding the OnFileError and OnFileReadOnly events in your script? These events should allow you to catch access denied or other errors encountered during file transfer.
0 Kudos
SaintBernard
Level 4

Yes I have both OnFileError and OnFileReadOnly events overridden in my script, with MessageBox to let me know if they are hit. Nether get called.

I have the file set for potentially locked.

As I said the first install even though it gives me the
---------
Feature transfer error
Feature: Adobe Acrobat 9.0
Component: Adobe Acrobat 9.0joboptions
File: C:\Documents and Settings\All Users\Application Data\Adobe\Adobe PDF\Settings\MYFILE.joboptions
Error: Access is denied
------

twice. But it still copies the file. So the second time it installs fine.

My only solution I can think of is to simply copy the file with
CopyFile. I will try that to see if I get errors.
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

You may try using CopyFile or XCopyFile, but since these functions share code with the standard file transfer functionality, they may also encounter errors copying the file.

Is there any way you can provide a way to reproduce this behavior?
0 Kudos
SaintBernard
Level 4

joshstechnij wrote:
You may try using CopyFile or XCopyFile, but since these functions share code with the standard file transfer functionality, they may also encounter errors copying the file.

Is there any way you can provide a way to reproduce this behavior?


I used XCopyFile and even though it returned the error it copied the file.
This is what I was seeing with "Feature transfer", but I can ignore the error and complete the install. I was not happy with this.


Even though I have administrative rights. The directory "C:\Documents and Settings\All Users\Application Data\Adobe\Adobe PDF" is set to "Read & Execute" , "List Folder Contents" , and "Read". The "Write" is turned off.
The directory I am trying to write too is C:\Documents and Settings\All Users\Application Data\Adobe\Adobe PDF\Settings\

I don't know if this is why I am getting the false errors or why it copies anyhow.

So I had two options change the permissions, then write the file, then change the permissions back, or simply change my application to specify where the .joboptions file is located. It was safer and easier to change the application, and copy the .joboptions file to my directory.
0 Kudos