For best results, you should add the logo in the portal before turning on Use logo file and before downloading or otherwise deploying the msi installation file. Doing so makes sure your logo is included correctly.

Refer to Branding tab under Windows Settings for more information.