Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making application Vista ready?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01156172
Message ID:
01156732
Views:
19
Sys(2023) returns the system setting for the temp path, but if you set TMPFILES in config.fpw that value will override.

Using the System setting is safe because Vista will provide that for you (I think it reads the TEMP environment variable). All those 'My Documents' paths are virtual anyway (it's Documents now) and Vista will remap them appropriately when you reference a virtual path.

If you're really worried about this put your temp files in your application folder as a subdirectory. That way you know exactly what rights you have.

Finally you can always use the SHGetFolderPath API to retrieve the official temporary folder or any of the other special folders.

+++ Rick ---


>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.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform