fun detect()

in plugin-unity-agent/src/main/kotlin/jetbrains/buildServer/unity/detectors/PEProductVersionDetector.kt [23:38]


    fun detect(executable: File): UnityVersion? {
        val version = PEUtil.getProductVersion(executable)

        if (version != null) {
            return UnityVersion(version.p1, version.p2, version.p3)
        }

        LOG.debug("unable to detect version via PEUtil, falling back to embedded tool")

        return try {
            detectWithEmbeddedTool(executable)
        } catch (e: Exception) {
            LOG.debug("Something went wrong during product version detection via embedded tool", e)
            null
        }
    }