Skip to content
⌘ NSIS Forum Archive

mciSendString CDAudio drive letter

6 posts

Collector9999#

mciSendString CDAudio drive letter

I had been using to open the user's CD drive if my installer did not find the correct in the selected CD drive. At this point the selected drive has been populated in $CD.

System::Call 'winmm::mciSendString(t "set CDAudio door opened",,,)'
This works as long as there is only one drive or the selected drive is the first optical drive. However, if there is more than on drive. Then it is the first optical drive that opens, even if the selected drive is not the first drive. I found several examples of how to assign the drive to the CDAudio in C++, C# and VB, but could not find anything for using it with the system plugin, nor was I able to adapt what I found to the system plugin.
Anders#
"set CDAudio!X: door open" where X is the drive letter does not work?

Or two commands: "open cdaudio!X: alias driveX" and "set driveX door open wait".

You should probably also change ,,, to ,i,i,i
Collector9999#
Thanks Anders, that worked. The ,,, came from the Wiki entry



What is the difference between ,,, and ,i,i,i?
JasonFriday13#
,,, means those parameters are blank. using ,i,i,i means the types are ints, with blank inputs/ouputs. Using ,i0,i0,i0 is exactly the same. So basically each parameter has a type, followed by the data to use. The 't' in the example is a TCHAR type, which is for ansi or unicode strings.
Collector9999#
Thanks for explaining. I had assumed that the ",,," would be taken as null. I was mostly unsure of the ",i,i,i".