CDRom为NSIS提供CD光驱操作功能

/*
CDRom为NSIS提供CD光驱操作功能
功能介绍:
*打开或关闭CD-ROM,cdrom::Close,cdrom::Open
*获得CD-ROM的状态,比如是否准备好cdrom::Status
*获得CD-ROM的相关信息,卷标,卷标序列号cdrom::VolumeName,cdrom::VolumeSerialNumber
*遍历系统所有的CD-ROM个数cdrom::FindNext,cdrom::FindClose
*/
!AddPluginDir "../Plugin"
Name "CDRomTest"
OutFile "CDRomTest.exe"
Section
# Enumerate CD-ROMs
loop:
cdrom::FindNext /NOUNLOAD .r0
MessageBox MB_YESNO "cdrom::FindNext$n$n
Errorlevel: [$0]$n$n
Choose this CD drive for test?" IDNO loop
cdrom::FindClose
#Open CD-ROM door
cdrom::Open "$0" .R0
MessageBox MB_OK "cdrom::OpenCD$n$n
Errorlevel: [$R0]"
# Close CD-ROM door
cdrom::Close "$0" .R0
MessageBox MB_OK "cdrom::CloseCD$n$n
Errorlevel: [$R0]"
# Get CD-ROM status
cdrom::Status "$0" .R0
MessageBox MB_OK "cdrom::StatusCD$n$n
Errorlevel: [$R0]"
# Get CD-ROM volume name
cdrom::VolumeName "$0" .R0
MessageBox MB_OK "cdrom::VolumeName$n$n
Errorlevel: [$R0]"
# Get CD-ROM volume serial number
cdrom::VolumeSerialNumber "$0" .R0
MessageBox MB_OK "cdrom::VolumeSerialNumber$n$n
Errorlevel: [$R0]"
SectionEnd
THE END
喜欢就支持一下吧
点赞15 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容