Fix Generator.Detect to use System.Environment.OSVersion.Platform.