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.System::Call 'winmm::mciSendString(t "set CDAudio door opened",,,)'
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.