opus.detect = Munch() def _detectOS(osPath): opus.main.output("detecting OS at " +osPath+ "...") osInfo = Munch() osInfo.version = Munch() osInfo.version.major = 0 osInfo.version.minor = 0 osInfo.tags = [] opus.reg.mount(pJoin(osPath,"Windows","System32","config","SOFTWARE")) osInfo.version.key = opus.reg.getKey(opus.reg.path + opus.reg.sep + "Microsoft" +opus.reg.sep+ "Windows NT" +opus.reg.sep + "CurrentVersion") opus.reg.unmount() try: osInfo.version.major = int(osInfo.version.key.CurrentMajorVersionNumber.value) osInfo.version.minor = int(osInfo.version.key.CurrentMinorVersionNumber.value) except: version = osInfo.version.key.CurrentVersion.value osInfo.version.major = int(version.split(".")[0]) osInfo.version.minor = int(version.split(".")[1]) osInfo.version.string = str(osInfo.version.major) + "." + str(osInfo.version.minor) if osInfo.version.string == "0.0": raise Exception("version unknown") opus.main.output("\ndetected: Windows NT " +osInfo.version.string,1) if osInfo.version.major > 5 and osInfo.version.major < 11: osInfo.tags.append("longhorn-series") if osInfo.version.string == "6.0": osInfo.tags.append("vista") if osInfo.version.string == "6.1": osInfo.tags.append("seven") if osInfo.version.string == "6.2": osInfo.tags.append("eight") if osInfo.version.string == "6.3": osInfo.tags.append("eightone"); osInfo.tags.append("nine") if osInfo.version.string == "10.0": osInfo.tags.append("ten") opus.main.output("tags: " +str(osInfo.tags),1) return osInfo opus.detect.os = _detectOS