PDA

View Full Version : Detect xp home vs professional and ntfs



titelee79
10-27-2005, 10:24 PM
How can I set the conditions to not allow the installer to run on XP home? All my searches have only found items relating to installscript projects. I tried using some of those values in the conditions but they did not work. ISOS_ST_XP_HOME, SYSINFO.WINNT.(various)

Is there any way to accomplish this using the Install Condition field in product properties? Or do I have to write a CA script to do this?

Also, is there any way for me also to detect which file system they are using and use that as a condition as well?

Thanks

TsungH
10-27-2005, 10:30 PM
For a complete list of properties, please refer to Property Reference (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/property_reference.asp).

titelee79
10-28-2005, 07:45 PM
Thank you that helped a lot.

titelee79
11-02-2005, 11:12 PM
Is there a Property that states what the file system they are using is? (ntfs) I can't seem to find one. Or is there another way to detect the type of file system?

Zweitze
11-03-2005, 04:35 AM
Most Windows computers use multiple file systems, eg. CDFS for cd-players and FAT for floppy drives. A file system is a property of the drive.
Since a computer can have network drives too, there is no finite list of file system types.
To determine the file system type of a certain drive, use the FileSystemObject object, obtain a Drive object, then read its FileSystem property.
For more advanced information, you'll need Windows Management Instrumentation. (If you do need more, and find a way to determine if a volume is a RAID volume, please let me know!!!)

titelee79
11-03-2005, 04:07 PM
Well, I ended up solving this by adding a installscript ca similar to something I found in another forum:

#include "ifx.h"

STRING szRootPathName, svVolumeName, svFileSystemName[MAX_PATH + 1];

NUMBER nVolumeNameSize, nvVolumeSerialNumber;
NUMBER lpMaximumComponentLength, lpFileSystemFlags, nFileSystemNameSize;

prototype BOOL KERNEL.GetVolumeInformationA(
BYVAL STRING, BYREF STRING, NUMBER, BYREF NUMBER,
BYREF NUMBER, BYREF NUMBER, BYREF STRING, NUMBER);

function DetectNTFS(hMSI)

begin

szRootPathName = "C:\\";
nVolumeNameSize = MAX_PATH + 1;
nFileSystemNameSize = MAX_PATH + 1;

if (!GetVolumeInformationA(szRootPathName, svVolumeName,
nVolumeNameSize, nvVolumeSerialNumber, lpMaximumComponentLength,
lpFileSystemFlags, svFileSystemName, nFileSystemNameSize))
then
MessageBox("GetVolumeInformation failed!", WARNING);
exit;
endif;

if( svFileSystemName != "NTFS" ) then
MessageBox("This program requires that you use the NTFS file system.", SEVERE);
abort;
endif;
end;