ubuntu gnome Fails to install grub-efi to /target/

this question has already been asked a couple of times, however I can't find the answer for my problem in any of threads.
I am trying to install the ubuntu gnome 16.1 which I had already installed once before. I also had installed other ubuntu versions before without running into any specific problem.
however this time I tried to reinstall my ubuntu and I get the "Fails to install grub-efi to /target/" error every time.I also get the UEFI warning which says there is another OS on my system not installed with UEFI mode and installing linux in this mode will broke the other OS. my other OS is Windows 10 and I installed the ubuntu gnome in UEFI mode the last time (I got the warning the last time too but didn't run into any problems). my laptop is relatively new one and I doubt my windows is installed in legacy bios mode.
I can't find any ESP partitions on my laptop disk (unless it's the 500 mb ntfs at the beginning) and I don't remember ever making such a partition.
another question is : I found there is a solution of skipping the grub install with ubiquity -b command.how do I use this while installing from live flash? thanks in advance and any help appreciated.


UPDATE :

I found out my windows is in fact installed in legacy mode.

SOLUTION : as @ravery mentioned the best way is to install grub later manually. I used a live flash to do this since the installer would crash after failing to install grub. run the ubiquity -b command in the terminal from the live ubuntu and after the installation is DO NOT REBOOT. mount the ubuntu you installed into the live version and install the grub. worked just fine for me. Also I installed ubuntu in UEFI mode along with windows in legacy mode and have had no problems so far.


I have seen this with many computers, it is not the grub install that actually fails but the update-grub that makes the first config file that fails. the problem is that the if/then statement in 30_uefi-firmware errors.

the easiest fix is after it error, choose the command line prompt at the bottom of the installer menu. and use nano to edit the file /etc/grub.d/30_uefi-firmware. I have changed mine to read:

gettext_printf "Adding boot menu entry for EFI firmware configuration\n" >&2
cat << EOF
menuentry 'uefi-firmware' {
fwsetup
}
EOF

after editing rerun install grub. note: on some systems the print command needs to be commented out temporarily for the installer