Inno Setup install script from CD/DVD drive (variable path)

721 Views Asked by At

I am trying to write a Inno Setup script to install files from a CD drive to a predefined system C drive folder. Naturally, the CD/DVD ROM may have a different path ID on different systems. How do I code this variable path for the Source Files?

1

There are 1 best solutions below

3
On

Assuming your installer is located along with the files you are going to install, you can use the {src} constant to refer to installer's folder along with the external flag:

[Files]
Source: "{src}\file.dat"; DestDir: "..."; Flags: external

If your installer is located elsewhere, there's no generic solution. Note that there may be even more CD/DVD drives on the computer.

You would have to programmatically enumerate all drives, testing for their type (CD/DVD) and presence of certain files for example.