//ie11 版本检测

import web.form;  
import web.form.util; 
import process;
import win.dlg.message;
import inet.installer;
import win;

namespace web.form;

class ie11{
	ctor(...){
		if(_WIN10_LATER || (..web.form.util.getMajorVersion() >= 11 ) ){
			return ..web.form(...); 
		}
		elseif( _WIN7_LATER ) {
		 	
			var url;
			var lcid = ::Kernel32.GetSystemDefaultLCID();
			if( lcid == 0x804 ){
				url = "http://download.microsoft.com/download/F/2/8/F2871AC4-E82B-4636-BB37-A5F2B14C8616/IE11-Windows6.1-x86-zh-cn.exe"
				if(_WIN_64){
					url = "http://download.microsoft.com/download/5/6/F/56FD6253-CB53-4E38-94C6-74367DA2AB34/IE11-Windows6.1-x64-zh-cn.exe"
				}	
			}
			elseif( lcid == 0xC04 ){
				url = "http://download.microsoft.com/download/7/8/8/788B10AB-C1D7-4DA9-BADF-2A939D769A43/IE11-Windows6.1-x86-zh-hk.exe"
				if(_WIN_64){
					url = "http://download.microsoft.com/download/5/1/C/51C47611-49D2-4791-B2DE-6DE0965B8ACC/IE11-Windows6.1-x64-zh-hk.exe"
				}	
			}
			elseif( lcid == 0x404 ){
				url = "http://download.microsoft.com/download/6/C/3/6C373F0D-F076-4947-93E5-DE787D45F695/IE11-Windows6.1-x86-zh-tw.exe"
				if(_WIN_64){
					url = "http://download.microsoft.com/download/2/9/6/2966291B-B5D3-4D57-842E-8DD2F1AB0BA1/IE11-Windows6.1-x64-zh-tw.exe"
				}	
			}
			elseif( lcid == 0x409 ){
				url = "http://download.microsoft.com/download/9/2/F/92FC119C-3BCD-476C-B425-038A39625558/IE11-Windows6.1-x86-en-us.exe"
				if(_WIN_64){
					url = "http://download.microsoft.com/download/7/1/7/7179A150-F2D2-4502-9D70-4B59EA148EAA/IE11-Windows6.1-x64-en-us.exe"
				}	
			}
			
			if(!..inet.installer("IE11",url,"/passive /norestart",..io.appData("aardio/ie11.exe")) ) return;
			
			if( ..web.form.util.getMajorVersion() >= 11){
				return ..web.form(...); 
			}
		}
		
		..win.dlg.message().frown('操作系统版本太旧，\r\n本程序仅支持 WIN7,WIN10,WIN10 ……');
	}; 
}

/**intellisense()
web.form.ie11( = 创建web窗体,基于系统自带 IE11 内核WebBrowser浏览器控件\nWIN 7,WIN 8 未安装 IE11 时将自动安装
web.form.ie11(.(winform,hostFlags,dlControl,userAgent,securityTrusted) = 创建Web窗体,可调用 IE11 内核浏览器控件加载网页,\n\n参数说明：\n@winform 可使用窗体或窗体上的控件对象\n@hostFlags 可使用一个或多个_UIFLAG_ 前缀的常量自定义外观,多个常量用位或操作符( | ) 连接\n@dlControl 可使用_DLCTL_前缀的常量以控制下载行为,多个常量用位或操作符( | ) 连接\n@userAgent 设置浏览器User Agent,\n@securityTrusted 是否信任打开的网页（服务器上避免弹出警告），默认值为true\n\n关于创建参数的更多说明,请参考《aardio使用手册->Web程序设计->创建Web窗体》
web.form.ie11() = !wb.
end intellisense**/