As you aware, the Azure Directory Sync supports custom installation. For custom installation and configuration you need to extract the Microsoft Azure AD Connection Tool (MicrosoftAzureADConnectionTool.exe) installation medial first. There are few command line options supported as shown in the following screenshot:
To exact the Microsoft Azure AD Connection Tool installation media to a specific folder, you can run the MicrosoftAzureADConnectionTool.exe /T:C:DirectorySync /C command. All the extracted files will be in the C:DirectorySync folder.