Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Building a drive list containing only CD Drives

Status
Not open for further replies.

LawnMowerMan

Programmer
Oct 30, 2003
3
US
I need to create a dialog that contains a list of only the CD drives on the machine. I am using Wise Installmaster 8.03. I can easily determine the first CD drive but none of the others. I can check to see whether or not a path is on a CD drive or not, but not how many drives there are to check. And then once I deternine this I wish to place this list into a list control.

Any ideas?

Thanks.
 
I figured it out on my own. I basically created a while loop and checked the drive type for every conceivable drive from A-Z and added drive types equal to C to my combo box list. Here is the .wse file text for any that are interested. With luck you could paste the following text into a file, save it as a filename.wse file and open it with wise to better see how it worked.
========
Document Type: WSE
item: Global
Version=8.03
Flags=00000100
Split=1420
Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Japanese Font Name=MS Gothic
Japanese Font Size=9
Progress Bar DLL=%_WISE_%\Progress\WIZ%_EXE_OS_TYPE_%.DLL
Start Gradient=0 0 255
End Gradient=0 0 0
Windows Flags=00000100000000010010110000001000
Message Font=MS Sans Serif
Font Size=8
Disk Label=Default
Disk Filename=SETUP
Patch Flags=0000000000000001
Patch Threshold=85
Patch Memory=4000
FTP Cluster Size=20
Dialogs Version=7
Step View=&Properties
Variable Name1=_SYS_
Variable Default1=C:\WINDOWS\SYSTEM
Variable Flags1=00001000
Variable Name2=_WIN_
Variable Default2=C:\WINDOWS
Variable Flags2=00001000
Variable Name3=_WISE_
Variable Default3=C:\PROGRAM FILES\WISE INSTALLMASTER 8.0
Variable Flags3=00001000
end
item: Get System Information
Variable=FIRSTCD
Flags=00001010
end
item: Get System Information
Variable=DRIVETYPE
Pathname=%FIRSTCD%
Flags=00001000
end
item: Set Variable
Variable=ALLDRIVEIDS
Value=ABCDEFGHIJKLMNOPQRSTUVWXYZ
end
item: Set Variable
Variable=DRIVELIST
end
item: Set Variable
Variable=WHILEPOS
Value=1
Flags=00100000
end
item: If/While Statement
Variable=WHILEPOS
Value=26
Flags=00011001
end
item: Set Variable
Variable=NEXTCD
Value=MID$(ALLDRIVEIDS,WHILEPOS,1)
Flags=00100000
end
item: Get System Information
Variable=DRIVETYPE
Pathname=%NEXTCD%:
Flags=00001000
end
item: If/While Statement
Variable=DRIVETYPE
Value=C
Flags=00000100
end
item: Set Variable
Variable=DRIVELIST
Value=%DRIVELIST%%NEXTCD%:%CRLF%
end
item: End Block
end
remarked item: Display Message
Title=Test
Text=%WHILEPOS%
Text=%NEXTCD%
Text=%DRIVELIST%
Text=%DRIVETYPE%
end
item: Set Variable
Variable=WHILEPOS
Value=WHILEPOS+1
Flags=00100000
end
item: End Block
end
item: Custom Dialog Set
Name=Select CD Drive
item: Dialog
Title=Select CD Drive
Width=150
Height=150
Font Name=Helv
Font Size=8
item: Combobox
Rectangle=5 5 32 97
Variable=CDLOCATION
Enabled Color=00000000000000001111111111111111
Create Flags=01010000001000010000001000000010
Text=%DRIVELIST%
Text=
end
item: Push Button
Rectangle=5 105 40 120
Action=3
Enabled Color=00000000000000001111111111111111
Create Flags=01010000000000010000000000000000
Text=DUDE!
end
end
end

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top