api
[Code]
function GetDriveType(nDrive: String): Integer;
external 'GetDriveTypeA@kernel32.dll stdcall';
procedure InitializeWizard();
begin
case GetDriveType('C:\') of
2: MsgBox('可移动磁盘', mbInformation, MB_OK);
3: MsgBox('固定驱动器', mbInformation, MB_OK);
4: MsgBox('远程驱动器', mbInformation, MB_OK);
5: MsgBox('光驱', mbInformation, MB_OK);
6: MsgBox('Ram 磁盘', mbInformation, MB_OK);
else MsgBox('未识别', mbInformation, MB_OK);
end;
end;