You might want to look at this link
http://discuss.joelonsoftware.com/default.asp?design.4.507980  for a
discussion of Vista support. I'm sure Microsoft's site has some best
practices information, too. 

 

Also, search for CSIDL_APPDATA and SHGetFolderPath - I'm not sure whether
you'll have problems trying to write this stuff on D5 and Win98.

 

You can decide whether to save your data on a "per machine" basis (all users
of your program on that machine share the same data) or a "per user" basis
(each user of your program has his/her own version of data). That's part of
what that first link refers to.

 

See also  http://msdn2.microsoft.com/en-us/library/aa480150.aspx,
http://msdn2.microsoft.com/en-us/library/aa905330.aspx, and
http://www.microsoft.com/downloads/details.aspx?FamilyID=BA73B169-A648-49AF-
BC5E-A2EEBB74C16B
<http://www.microsoft.com/downloads/details.aspx?FamilyID=BA73B169-A648-49AF
-BC5E-A2EEBB74C16B&displaylang=en> &displaylang=en for Microsoft's
description on where things should go.

 

From: advanced_delphi@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Marie F Vihonsky
Sent: Tuesday, July 31, 2007 1:35 PM
To: Advance Delphi
Subject: [advanced_delphi] Re-Writing for Vista

 

Hi All,

I have just gotten the first glitches with Vista from users and it 
involves the logic for writing to the databases and indexs. I'm still 
of the old DOS mindset and a self-taught programmer. I have all my 
files located under the main folder where the program is installed and 
using Inno-Setup, I have the user install to:
c:\program files\myprogram

Using Delphi 5, I can determine if the user has installed the program 
somewhere else by determining where the EXE is located using this code:
exepath:=ExtractFilePath(Application.ExeName);
datapath := exepath + 'data\';
if not DirectoryExists(datapath) then
if not CreateDir(datapath) then begin
raise Exception.Create('Cannot create '+ datapath);
exit;
end;
mdxpath := exepath + 'indexs\';
if not DirectoryExists(mdxpath) then
if not CreateDir(mdxpath) then begin
raise Exception.Create('Cannot create '+ mdxpath);
exit;
end;

Under Vista, I understand that this is a NO-NO since it requires write 
permission from the Administer. Now my Users are all individual HOME 
users, who are the Admins and don't know how to set-up their pc's to run 
the program they way it did under all previous versions of Windows.

I'm at a loss, since I don't have a PC with Vista. Soon to be rectified 
before I go nuts trying to answer questions from my users!

Meanwhile, how should I re-write my programs? Where can I write from the 
program so that the user doesn't need Admin privileges and how do I 
determine the folder name?

Reply via email to