Solved

Windows 7 File creation issue

Posted on 2014-07-23
3
290 Views
Last Modified: 2014-07-24
I am developing an application suite and one of the programs is started by the installer, which also places it in the start-up folder. When this application is started for the first time (by the installer) it discovers it does not have a configuration file and creates it. The problem is that the file permissions given to this configuration file prevent other applications in the suite being able to write to it.

If I delete the configuration file and restart the PC then when the application starts up it recreates the configuration file and permissions are good.

What is the best way to resolve this problem. I do not want to disable the auto-run of the application by the installer as this would mean the user would either need to start it manually for the first time or ask for a PC restart.
Sid.
0
Comment
Question by:Sid Price
3 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 40216085
Would this achieve what you want.
Create another small app which the installer will start.  The only job of this app would be to launch your 'real' app.  You 'real' app then deletes this stub app if it detects it.
0
 
LVL 32

Accepted Solution

by:
sarabande earned 500 total points
ID: 40216316
if the installer would run 'as administrator' in the user account, file permissions should be ok.

if that isn't an option you may store the default configuration file in the application folder read-only and copy the file to user folder at first start.

Sara
0
 

Author Comment

by:Sid Price
ID: 40217385
sarabande, I was considering your idea of including a default file with the distribution, It may be the simplest solution, the only thing one would need to ensure is that uninstall (to make updates) should not remove this file because then the user would loose the current settings.
Thank you for helping my decision,
Sid.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
This video demonstrates how to use each tool, their shortcuts, where and when to use them, and how to use the keyboard to improve workflow.
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now