Access rights problem with folders

  • Thread starter Thread starter Sven Abels
  • Start date Start date
S

Sven Abels

Hi,

when testing the Windows Vista RC1, I noticed that some of my applications
do not work as expected. They are installed correctly in a sub folder of
C:\program files\ApplicationName
However: When executing those applications, it seems that they are not
allowed
to write to their own folger (C:\program files\ApplicationName). However:
This is necessary in order to e.g. download updates.
When I start the application by right-clicking on the link and executing it
with admin
rights, then everything works fine. However: This is of course not a good
solution.
Does anyone have a tip for me?



Best greetings,

Sven
 
pHi,
Go to the applications properties and under Compatibility check "Run this
program as Administrator"
 
This would work but since my programs are distributed as Shareware
and Freeware, it would mean that every user would need to do this
manually before using the software... :-(
 
Another tought to this problem: As far as I know, it's Microsoft
recommendation to use a .exe.config file for managing application
configurations. For example, such a file is automatically generated in .Net.
This file needs to be placed in the same dir as the exe file of the
application. How can this work if a program is not allowed to change any
file in this directory?

Best greetings,

Sven
 
Hello,

The problem here is that you are storing data in the program files
directory. This directory is only for executable program files and other
dependencies that are needed by the program machine-wide, and is not meant
to be modified often.

Installation programs that install programs to Program Files need admin
permissions. In the same vein, if your program wants to UPDATE its program
files, it will also need admin permissions.

My recommendation would be to download program updates to a temporary folder
in the user's profile directory. Then, when the user wants to APPLY the
program updates, run a program that is marked as needing admin permission to
run and apply the update.

In this way, your main program will run with standard user permissions, and
only the updater that needs admin permissions to function will request it.
 
The problem here is that you are storing data in the program files
directory. This directory is only for executable program files and other
dependencies that are needed by the program machine-wide, and is not meant
to be modified often.

What about the .exe.config file for the program? Does this mean that it
cannot be changed, too?


Best greetings,

Sven
 
Any file stored anywhere inside of program files is read-only and requires
admin permission (elevation) to modify.
 
Sven said:
Hi,

when testing the Windows Vista RC1, I noticed that some of my applications
do not work as expected. They are installed correctly in a sub folder of
C:\program files\ApplicationName
However: When executing those applications, it seems that they are not
allowed
to write to their own folger (C:\program files\ApplicationName). However:
This is necessary in order to e.g. download updates.
When I start the application by right-clicking on the link and executing it
with admin
rights, then everything works fine. However: This is of course not a good
solution.
Does anyone have a tip for me?



Best greetings,

Sven

Sven:

If your program only needs admin rights for some actions, you could pop
up a box telling the user to restart the app with admin privileges.

You do not want to use a separate setup program for these updates?

David Wilkinson
 
If your program only needs admin rights for some actions, you could pop
up a box telling the user to restart the app with admin privileges.

You do not want to use a separate setup program for these updates?

No because those are basically only security updates and definition files
that have about 10-20kb. So downloading a new setup file each week would be
more then oversized and not very userfriendly...

Greetings,

Sven
 
Back
Top