Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Nov 21, 2019 1:31 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Where to put data files so users need not mess w Run as adm?
PostPosted: Fri Sep 28, 2012 12:00 pm 
Offline
User avatar

Joined: Sat Apr 29, 2006 10:13 am
Posts: 239
Location: Sweden
Hi,

Where is the recommended place in Windows 7, for an application to keep its data files, so that users don't have to mess at all with 'Run as administrator' or even the 'Always run as administrator'?

On my customer's computer there are several users with limited privileges. They all should be able to use the application.

I let my installer put my RB-application's .exe and libs folder in C:\Program Files (x86)\Foldername\
The application is writing to its data files which I placed in folder C:\ProgramData\Foldername\
The files are for the application's use only. The normal user need/should not see them. They could be small one-liners, as well as ,say, a database file with hundreds of MB.

Is that the way to go?

Thanks in advance.
Lennart


Top
 Profile  
Reply with quote  
 Post subject: Re: Where to put data files so users need not mess w Run as
PostPosted: Fri Sep 28, 2012 3:31 pm 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
Under Windows, per-user data should be stored in SpecialFolder.ApplicationData (by default located at C:\Users\<UserName>\AppData\Roaming in Win7) while data that must be readable/writable for all users goes into SpecialFolder.SharedApplicationData (by default located at C:\ProgramData\). You should create a new directory for your application in these directories.

The actual path to these folders has changed between versions of Windows, and may not be in the default location on any given system. Using the SpecialFolder class will use the correct folder regardless of OS version or non-default settings.

_________________
Boredom Software


Top
 Profile  
Reply with quote  
 Post subject: Re: Where to put data files so users need not mess w Run as
PostPosted: Thu Oct 04, 2012 6:09 am 
Offline
User avatar

Joined: Sat Apr 29, 2006 10:13 am
Posts: 239
Location: Sweden
Thank you Andrew,
Very clear.

The executable, which should be available to all users to run, I now understand, should be put in a folder under SpecialFolder.SharedApplications.
Ie for Windows 7 under C:\Program Files (x86)\Common Files\Foldername\

Does putting it in ...\Common Files\... give any special properties, or is it just a tidy place for good order?


Top
 Profile  
Reply with quote  
 Post subject: Re: Where to put data files so users need not mess w Run as
PostPosted: Thu Oct 04, 2012 8:21 am 
Offline

Joined: Mon May 31, 2010 5:35 am
Posts: 2412
Location: Netherlands
Lennart wrote:
Thank you Andrew,
Very clear.

The executable, which should be available to all users to run, I now understand, should be put in a folder under SpecialFolder.SharedApplications.
Ie for Windows 7 under C:\Program Files (x86)\Common Files\Foldername\

Does putting it in ...\Common Files\... give any special properties, or is it just a tidy place for good order?


This is the windows explanation of their folder system:
http://msdn.microsoft.com/en-us/library/s2esdf4x(v=vs.80).aspx

I think google chrome uses the common files folder, but it's not meant to be used as an installation folder.
MSDN says:
Quote:
Common Files Folder
A folder for components that are shared across applications. Typically C:\Program Files\Common.

_________________
SWORT™
- Windows Vista, Windows XP, Windows 7, Linux Mint 11 and Mac OSX Lion
- REAL Studio Enterprise(latest) and WEB Edition(latest)
- Plugins (MBS Complete, ToringoLib, Einhugur, VanHoek + Some open source plugins)
For Dutch User Groups ask me to enter!


Top
 Profile  
Reply with quote  
 Post subject: Re: Where to put data files so users need not mess w Run as
PostPosted: Thu Oct 04, 2012 11:44 am 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
Lennart wrote:
Thank you Andrew,
Very clear.

The executable, which should be available to all users to run, I now understand, should be put in a folder under SpecialFolder.SharedApplications.
Ie for Windows 7 under C:\Program Files (x86)\Common Files\Foldername\

Does putting it in ...\Common Files\... give any special properties, or is it just a tidy place for good order?


Executables that all users should be able to use go into SpecialFolder.Applications, which corresponds to C:\Program Files. The Common Files folder to my knowledge has no special properties but is intended for things like DLLs and icons which will be shared by multiple applications.

_________________
Boredom Software


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group