in Education by
Our clients are frequently reporting issue that they are getting "Access Denied" exception when they used to run application that has been installed with downloaded setup file. Our installer, installs executable on 'Program Files' and creates configuration files at C:\ProgramData. Once installation is done, our application automatically run first time. Whenever user going to run it next time, it throws Access is denied as program can not able to access configuration files at C:\ProgramData. Yes.. "Run as Administrator" is the solution but we can not ask our all paid users to do such. I have searched option at can set privileges by some alternative way then manually run executable as "Run as Administrator". I have found that help page but that's not working for me. My application is java desktop application so I have created .exe.manifest file and put that manifest file into executable where images and other product's properties files resides. Manifest does not work for me and I am still getting "Access Denied" issue. This is content of manifest file - <?xml version="1.0" encoding="UTF-8" standalone="yes"?> " type="win32"/> Description of your application <!-- Identify the application security requirements. --> How I can attach the application manifest to the executable as I have only copied that manifest where images and other product's properties files resides ? Is there any thing need to update in manifest file as I have copied as-is content except ? Exception -- java.io.FileNotFoundException: C:\ProgramData\.\config\.xml (Access is denied) stacktrace javax.xml.transform.TransformerException: java.io.FileNotFoundException: C:\ProgramData\.\config\.xml (Access is denied) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(Unknown Source) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source) at com..main.dr.a(Unknown Source) at com..main.dr.a(Unknown Source) at com..main.dr.a(Unknown Source) at com..main.h.k(Unknown Source) at com..main.ay.run(Unknown Source) Caused by: java.io.FileNotFoundException: C:\ProgramData\.\config\.xml (Access is denied) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream. (Unknown Source) at java.io.FileOutputStream. (Unknown Source) ... 7 more --------- java.io.FileNotFoundException: C:\ProgramData\.\config\.xml (Access is denied) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream. (Unknown Source) at java.io.FileOutputStream. (Unknown Source) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(Unknown Source) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source) at com..main.dr.a(Unknown Source) at com..main.dr.a(Unknown Source) at com..main.dr.a(Unknown Source) at com..main.h.k(Unknown Source) at com..main.ay.run(Unknown Source) and the cause isjava.io.FileNotFoundException: C:\ProgramData\.\config\.xml (Access is denied) JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
The problem is because the user settings file is stored in the wrong place. Only executable binaries and related resources belong in the ProgramData directory ("C:\Program Files..."), and this data should only change when a user with administrator rights installs or updates a program installation. Any configuration or data that the user needs to change must be kept in places where the user has rights to edit, such as their home folder, "My Documents", their HKEY_CURRENT_USER Registry key, or better yet, their AppData directory. You can read more about these Windows programming requirements for user data storage here, and here is how some people have done this in Java. Hope that helps get you fixed up! On second thought, perhaps using a tool like PROCMON.EXE would help narrow down the specifics of the denial--because it will show you whether the programming is opening the file/directory for reading, writing-with-all-permissions, trying to create a file that already exists, etc.

Related questions

0 votes
    Our clients are frequently reporting issue that they are getting "Access Denied" exception when they used to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 28, 2022 in Education by JackTerrance
0 votes
    I have shared location on Azure VM and web job in the same Vnet on Azure. I have C# script ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    I want to use my Amazon ec2 instance but faced the following error: Permission denied (publickey). I have ... denied (publickey) Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    I'm trying to fetch some data from the REST API of HP Alm. It works pretty well with a small ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I'm trying to incorporate Google Maps into my Access form so that for every record a map of its ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 13, 2022 in Education by JackTerrance
0 votes
    I cannot SSH into my instance - Operation timed out. What could be the reasons why, and what can I do to ... because of memory issues. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I am trying to implement the Hateoas using spring boot. In my UserController class i have used the below ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 12, 2022 in Education by JackTerrance
0 votes
    I have created a docker image. I want to push it into my docker repo but I am facing this error: denied: ... to the resource is denied Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    I'm relatively new to C++, and I'm hoping someone can help me resolve an issue I'm having with unique_ptr and vectors. ... ) { useLegs(); } void Biped::useLegs() { std::cout...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    I'm working to set up Panda on an Amazon EC2 instance. I set up my account and tools last night and had no ... would be a great help! Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    I have a fairly similar docker-compose file to what is officially provided namely version: '3' volumes: ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I am a beginner and I just need a bit of help on why I getline is showing an error: this is what I have so far ... payments[MAX_ITEMS]; ifstream iFile; if ( argc != 2 ) { cout...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    I am a beginner and I just need a bit of help on why I getline is showing an error: this is what I have so far ... payments[MAX_ITEMS]; ifstream iFile; if ( argc != 2 ) { cout...
asked Apr 7, 2022 in Education by JackTerrance
+1 vote
    What is a sequential access file in C-Programming?...
asked Nov 8, 2020 in Technology by JackTerrance
0 votes
    I have neo4j-server installed on remote linux server. This server using nginx and has virtual host. Here is ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 5, 2022 in Education by JackTerrance
...