Setup Factory 10

Drive.GetType

Drive.GetType

This is the first topic This is the last topic  

Drive.GetType

This is the first topic This is the last topic  

OverviewExamples

number Drive.GetType (

string Drive )

Example 1

drive_type = Drive.GetType("C:\\");

Gets the type of drive given the drive letter "C:\" and stores the numeric result in a variable called "drive_type."  Normally a value of 3 would be returned meaning their "C:" drive is a fixed drive.

Example 2

what_type = Drive.GetType(_SourceDrive);

Determines what type of drive the installer is run from and stores the result in what_type. If the user was running it from a CD-ROM or DVD-ROM drive, the variable what_type would contain the value 5.

Note: _SourceDrive is a built-in variable that contains the drive letter where the setup.exe file is located.

Example 3

-- Get the type of the drive where the installer is running from.

drive_type = Drive.GetType(_SourceDrive);

 

-- If the drive type is a CD/DVD ROM drive, eject it.

if (drive_type == DRIVE_CDROM) then

   Drive.Eject(_SourceDrive);

end

Determines what type of drive the installation is run from and stores the result in drive_type. If the user is running it from a CD-ROM or DVD-ROM drive the drive would be ejected.

Note: _SourceDrive is a built-in variable that contains the drive letter where the setup.exe file is located.

See also: Related Actions


Learn More: Indigo Rose Software - Setup Factory - Buy Now - Contact Us