//version 获取安装版本
import win.reg;
namespace dotNet.version;
	
getFrameworks = function(){  
	var vers = {};
	var reg = ..win.reg("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP")
	for(keyname,writetime in reg.eachKey() ){  
	
		if( ..string.match(keyname,"^v\d" ) ){
			var ver = {}
			vers[keyname] = ver;
			var regVer = reg.openReg(keyname); 
			ver.version = regVer.queryValue("Version");
			ver.sp = regVer.queryValue("SP");
			ver.installPath  = regVer.queryValue("InstallPath");
			if( ! ver.version ){
				var regClientVer  = regVer.openReg("Client",true); 
				if( regClientVer ){
					//安装了精简版
					ver.client = {
						version = regClientVer.queryValue("Version");
						sp = regClientVer.queryValue("SP");
						installPath  = regClientVer.queryValue("InstallPath");
					}
					regClientVer.close()
				}
				var regFullVer  = regVer.openReg("Full",true); 
				if( regFullVer ){
					ver.full = {
						version = regFullVer.queryValue("Version");
						sp = regFullVer.queryValue("SP");
						installPath  = regFullVer.queryValue("InstallPath");
					}
					regFullVer.close();
				}
				if( ! ( regClientVer || regFullVer ) ){
					vers[keyname] = null;
				}
			} 
			regVer.close();
		}
	}
	return vers; 
}

/**intellisense(dotNet.version)
getFrameworks() = 获取安装的.Net Framework版本信息列表
end intellisense**/