Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making application Vista ready?
Message
 
 
To
21/09/2006 16:38:08
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01156172
Message ID:
01156349
Views:
21
Hi Frank
Thanks for the tip on the "constants", but I think I like the APPDATA environmental variable better because they can't change that one and it is consistent between XP and Vista.

We did some checking of other Windows versions and although APPDATA does not exist in some of them, we still think that it's the one to use because the majority of our users are using XP.

Best, John

>Hi John,
>
>I have used one of the FFC classes to determine particular folders on user pcs, for similar reasons of not knowing if I'd be able to write to the Program Files folder.
>
>Here's some sample code which you may consider as an alternative (but of course this may have changed under vista as well):
>
>
>#DEFINE CSIDL_PERSONAL 0x0005 && My Documents
>
>* assuming _System.VCX is in the set classlib statement
>m.loSystem = CREATEOBJECT("_CommonFolder")
>m.lcMyDocuments = m.loSystem.GetFolder(CSIDL_PERSONAL, .F.)
>
>
>I'm sure you can find the other constants to get the other user folders.
>
>>We recently installed Vista RC1 and tested an application that we distribute and immediately ran into problems. Naturally, the UAC (User Access Control) is the problem that we did not anticipate or even know about until we installed Vista.
>>
>>For those that are familiar with the problems that UAC can cause, it appears that you should be developing your apps to run for "standard users" instead of "administrators". In the XP world, seems like everyone was an administrator and Vista is going to change this.
>>
>>In short, no more writing to the "Program Files" or "Windows" folder; and no more registry changes UNLESS you want to logon as an administrator to do this.
>>
>>We've decided to try and modify our apps so that they will run in XP or Vista without any special code or even knowing if they are in Vista. Here is what we determined.
>>
>>I know Rick Strahl (correct me if I'm wrong here Rick) suggested using
>>SYS(2023) to determine the folder to your application system files. Currently, these are being stored in the application folder in Program Files... which is a big no-no under Vista.
>>
>>In our testing, SYS(2023) did not give us consistent results. In XP, on one occasion it was returning the C:\ folder. Conceivably, this was due to a setting in the config.fpw or an application config.??? file. We decided that this was too difficult to control because what is returned by SYS(2023) could be changed by a setting in the config.??? file.
>>
>>After reviewing the environmental variables that exist in both Windows XP and Vista, it looks like the ones that will give us what we are looking for is either the APPDATA or USERPROFILE environmental variable.
>>
>>The following shows an example of what we would do if using the APPDATA variable to determine where our applications system files should be created.
>>
>>In Win XP, Appdata returns ...
>>
>>C:\Document and Settings\UserName\ApplicationData
>>
>>In Vista, it returns
>>
>>C:\Users\UserName\AppData\Roaming
>>
>>(Note: We'd probably strip off the "Roaming" so as not to run into problems with roaming profiles, and append on "Local" to save in the Local application data folder.)
>>
>>To this we would create a folder for our application and store our application files that the user creates when running the application in that folder.
>>
>>
>>Here is an example of how this would work:
>>
>>User name is: John
>>Application Prefix is: JJF
>>
>>If running in XP we would save our application system files in:
>>
>>C:\Document and Settings\John\ApplicationData\JJF
>>
>>
>>If running Vista, we would save our application system files in:
>>
>>C:\Users\John\AppData\Local\JJF
>>
>>
>>If anyone else has given any serious thought to this, I'd sure love to hear your comments.
John Fatte'

Life is beautiful!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform