Issue #25144: Ensures TargetDir is set before continuing with custom install.