Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to address Read-Write issues with Windows7 systems?

Status
Not open for further replies.

montypython1

Technical User
Jan 12, 2005
187
US
Greetings,

In VFP, what is the best way to eliminate "write" issues within a Windows7 system?

My issue is with the "write" restriction within Windows7 systems of any subfolder under the "C:\program files (x86)" and "C:\program files". I can manually give "write" permissions for these subfolders for each computer, but that is cumbersome since it must be done every time a user gets a new computer.

Many of our Windows7 and Vista users have access to install the VFP application, but they receive an error message that certain tables are unavailable because the program needs to "write" data to the subfolder "C:\program files\1on1\app_name\tables".

Perhaps there is a recommended file folder for installing the database and tables? Currently, the default installation path for my application is "C:\program files\1on1\app_name", and the database and tables go to "C:\program files\1on1\app_name\tables".

Any recommendations?

Thanks,
Dave Higgins

 
If you store data local within program files, welcome to the age of seperation of programs and data.

This is recommended since perhaps Win 98, but Vista was the first OS to enforce this. As far back as I can remember there is an or several application data folders in Windows for storing data, and so should you.

Windows has some APIs to find these folders independant on OS language and installation drive/directory. Eg program files is not always on C:\ and in other languages it's not program files at all, but the foreign language naem for it.

That said, here's what Doug Hennig has written about where to store what on Vista, and that still holds true for Windows 7:


Bye, Olaf.
 
Thanks Olaf,

I will read Doug's article and adjust the program's database file location accordingly. Thank you for your quick response.

Dave Higgins
 
Hi Olaf,

Thanks again for your response. Per your suggestion, I read Doug's article (and his earlier related article as well).

I'm a little confused however, because if I understood correctly, Doug states in the first paragraph of his article that he now stores some of his writable data within a subfolder of "C:\program files" (which is what I am currently doing, but am trying to change). He addresses the write-restiction issue during installation by using the InnoSetup command that makes a subfolder write-accessible, such as:
[Dirs]
Name: "{app}\Data"; Permissions: everyone-modify
This is pretty cool ... I did not know this was possible in InnoSetup.

Still, I would like to NOT use the "C:\program files" subfolders. How about a subfolder within "C:\ProgramData"? The name even sounds like a good place to hold these DBF and DBC files.

What subfolder do you typically use to hold your DBF and DBC files?

Thanks,
Dave Higgins
 
Yes, he has a reason for this, because when there is an installation for all users on a server (lan share), then a location local to the installing client isn't sufficient.

I mentioned application data. Doug has another article on this and other system folders:


Bye, Olaf.
 
Thanks Olaf,

This is what I'm looking for. As always, I appreciate your assistance.

Dave Higgins
 
To Add: Install Cretors like Installshield also offer options to store files in an AppData Folder, like they offer to put the executable in ProgramFiles. That's how you put data into these system folders in a setup.

The Installshield version coming with VFP can still be used on Vista, but is rather only good up to XP, so you better switch to something newer in that area.

On the other side you can create the application database programmatic by determining these folders. Be aware, that there are several AppData Folders for AllUsers, the current user and since Vista there is a diversity for Roaming data, stored in a user's profile, Local and LocalLow Appdata staying on the one computer.

This is explained in detail here:

Bye, Olaf.
 
Yes, I bumped into some limitations with Install Shield. I am currently using InnoSetup to install my VFP applications and it appears to offer file folder options for the data files ... your input should help me place these files in the proper file folder.

Thank you,
Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top