Posted by Jhon in Coffee Lounge on Mar 16 2008, 11:26 am

This tutorial will present you with a quick overview of some important folders that should be considered when developing software for Windows Vista.

It has been since 2001 to 2006 that I use Windows 2000 Professional and from 2006 to end 2007 that I use Windows XP Professional. I got used to the idea that you can read/write files next or close to your project is installed, unless you want to have a configuration system per user account, which now you have to see in "Document and Settings" folder. This idea was embedded in me for many years.

Now we arrive to a new OS that is significantly better than any previous Windows, called Windows Vista (yes, believe it well, Microsoft did a good job (for the few times they do.)). After using Vista for several months, (installed on several computers where some with several accounts on them), I discovered that Windows Vista does, for once, an EXCELLENT job -really- (compared to previous version of Windows) in account "separation". Now, any new version of software runs with per user configuration, and even many allows to register/activate once per computer a software if it follows their EULA ofcourse. See, the problem is at with Vista new account system, no users except the REAL administrator (not to be confused with the account limitation name also called Administrator (which is actually Power User)), can write in the OS drive (except at certain locations) without the real Administration permission (the User Account dialog box). The REAL Administrator account is a hidden account where its account folder was not created, unless you show the account (Ultimate and Business edition, only).

You are developing a/or some software’s, you want to know where you can write in the registry, and folders freely without the requirement that your application to run as Administrator for silly things?
Well simple, I have no clue myself. So let us panic and run around and burn our computers! Ok, seriously, here is what I discovered.
They are 2 interesting locations: AppData, and ProgramData.
Where are there?! You say, well first we need to show them, as Windows hides these folder. On the Folder Options[/u] panel (in control panel), go to the "View" tab, and select the radio box called Show hidden files and folder", and click on "Ok" button on the Folder Option Panel.

So let us visit these non-require Administrator elevation to access folders.
Note: When I mention "C:\" in a path, I mean the OS root location. I strongly suggest to NOT use the drive letter in your code when you access a folder, as Windows could be installed on a different drive letter.

AppData is located in C:\Users\\AppData. You will see 3 folders inside. Anything in this folder is for the user exclusive account. Meaning if you want a per account settings it would be the ideal place to save the files. Now all you have to select is between "Roaming", "Local" and "LocalLow" sub-folder.

ProgramData is located in C:\ProgramData. This location is shared among all accounts. Ideal place to save files that will be shared among all accounts, or even a place to save the unlock/activation/register file, or something to say that the program was registered/activated/unlocked.

In the registry, a location that would be shared among all accounts, [b] REQUIRES
administration privilege is inside "HKEY_LOCAL_MACHINE". As for the location where you can save data in the registry WITHOUT Administration elevation is "HKEY_CURRENT_USER", however, it will not be shared with other accounts.
I hope this helps making your application Vista or more Vista compatible, and heck even give it a more professional touch to it.


Posted by northcode in Coffee Lounge on Mar 16 2008, 03:41 pm


QUOTE: from Jhon;43651
Now, any new version of software runs with per user configuration, and even many (and growing (I am waiting Northcode)) allows to register/activate once per computer a software, without the need to do it per account, like SOME (pointing at Northcode) software's.

Focus for a second Jhon while I explain this to you one more time. SWF Studio works the way it does because that's how we want it to work and not because of any technical problem. Just because we don't care about your opinion on the subject doesn't mean we don't understand.

Now for the real story about where you should store files under Vista, please have a look at this whitepaper from Microsoft called Windows File System Namespace Usage Guidelines. It's a FREE download and packed with good information. I've included the overview below.

QUOTE:
This white paper is intended for application developers and IT professionals. It provides guidelines for using the Windows Vista User Profile namespace in your applications. Windows Vista has an improved file system namespace that enables users to find and organize data easily. The file system namespace also enables application developers to distinguish between application-managed data and end-user-managed data, between private data and shared data, and between computer-dependent data and computer-independent data. The new file system namespace provides a platform that leverages features already available in Windows (for example, folder redirection) and improves the functionality of features in user scenarios (for example, improved data roaming, data migration, and data backup).


Posted by Jhon in Coffee Lounge on Mar 16 2008, 03:58 pm


QUOTE:

Focus for a second Jhon while I explain this to you one more time. SWF Studio works the way it does because that's how we want it to work and not because of any technical problem. Just because we don't care about your opinion on the subject doesn't mean we don't understand.

My apologies. As I see more and more programs doing the activation system per computer I thought... well... never mind.
And I think some time ago (really in the past) you mentioned that the serial was per computer. But I think either it changed, or I miss understood. Sorry again, let me edit that out, no harm done? :).

QUOTE:

Now for the real story about where you should store files under Vista

Already read it... I was about to edit my post to add it, as soon as I find where I found the document, as I downloaded it sometime ago. I just wanted to save some people time in reading the hole thing and again it is just a quick thing not a documentation.


Posted by northcode in Coffee Lounge on Mar 16 2008, 04:33 pm

We actually do care about your opinion, we just aren't likely to change our policy because of it :evilgrin:

Our EULA describes our license as a "Nomadic Use License" which essentially means the license is assigned to you (not the computer) and can only be used by you.

For most people this means one installation per computer and your account protects SWF Studio from license violations, unless you're into sharing all your login information.

In the case of a publicly accessible computer, allowing multiple accounts to access the software would be a violation of the license (again, we're assuming those accounts are owned by different people).

Our policy may not fit with every situation but we've only had one complaint since V3 has been released, not saying who it was :whacko:


Posted by Jhon in Coffee Lounge on Mar 16 2008, 04:52 pm


QUOTE:
not saying who it was :whacko:
Hehe... You said that so many times, that it tuned to be a direct link to me. Soon you will be able to do this: :Jhon: and it will show :whacko: smilly :).
I got to learn how to shut-up sometimes :Jhon: