Installing Avast on a drive iother than C:/

I have a SSD drive which has limited space for the system.
Can I install Avast Free on my large D drive? I have been trying to do this using custom install but the installer tells me that my directory is not valid

How big is your drive?

You can check with this tool to see where your files and file sizes are and find your space hogs here: http://www.jam-software.com/freeware/index.shtml

As avast fully installed takes 900+ MB of space, I’m sure you can move user files to your other drive or back them up elsewhere. Do not touch Windows files, they need to be left where they are.

Generally, you can install Avast on a different drive. Parts will still be stored in ProgramData, but a significant part should be where you choose.
What path exactly are you trying to use? There are some checks to prevent dangerous cases (like installing the program into a root of a drive… which would be quite ugly if you tried to uninstall). Is D: a fixed drive?