A CD/DVD boots differently than a HDD, therefore you should only need to arrange for a hard drive install to check for BIOS or UEFI, then run the appropriate code to set up the disk partitioning, then it can install whichever of /boot/grub or /efi/grub that it needs.