P E Schoen
2010-11-09 20:26:21 UTC
I have an application which was originally developed using Borland Delphi 4
Pro and tested for XP. I rewrote it so that it works on Vista, but now many
customers will be using Win7 (and I now have a Win7 Home Premium 64 bit
machine). I see that there is a new environment variable for 32 bit x86
program files and I want to make sure the program gets installed properly.
In my code I have the following:
CSIDL_COMMON_APPDATA = $0023; { All Users\Application Data }
CSIDL_SYSTEM = $0025; { Windows\System32 }
CSIDL_COMMON_DOCUMENTS = $002E; { All Users\Documents }
CSIDL_PROGRAM_FILES = $0026;
ProgramFolder := GetSystemFolder(CSIDL_PROGRAM_FILES);
I am using Inno Setup which has a constant which points to the ProgramFiles
folder for the installation. I have not yet tried to install my program on
my system but one of my customers has done so with questionable success. I
can test for the OS and use the 32 bit program files folder if Win7 is
detected. I already do this (which was needed for the BDE) as follows:
procedure TfmReclData.FormCreate(Sender: TObject);
const WIN2000 = 5.0;
WINXP = 5.1;
WINVISTA = 6.0;
WIN7 = 6.1;
var VersionInfo: OSVERSIONINFO;
Version: Real;
begin
VersionInfo.dwOSVersionInfoSize := sizeof (OSVERSIONINFO);
getVersionEx( VersionInfo );
Version := VersionInfo.dwMajorVersion + VersionInfo.dwMinorVersion/10;
if (Version >= WINVISTA) and (Session <> nil) then
Session.NetFileDir := ProgramDataFolder;
if Session <> nil then begin
fmDebug.AddDebugItem( 'FormCreate: OS Version: ' + Format( '%3.1f',
[Version] );
fmDebug.AddDebugItem( 'FormCreate: NetFileDir: ' +
Session.NetFileDir ); end;
Does anyone know of any issues that I need to be concerned about for Win7?
There is a new environment variable for 32 bit programs which is
CSIDL_PROGRAM_FILESx86, but of course it is not defined in D4.
Also, I wonder if the 32 bit version of Win7 has the ProgramFiles(x86)
folder or the usual ProgramFiles?
I have also posted this on the Microsoft Tech Forum but no response so far).
Thanks!
Pro and tested for XP. I rewrote it so that it works on Vista, but now many
customers will be using Win7 (and I now have a Win7 Home Premium 64 bit
machine). I see that there is a new environment variable for 32 bit x86
program files and I want to make sure the program gets installed properly.
In my code I have the following:
CSIDL_COMMON_APPDATA = $0023; { All Users\Application Data }
CSIDL_SYSTEM = $0025; { Windows\System32 }
CSIDL_COMMON_DOCUMENTS = $002E; { All Users\Documents }
CSIDL_PROGRAM_FILES = $0026;
ProgramFolder := GetSystemFolder(CSIDL_PROGRAM_FILES);
I am using Inno Setup which has a constant which points to the ProgramFiles
folder for the installation. I have not yet tried to install my program on
my system but one of my customers has done so with questionable success. I
can test for the OS and use the 32 bit program files folder if Win7 is
detected. I already do this (which was needed for the BDE) as follows:
procedure TfmReclData.FormCreate(Sender: TObject);
const WIN2000 = 5.0;
WINXP = 5.1;
WINVISTA = 6.0;
WIN7 = 6.1;
var VersionInfo: OSVERSIONINFO;
Version: Real;
begin
VersionInfo.dwOSVersionInfoSize := sizeof (OSVERSIONINFO);
getVersionEx( VersionInfo );
Version := VersionInfo.dwMajorVersion + VersionInfo.dwMinorVersion/10;
if (Version >= WINVISTA) and (Session <> nil) then
Session.NetFileDir := ProgramDataFolder;
if Session <> nil then begin
fmDebug.AddDebugItem( 'FormCreate: OS Version: ' + Format( '%3.1f',
[Version] );
fmDebug.AddDebugItem( 'FormCreate: NetFileDir: ' +
Session.NetFileDir ); end;
Does anyone know of any issues that I need to be concerned about for Win7?
There is a new environment variable for 32 bit programs which is
CSIDL_PROGRAM_FILESx86, but of course it is not defined in D4.
Also, I wonder if the 32 bit version of Win7 has the ProgramFiles(x86)
folder or the usual ProgramFiles?
I have also posted this on the Microsoft Tech Forum but no response so far).
Thanks!