By default Docker installs to C:\Program Files\Docker\Docker and there is no option in the installer GUI to change the location. However we can change the location from command prompt. Below are the steps.

  1. Navigate to folder containing Docker Desktop Installer.exe from command prompt running as an administrator. Run the below command. This will also set the data directory as they can contain large data files.
start /w "" "Docker Desktop Installer 4.26.1.exe" install -accept-license ^
  --installation-dir="D:\Program Files\Docker\Docker" ^
  --wsl-default-data-root="D:\Program Files\Docker\wsl" ^
  --hyper-v-default-data-root="D:\Program Files\Docker\hyperv" ^
  --windows-containers-default-data-root="D:\Program Files\Docker\windowscontainers"

This will install Docker to D:\Program Files\Docker\Docker and data files to their respective folders.