Redmine #4633: Fix Windows bootstrapping

@jimis: 1st commit is for you!
@phnakarin: 2nd commit is for you!