Archive: CD-ROM drive readiness


CD-ROM drive readiness
Hi all,

Not trying to dig up older threads on multi-disk installations - think i've got that figured out. My question: is there a way to check the readiness of a drive (CD-ROM, for example)?

My problem is that if the user installing my multi-disk set has a slow CD-ROM and clicks "OK" for the next CD before the disk has spun up, errors are occurring. I'd like to write into the installer a check to see if the drive is ready to be read.

Any ideas? Thanks...


Try this plugin http://nsis.sourceforge.net/CDRom_plug-in


That will probably do it...uh...hmm...guess I'm still a bit of an amateur :(

- How would you write a conditional that would loop until the value of cdrom::status was 1?

Thanks..


@example
_loop:
StrCmp $0 '1' 0 _loop


Thanks - still having some issues - tried this:

#spin until the CD is ready
_loop:
cdrom::status "" .R0
StrCmp $R0 '1' 0 _loop

It still jumps ahead sometimes - the next line of code invokes 7zip which fails because it can't find the archive on the CD-ROM.

Any ideas?


Thanks again..


Your code looks OK, though .R0?
I have not ever used the plugin, I guess Instructor should provide the correct use. Probably an issue because of the relative jump? Try to replace 0 with a label or better use LogicLib :-)


_loop:
cdrom::status "" .R0
StrCmp $R0 '1' _ready
MessageBox MB_OKCANCEL 'Insert CD-ROM disk and press OK' IDOK _loop IDCANCEL _exit

_ready:

_exit:

Thanks - that fixed the code problem but ultimately did not fix the problem that I was having. The CD-ROM is now reporting that it is ready but (intermittantly) 7zip can't find the archive on the disk so it pops an error code.

Any thoughts on how I could capture that error message and use it to retry the command?

Thanks again...


can't you copy the archive off the disc into $TEMP ?


Yeah, I did that at first but it takes twice as long for the installation - the archive is 400+MB of compressed pdf data; if i first copy it to TEMP it takes about 4 minutes to do the copy. Extraction takes another 4-6 mintures, depending on computer so now I've got 10 minutes install time per disk; I've got 3 disks to complete the installation.

Thanks anyway though :)


maybe plain pdf files in no compressed archive would be faster, and just manually copying them using "File" or something.

at least its lots of smaller files then *shrug*


Yeah, tried that too - not the results that I wanted. However, I think that I've resolved the current problem that I'm having by adding a 5 second pause after the CD-ROM reports that it's ready - we'll see....


Thanks again..


Put an empty file on your disk and use this code to check if it is readable:

StrCpy $R0 0
TryAgain:
Sleep 1000
ClearErrors
FileOpen $R1 "$EXEDIR\setup.tmp" r
IfErrors 0 Done
IntOp $R0 $R0 + 1
StrCmp $R0 10 0 TryAgain
MessageBox MB_OK|MB_ICONSTOP \
"No CD detected etc..."
Abort
Done:
FileClose $R1


-Stu

Thanks Stu, I'll give that a try as soon as I can :)


- Ed