<%@ Page Language="C#" enableEventValidation="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Mall-Z 多用户商城安装程序引导</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="cache-control" content="no-cache" />
		<meta name="author" content="" />
		<meta name="description" content="Mall-Z 多用户商城安装程序引导" />
		<style  type="text/css" rel="stylesheet">
		body, td, div { color:#333333; background:#F0F0F0; font-family:"宋体", tahoma, verdana, sans-serif; font-size:12px; line-height:20px; }
		strong { color:black; }
		table { background:#FFFFFF; }
		td { background:#FFFFFF; text-align:left; }
		input { font-family: "宋体", tahoma, verdana, sans-serif; font-size: 12px; }
		a { color: #2C78C5; text-decoration:none; }
		a:hover	{ color: #ff6600; text-decoration:underline; }
		form { margin: 0px; }
		.smallbox { height: 14px !important; height: 16px; border: 0px !important; }
		.t2	{ color: #c00; text-align:left; }
		</style>
		<script type="text/javascript" src="js/ajax.js"></script>
		<script type="text/javascript" src="js/guagebar.js"></script>
		<script type="text/javascript" language="javascript">
		// 安装向导
		var __SetupGuide__ = new function () {
			var _Step = 1;
			var _StepList = ['Step1', 'Step2', 'Step3', 'Step4'];
			var _Self = this;
			var successMsg="";

			// 执行第 step 步骤的操作
			function _DoStep(step, form)
			{
				if (step <= 0 || step > _StepList.length)
				{
				    if(step==0)
				    {
				        document.getElementById('SetupGuideContainer').style.display = 'none';
				        document.getElementById('selectaction').style.display = 'block';
				        return false;
				    }
				    else
					    return '没有第' + step + '步的操作！';
				}

				// 设置正常安装区域可见
				document.getElementById('SetupGuideContainer').style.display = 'block';
				// 设置错误信息提示区域不可见
				document.getElementById('ExceptionContainer').style.display = 'none';
				// 设置安装进度区域不可见
				document.getElementById('SetupGuageContainer').style.display = 'none';

				// 设置相应按钮可用
				form.elements['BtnPreviours'].disabled = false;
				form.elements['BtnNext'].disabled = false;
				form.elements['BtnCancel'].disabled = false;
				form.elements['BtnDosetup'].disabled = false;

				// 隐藏所有操作步骤
				for (var i = 0; i < _StepList.length - 1; i++)
				{
					document.getElementById(_StepList[i]).style.display = 'none';
				}
				// 显示当前操作步骤
				if (step > 0 && step < 4)	//	第4步为安装操作
				{
					document.getElementById('Step' + step).style.display = 'block';
				}

				// 当前操作步骤的其它判断
				switch (step)
				{
					case 1:
						form.elements['BtnPreviours'].style.display = 'none';
						form.elements['BtnNext'].style.display = '';
						form.elements['BtnDosetup'].style.display = 'none';
						break;
					case 2:
						form.elements['BtnPreviours'].style.display = '';
						form.elements['BtnNext'].style.display = '';
						form.elements['BtnDosetup'].style.display = 'none';
						// 填充商城地址
						_Self.FillAddress(form.elements['shopaddress']);
						break;
					case 3:
						form.elements['BtnPreviours'].style.display = '';
						form.elements['BtnNext'].style.display = 'none';
						form.elements['BtnDosetup'].style.display = '';

						//	检测商城目录
						var ajax = null, xml_http = null;
						try
						{
							ajax = new DvAjax();
							;
							xml_http = ajax.Request('get', form.elements['shopaddress'].value + 'install/install.aspx?action=shop_setup_directory_test&shopaddress='+form.elements['shopaddress'].value, null, null, true);
							;
							if ('OK' !== xml_http.responseText)
							{
								_Self.ShowError(xml_http.responseText);
								return false;
							}
						}
						catch ($e)
						{
							var $message = '';
							if ($e.message)
							{
								$message = $e.message;
							}
							else if ($e.description)
							{
								$message = $e.description;
							}
							else
							{
								$message = $e.toString();
							}
							_Self.ShowError('验证商城目录时发生错误：<br />' + $message);
							return;
						}
						finally
						{
							if (ajax)
							{
								ajax.Dispose();
								ajax = null;
							}
						}
						break;
					case 4:	// 执行安装
						_Dosetup(form);
						return false;
				}
				return true;
			}
			
			// 开始执行安装
			function _Dosetup(form, step)
			{
				// 禁用正常显示区域的操作按钮
				form.elements['BtnPreviours'].disabled = true;
				form.elements['BtnNext'].disabled = true;
				form.elements['BtnCancel'].disabled = true;
				form.elements['BtnDosetup'].disabled = true;

				// 设置正常安装区域不可见
				document.getElementById('SetupGuideContainer').style.display = 'none';
				// 设置错误信息提示区域不可见
				document.getElementById('ExceptionContainer').style.display = 'none';
				// 设置安装进度区域可见
				document.getElementById('SetupGuageContainer').style.display = 'block';

				document.getElementById('setupFinish').style.display = 'none';

				if (!step)
				{
					step = 1;
				}
				var allow = "";
				if(step == 2){
				    if(document.getElementById('newdata').checked!=true)
				        allow = "no";
				}
				else if(step == 3){
				    if(document.getElementById('default_class').checked!=true)
				        allow = "no";
				}
				else if(step == 4){
				    if(document.getElementById('experience_data').checked!=true)
				        allow = "no";
				}
				else if(step == 5){
				    if(document.getElementById('AdminDir').value=="" || document.getElementById('AdminDir').value=="admin")
				        allow = "no";
				}
				else if(step == 6){
				    if(document.getElementById('deleteinstall').checked!=true)
				        allow = "no";
				}
				var ajax = new DvAjax();
				form.action = form.shopaddress.value + 'install/install.aspx?step=' + step + "&allow=" + allow;
				ajax.SubmitForm(form, function (xmlHttp) {
					try
					{
						_Self.showmsg(xmlHttp.responseText);
						if(xmlHttp.responseText!="")
						    return false;
						if(step == 1)
						{
						    successMsg +="成功配置Web.Config文件<br/>"
							document.getElementById('setupinfo').innerHTML = '正在配置Web.Config,所需时间可能会较长,请耐心等候！...';
							document.getElementById('setupstatus').style.width = '20%';
							document.getElementById('setupFinish').style.display = 'none';
						}
						else if(step == 2 && document.getElementById('newdata').checked)
						{
						    successMsg +="成功创建数据库<br/>"
							document.getElementById('setupinfo').innerHTML = '正在创建数据库...';
							document.getElementById('setupstatus').style.width = '40%';
							document.getElementById('setupFinish').style.display = 'none';
						}
						else if(step == 3 && document.getElementById('default_class').checked)
						{
						    successMsg +="成功创建默认商品分类<br/>"
							document.getElementById('setupinfo').innerHTML = '正在创建默认商品分类...';
							document.getElementById('setupstatus').style.width = '40%';
							document.getElementById('setupFinish').style.display = 'none';
						}
						else if(step == 4 && document.getElementById('experience_data').checked)
						{
						    successMsg +="成功导入体验数据<br/>"
							document.getElementById('setupinfo').innerHTML = '正在导入体验数据...';
							document.getElementById('setupstatus').style.width = '80%';
							document.getElementById('setupFinish').style.display = 'none';
						}
						else if(step == 5 && document.getElementById('AdminDir').value!="" && document.getElementById('AdminDir').value!="admin")
						{
						     
							document.getElementById('setupinfo').innerHTML = '正在更新后台管理目录名称...';
							document.getElementById('setupstatus').style.width = '90%';
							document.getElementById('setupFinish').style.display = 'none';
							var adminDir=document.getElementById("AdminDir").value;
							if(adminDir!="" && adminDir!=null && adminDir!="hl_admin")
							{
							   successMsg +="成功更改后台管理目录名称为:"+adminDir+"<br/>";
							}
						}					
						else if(step == 6 && document.getElementById('deleteinstall').checked)
						{
							document.getElementById('setupinfo').innerHTML = '正在删除安装文件...';
							document.getElementById('setupstatus').style.width = '100%';
							successMsg +="成功删除安装文件<br/>";
						}
						if(step < 6)
				        {
				            step = step+1;
					        setTimeout(function () {
						        _Dosetup(form, step);
					        }, 100);
				        }
				        else
				        {
					        document.getElementById('SetupGuageContainer').style.display = 'none';
					        document.getElementById('setupFinish').style.display = 'block';
					        document.getElementById('success_setup_msg').innerHTML=successMsg;
				        }
					}
					catch ($e)
					{
						if(xmlHttp.responseText != "")
						{
							document.getElementById('SetupGuageContainer').style.display = 'none';
							document.getElementById('setupFinish').style.display = 'block';
							document.getElementById('delinfo').innerHTML = '警告：<br />' + xmlHttp.responseText;
						}
						else
						{
							_Self.ShowError("安装中断！");
						}
					}
					finally
					{
						xmlHttp.abort();
						ajax.Dispose();
					}
				}, true);
			};

			//显示安装信息
			this.showmsg = function (msg) {
				if(msg != "")
				{
					_Self.ShowError(msg);
				}
			};

			// 填充商城地址
			this.FillAddress = function (textBox) {
				textBox.value = window.location.href.split(/install\//gi)[0];
				document.getElementById('AddressLink').innerHTML = textBox.value;
			};

			// 我同意并接受版权声明
			this.ApplyLicence = function (chkbox) {
				chkbox.form.elements['BtnNext'].disabled = !chkbox.checked;
			};

			// 点击上一步按钮
			this.DoPreviours = function (form) {
				var result = _DoStep(_Step - 1, form);
				if (true === result)
				{
					_Step--;
				}
				else if (false !== result)
				{
					alert(result);
				}
			};
			
			// 点击下一步按钮
			this.DoNext = function (form) {
				var result = _DoStep(_Step + 1, form);
				if (true === result)
				{
					_Step++;
				}
				else if (false !== result)
				{
					alert(result);
				}
			};
			
			
			
			// 取消安装
			this.Cancel = function (form) {
				if (!confirm('您确定要退出安装程序吗？'))
				{
					return false;
				}
				if (document.all && !window.opener)
				{
					window.opener = '';
				}
				window.close();
			};
			
			// 显示错误信息
			this.ShowError = function (errMsg) {
				// 隐藏正常操作区域
				document.getElementById('SetupGuideContainer').style.display = 'none';
				// 显示错误信息提示区域
				document.getElementById('ExceptionContainer').style.display = 'block';
				// 设置安装进度区域不可见
				document.getElementById('SetupGuageContainer').style.display = 'none';
				// 显示错误信息
				document.getElementById('ExceptionMessage').innerHTML = errMsg;
			};
			
			// 发生错误后，重试
			this.RetryAfterError = function () {
				document.getElementById('ExceptionMessage').innerHTML = 'Retrying ... ';
				document.getElementById('setupstatus').style.width = '1%';
				setTimeout('__SetupGuide__.DoNext(document.forms[\'SetupForm\'])', 300);
			};

			//返回
			this.GoBackWhenError = function (form) {
				// 显示正常操作区域
				document.getElementById('SetupGuideContainer').style.display = 'block';
				document.getElementById('setupstatus').style.width = '1%';
				// 隐藏错误信息提示区域
				document.getElementById('ExceptionContainer').style.display = 'none';
				_DoStep(_Step, form);
			};

			// 将错误报告发送给mallz团队
			this.SendErrorReport = function (form) {
				alert('将错误报告发送给mallz团队！');
			};

			this.appPathSettingHelperSwitch = function (sender, target) {
				if (sender.innerHTML != '详细说明 ...')
				{
					sender.innerHTML = '详细说明 ...';
					target.style.display = 'none';
					return;
				}
				sender.innerHTML = '详细说明：';
				target.style.display = '';
			};
		};

		function DocumentOnLoad()
		{
			var form = document.getElementById('SetupForm');
			__SetupGuide__.ApplyLicence(form.elements['applylicence']);
			
		}
		function GoAdmin()
		{
		   var adminDir=document.getElementById("AdminDir").value;
		   if(adminDir!=null && adminDir!="")
		   {
		      window.location.href=document.getElementById('AddressLink').innerHTML+adminDir+"/admin_login.aspx";
		   }
		   else
		   {
		       window.location.href=document.getElementById('AddressLink').innerHTML+"admin/admin_login.aspx";
		   }
		   
		}
		function checkClass(obj)
		{
		   if(obj.checked)
		   {
		      document.getElementById("default_class").checked=true;
		   }
		}
		function CreateDirName()
		{
		   
		   var Seed= "a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9";
		   var Seed_array= Seed.split(" ");
		   var seedary="" ;
		   for (var i = 0; i < 5; i++)
           		{
              		seedary+=Seed_array[Math.round(Math.random( )*(Seed_array.length-1))]
           		}
           		return "admin";
           		//return seedary+"_admin";
		}
		
		function selectdiv(){
		    document.getElementById('selectaction').style.display='none';
		    var obj = document.all("RadioAction");
		    if(obj[0].checked){
		        document.getElementById('SetupGuideContainer').style.display='';
		    }else if(obj[1].checked)
		    {
		        document.getElementById('updatediv').style.display='';
		    }else if(obj[2].checked)
		    {
		        if(confirm("将恢复管理员帐号：admin，密码为：admin888，确定执行操作吗？"))
		        {
		            location.href = "install.aspx?action=rep";
		        }else{
		            document.getElementById('selectaction').style.display='';
		        }
		    }
		}
		function opendir(){
		    window.open("install.aspx?action=Dir","dir","width=300px,height=200px");
		}
		</script>
<script language="C#" runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }
    
    
        /// <summary>
        /// 是否可改后台目录
        /// </summary>
        private string IsEbledAdminDir
        {
            get {
                string m_oldpath = HttpContext.Current.Server.MapPath("~/") + "\\Admin";
                if (!System.IO.Directory.Exists(m_oldpath))
                    return "disabled";
                else
                    return "";
            }
        }
        
        private void UpdateSystem(object sender, EventArgs e)
        {
            string lockfile = HttpContext.Current.Server.MapPath("~/") + @"\Install\" + UpdateDir.Text + @"\lock.txt";
            MallZ.Install.Install install = new MallZ.Install.Install();
            install.UpPath = @"\Install\"+UpdateDir.Text;
            if (System.IO.File.Exists(lockfile))
            {
                UpdateMsg.Text = "<font color=red>你曾经执行了升级，如确实需要再次执行该升级，请手动删除文件： <br/>" + lockfile + "</font>";
                Page.RegisterStartupScript("show", "<scrip" + "t>document.getElementById('selectaction').style.display='none';document.getElementById('updatediv').style.display='';document.getElementById('Btnok').disabled=false;document.getElementById('Btnup').disabled=true;</scrip" + "t>");
                return;
            }
            try
            {
                install.UpShopConfig();
                install.UpSiteConfig();
                install.UpLanguage();
                install.UpDataBase();
                try
                {
                    using (System.IO.StreamWriter writer = new System.IO.StreamWriter(lockfile, true))
                    {
                        writer.Write("最后执行时间：" + DateTime.Now.ToString());
                    }
                }
                catch { }
            }
            catch (Exception ex){
                UpdateMsg.Text = ex.Message;
                Page.RegisterStartupScript("show", "<scrip" + "t>document.getElementById('selectaction').style.display='none';document.getElementById('updatediv').style.display='';document.getElementById('Btnok').disabled=false;document.getElementById('Btnup').disabled=true;</scrip" + "t>");
                return;
            }
            UpdateMsg.Text = "<font color=red>系统成功升级到版本：" + UpdateDir.Text + "</font>";
            Page.RegisterStartupScript("show", "<scrip" + "t>document.getElementById('selectaction').style.display='none';document.getElementById('updatediv').style.display='';document.getElementById('Btnok').disabled=false;document.getElementById('Btnup').disabled=true;</scrip" + "t>");
        }
    </script>
</head>
<body style="text-align:center" onload="DocumentOnLoad()">
    <form name="SetupForm" id="setupform" method="post" runat="server">
			<span style="text-align:left; width:760px; height:28px; padding-left:20px; line-height:28px; position: relative; top:10px; background:#3872B2;border : 1px solid #999 !important;border : 2px outset transparent; border-bottom:0px !important; border-bottom:0px;display:block; margin:0 auto;">
				<strong style="font-size:12px; color:#fff;">Mall-Z 多用户商城安装程序引导</strong></span><span style="text-align:left; width:760px; height:82px; padding-left:20px; position:relative; top:10px; background:#F2FAFD url(images/setup.jpg) no-repeat;border : 1px solid #999 !important;border : 2px outset transparent; border-bottom:0px !important; border-top:0px !important; border-bottom:0px; border-top:0px;display:block; margin:0 auto;"></span>
			<div id="selectaction">
			    <div  style="width:760px; line-height:30px; background:#FFFFFF; margin:auto; padding:10px;border : 1px solid #999 !important;border : 2px outset transparent; border-bottom:0px !important; text-align:left; border-bottom:0px; display: block;">
			        <b>欢迎使用商城安装向导</b><br />
			        &nbsp;&nbsp;&nbsp;&nbsp;请选择你需要的操作：
			    </div>
			    <div style="width:760px; background:#FFFFFF; padding:10px;border-right : 1px solid #999 !important;border-left : 1px solid #999 !important; height:100px; text-align:left;">
                    <div style="padding-left:120px;background:#FFFFFF;line-height:30px; ">
                    <input name="RadioAction" type="radio" checked="checked" />全新安装<br />
                    <input name="RadioAction" type="radio" />程序升级<br />
                    <input name="RadioAction" type="radio" />恢复管理帐号密码
                    </div>
			    </div>
			    <div id="Div2" style="width:760px; background:#ddd; margin:auto; padding:10px; border : 1px solid #999 !important;border : 2px outset transparent; display: block;">
                    <input id="Button1" type="button" value="下一步" style="padding:2px 4px;" onclick="return selectdiv()" /> 
                </div>
			</div>
			
			<!-- 升级步骤参数配置区域开始 -->
			<div id="updatediv" style="display:none;">
			    <div style="width:760px; background:#FFFFFF;margin:auto; padding:10px;border : 1px solid #999 !important;border : 2px outset transparent; border-bottom:0px !important; border-bottom:0px; display: block;">
			        <div style="width:760px; line-height:30px; text-align:left; background:#FFFFFF; margin:auto;">
			        <b>请选择升级包目录</b></div>
			        <div style="background:#FFFFFF; height:50px; padding-top:50px;">
			        升级包目录：
                        <asp:TextBox ID="UpdateDir" Width="300px" runat="server"/>
                    <input id="Button3" type="button" value=" 浏 览 " onclick="return opendir()" /><br />
                    <asp:Label ID="UpdateMsg" runat="server" />
                    </div>
			    </div>
			    <div id="Div3" style="width:760px; background:#ddd; margin:auto; padding:10px; border : 1px solid #999 !important;border : 2px outset transparent; display: block;">
                    <asp:Button ID="Btnup" runat="server" style="padding:2px 4px;" Text=" 升 级 " OnClick="UpdateSystem"/>
                    <input type="button" name="BtnCancel2" value=" 返 回 " style="padding:2px 4px;" onclick="javascript:{document.getElementById('selectaction').style.display='';document.getElementById('updatediv').style.display='none';}" />
                    <input type="button" name="BtnCancel2" id="Btnok" value=" 完 成 " style="padding:2px 4px;" disabled onclick="if(confirm('确定退出安装向导吗？'))window.close();return false;" />
                </div>
			</div>
			<!-- 升级步骤参数配置区域开始 -->
			
			<div id="SetupGuideContainer" style="display: none;">
				<!-- 安装步骤参数配置区域开始 -->
				<div style="width:760px; background:#FFFFFF; margin:auto; padding:10px;border : 1px solid #999 !important;border : 2px outset transparent; border-bottom:0px !important; border-bottom:0px; display: block;">
					<table align="center" width="100%" cellpadding="8" cellspacing="0" id="maintable" style="table-layout:fixed;overflow:hidden;">
						<tr>
							<td>
								<span>
									<b>本程序将协助您安装
										<span class="t2">Mall-Z多用户商城系统 </span>
										，请仔细阅读并按照从上往下顺序一步步进行</b>
									<br />
									1、必须允许客户端脚本才能正常使用本文件
									<br />
									2、必须同意并接受安装许可条款才可进行安装操作
									<br />
									3、若中途出现差错，请重整之后重新进行
									<br />
									4、<span style='color:red'>安装完成后将会自动删除安装文件,若不能删除请手动删除</span>
									<br />
                                    5、<span style='color:red'>安装前若没有数据库请先新建数据库,若原来已有数据库请手动备份数据库</span>
									<br />
								</span>
							</td>
						</tr>
					</table>
					<!-- Start Step 1  -->
					<div id="Step1" style="display: block;">
						<table align="center" width="100%" cellpadding="8" cellspacing="0" id="Table1" style="table-layout:fixed;overflow:hidden;">
							<tr id="apply_row">
								<td style="padding-left:25px">
									<strong>
										<span class="t2">→</span>
										请先阅读使用许可及遵守条款</strong>
									<br />
									<input type="checkbox" name="applylicence" id="applylicence" class="smallbox" value="1"
										onclick="__SetupGuide__.ApplyLicence(this);" /><label for="applylicence" class="t2">我同意并接受</label><a href="licence.html" target="_blank">《版权声明、使用许可及遵守条款》</a>
									<br />
								</td>
							</tr>
							<tr>
								<td style="padding-left:25px" nowrap="nowrap">
									<strong>
										<span class="t2">→</span>
										配置环境及IIS虚拟目录</strong>
									<br />
									配置.NET环境，并填写访问商城的地址。
									<br />
									环境条件:
									<br />
									1、操作系统须为Win2000/XP/2003，须已安装IIS Web服务 (从Windows组件中安装IIS)
									<br />
									2、须已安装.NET Framework 2.X<a href="http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe"
										target="_blank">(下载该安装程序)</a>或.NET Framework 3.0<a href="http://download.microsoft.com/download/4/d/a/4da3a5fa-ee6a-42b8-8bfa-ea5c4a458a7d/dotnetfx3setup.exe"
										target="_blank">(下载该安装程序)</a>
									<br />
									3、使用SQL Server数据库，确保服务已开启
									<br />
									4、需要为商城应用程序配置IIS站点或虚拟目录，并确定商城的访问地址(http://形式) <a id="iishelper" href="javascript:void(__SetupGuide__.appPathSettingHelperSwitch(iishelper, iishelpercontent));">
										详细说明 ...</a>
									<br />
									<span id="iishelpercontent" style="color:#555555; display:none;">
									　　· 将商城文件夹设为IIS的站点根目录，可直接访问: http://站点名/<br />
									　　· 为商城文件夹在IIS站点根目录下创建虚拟目录，则访问: http://站点名/虚拟目录名/<br />
									　　· 将商城文件夹作为IIS站点根目录的子目录，但不设虚拟目录，需要把商城中的bin文件夹剪切<br />
									　　<span style="color:white">· </span>移动(不要复制)到IIS站点根目录，此时可访问地址: http://站点名/商城文件夹名/<br />
									　　· 若本地调试，默认站点名可用localhost代替；若非本地调试，则将站点名换作域名
									<br />
									</span>
									5、需要为商城文件所在的文件夹开启必要的权限 <a id="dirhelper" href="javascript:void(__SetupGuide__.appPathSettingHelperSwitch(dirhelper, dirhelpercontent));">
										详细说明 ...</a>
									<br />
									<span id="dirhelpercontent" style="color:#555555; display:none">
									　　· 以下权限要求均针对.NET进程用户，Win2k为ASPNET，Win2003为iis_wpg用户组<br />
									　　· web.config<br />
									　　· 商城中的App_Data目录及其子目录是数据存放目录，必须具有可写权限<br />
									　　· 商城中的Template,Skin,Specail,Label,Ad 须具有可写权限<br />
									　　· UploadFile需要有文件夹创建权限，用于上传文件时按日期创建文件夹<br />
									</span>
								</td>
							</tr>
						</table>
					</div>
					<!-- End Step 1  -->
					<!-- Start Step 2  -->
					<div id="Step2" style="display: none;">
						<table align="center" width="100%" cellpadding="8" cellspacing="0" id="Table2" style="table-layout:fixed;overflow:hidden;">
							<tr>
								<td style="padding-left:45px">
									<strong>
										<span class="t2">→</span>
										环境配置及目录设置检测</strong>
									<br />
									同意许可条款并完成以上环境设置后，请输入您商城的地址并进行检测:
									<br />
									<input type="text" id="shopaddress" name="shopaddress" style="width:275px" value="http://" />
									&nbsp; &nbsp;
									<span id="verifyresult"><br />(不要加index.aspx, 如: <a href="javascript:void(__SetupGuide__.FillAddress(document.forms['SetupForm'].elements['shopaddress']))"
											id="AddressLink" title="点击可代替输入">http://localhost/</a>)</span>
								</td>
							</tr>
						</table>
					</div>
					<!-- End Step 2  -->
					<!-- Start Step 3  -->
					<div id="Step3" style="display: none;">
						<table align="center" width="100%" cellpadding="8" cellspacing="0" id="Table3" style="table-layout:fixed;overflow:hidden;">
							<tr>
								<td style='padding-left:45px'>
									<strong>
										<span class='t2'>→</span>
										设置Ms SQlServer数据库</strong>
									<br />									
									<div>
										<div id="inputconnstr" style='margin:5px 0px 0px 5px;display:;'>
											服务器: <input type='text' id='server' name='server' value='(local)' style='width:100px' />
											&nbsp; &nbsp;(SQL服务器的地址)
											<br />
											数据库: <input type='text' id='dbname' name='dbname' value="" style='width:100px' />
											&nbsp; &nbsp;<span class='t2'>请用SQL Server企业管理器建立空数据库，并将数据库名填入该项</span>
											<br />
											用户名: <input type='text' id='uid' name='uid' value='' style='width:100px' /> &nbsp; 
											&nbsp;(数据库用户名)
											<br />
											密&nbsp; 码: <input type='password' id='pwd' name='pwd' style='width:100px' value="" />
											&nbsp; &nbsp;(数据库密码)<br /> 
											表前缀: <input type='text' id='prefix' name='prefix' value='MZ_' style='width:100px' /> &nbsp; 
											&nbsp;(数据库表前缀)
										</div>
									</div>
								</td>
							</tr>
							<tr>
								<td style="padding-left:45px">
									<strong>
										<span class="t2">→</span>
										新创建数据库</strong>
									<br />
									 全新创建数据库结构，如果该数据库已存在，则会覆盖原来的数据库（请注意做好数据库备份）。
									<br />
									<input type="checkbox" id="newdata" name="newdata" checked value="1" onclick="checkClass(this)"/><label for="newdata">创建数据结构</label>
									
								</td>
							</tr>
							<tr>
								<td style="padding-left:45px">
									<strong>
										<span class="t2">→</span>
										安装默认商品分类</strong>
									<br />
									安装系统默认商品分类,默认分类为一般商城的商品分类设置
									<br />
									<input type="checkbox" id="default_class" name="default_class" checked value="1"/><label for="default_class">安装默认商品分类</label>
									
								</td>
							</tr>
							<tr style="display:none;">
								<td style="padding-left:45px">
									<strong>
										<span class="t2">→</span>
										安装体验数据</strong>
									<br />
									 体验数据是包括商城文章,商品,用户,广告和一些图片,让用户可以马上体验商城的功能
									<br />
									<input type="checkbox" id="experience_data" name="experience_data" value="1" onclick="checkClass(this)"/><label for="experience_data">安装体验数据</label>(注:安装体验数据须安装默认分类)
									
								</td>
							</tr>
							<tr>
								<td style="padding-left:45px">
									<strong>
										<span class="t2">→</span>
										设置管理后台目录名称</strong>
									<br />
									更改后台目录名称,有助于抵挡非法用户直接进入管理后台进行暴力破解或其它非法操作.
									<br />
									后台管理目录名:<input type="text" id="AdminDir" <%= IsEbledAdminDir %> name="AdminDir" value="" style="width:100px" />请填写一个不规则无语义的名称如"8dF_admin"
									
								</td>
							</tr>
							<tr>
								<td style="padding-left:45px">
									<strong>
										<span class="t2">→</span>
										删除安装文件</strong>
									<br />
									安装成功后删除安装文件,若不能删除请手动删除.<br/>
									删除安装文件，防止他人非法利用。
									<br />
									<input type='checkbox' id='deleteinstall' checked="checked" value="1" name='deleteinstall' /><label for="deleteinstall">删除安装文件</label>
								</td>
							</tr>
							<tr>
								<td style="padding-left:45px">
									<span class="t1">启动.NET进程可能需要几秒钟，请耐心等候不要重复提交</span>
								</td>
							</tr>
						</table>
					</div>
					<!-- End Step 3  -->
				</div>
				<!-- 安装步骤参数配置区域结束 -->
				<!-- 安装步骤操作按钮区域开始 -->
				<div id="StepBtn_Container" style="width:760px; background:#ddd; margin:auto; px; padding:10px;border : 1px solid #999 !important;border : 2px outset transparent; display: block;">
					<table align="center" width="100%" cellpadding="8" cellspacing="0" id="Table4" style="table-layout:fixed;overflow:hidden; background:#ddd;">
						<tr id="Tr1" style="background:#ddd;">
							<td style="padding-left: 25px; padding-right: 50px; background:#ddd; text-align: right; ">
								<input type="button" name="BtnPreviours" id="BtnPreviours" value=" 上一步 " style="padding:2px 4px; ;"
									onclick="__SetupGuide__.DoPreviours(this.form)" />
						       <input type="button" disabled="disabled" name="BtnNext" id="BtnNext" value=" 下一步 " style="padding:2px 4px;"
									onclick="__SetupGuide__.DoNext(this.form)" />
							   <input type="button" name="BtnDosetup" id="BtnDosetup" value=" 安 装 " style="padding:2px 4px; display: none;"
									onclick="__SetupGuide__.DoNext(this.form);" /> 
							    <input type="button" name="BtnCancel" value=" 取 消 " style="padding:2px 4px;" onclick="__SetupGuide__.Cancel(this.form);" />
							</td>
						</tr>
					</table>
				</div>
				<!-- 安装步骤操作按钮区域开始 -->
			</div>
			<!-- 安装进度显示区域开始 -->
			<div id="SetupGuageContainer" style="display: none;">
				<!-- 安装步骤操作按钮区域开始 -->
				<div id="Div1" style="width: 780px; height: auto; background: #ddd; margin: auto; padding: 0px; border: 1px solid #999 !important; border: 2px outset transparent; display: block;">
					<table align="center" width="98%" cellpadding="3" cellspacing="0" style="table-layout:fixed; overflow:hidden; background:#dddddd; margin-left: 10px;">
						<tr>
							<td style="background: transparent; padding: 0px;">&nbsp;</td>
						</tr>
						<tr>
							<td style="padding: 0px; background: #ddd; height: 24px;">
								<div id="setupinfo" style="padding: 0px; background: #ddd; height: 24px;">
									正在执行安装，请稍候……</div>
							</td>
						</tr>
						<tr>
							<td style="padding: 0px; margin: auto; background: transparent; height: 30px;">
								<div style="width: 98%; border: 2px inset; background-color: white; height: 20px; padding: 3px;">
									<div id="setupstatus" style="background-color: blue; height: 100%; width: 10%; text-align: center;"></div>
								</div>
							</td>
						</tr>
						<tr>
							<td style="padding-top: 50px; height: 250px; background-color: #ddd; vertical-align: top;">&nbsp;</td>
						</tr>
					</table>
				</div>
				<!-- 安装步骤操作按钮区域开始 -->
				<div style="clear: both;"></div>
			</div>
			<!-- 安装进度显示区域结束 -->
			<!-- 安装完成显示区域开始 -->
			<div id="setupFinish" style="display: none;">
				<!-- 安装信息文字区域开始 -->
				<div style="width: 760px; background: #FFFFFF; margin: auto; padding: 10px; border: 1px solid #999 !important; border: 2px outset transparent; border-bottom: 0px !important; border-bottom: 0px; padding-top: 10px; height: auto;">
					<div style="background-color: white; margin: auto; width: 95%; height: 300px !important; height: 300px; overflow-x: hidden; padding: 5px; margin-top: 20px;">
						<table>
							<tr align="center">
								<td>恭喜您，商城已经成功安装。
								</td>
							</tr>
							<tr align="center">
								<td>
								  <span id="success_setup_msg"></span>
							  </td>
							</tr>
							<tr>
								<td><a href='../index.aspx' target="_blank">打开首页</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:{GoAdmin();}" >登录后台</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/stall.txt" target="_blank">查看日志</a></td>
							</tr>
							<tr align="left">
								<td>Copyright 2005 - <script>var d = new Date();document.write(d.getYear())</script> <a href="http://www.Mall-Z.COM/">Mall-Z.COM</a>, All Rights 
									Reserved.<br />
									版本：Mall-Z系列
								</td>
							</tr>
							
							<tr>
								<td style="padding: 0px; height: 24px;">
									<div id="delinfo" style="padding: 0px; height: 24px;">
									后台管理员初始帐号：admin，初始密码：admin888
									</div>
								</td>
							</tr>
						</table>
					</div>
					<div style="clear: both;"></div>
				</div>
				<!-- 安装信息文字区域结束 -->
				<!-- 安装信息操作按钮区域开始 -->
				<div id="" style="width:760px; background:#ddd; margin:auto; padding:10px;border : 1px solid #999 !important;border : 2px outset transparent;">
					<table align="center" width="100%" cellpadding="8" cellspacing="0" id="Table5" style="table-layout: fixed; overflow: hidden; background: #ddd;">
						<tr style="background:#ddd;">
							<td style="padding-left: 25px; padding-right: 50px; background:#ddd; text-align: right; ">
								<input type="button" name="" value=" 完 成 " style="padding:2px 4px;" onclick="window.close()" />
							</td>
						</tr>
					</table>
				</div>
				<!-- 安装信息操作按钮区域结束 -->
			</div>
			<!-- 安装完成显示区域开始 -->
			<!-- 错误信息区域开始 -->
			<div id="ExceptionContainer" style="display: none;">
				<!-- 错误信息文字区域开始 -->
				<div style="width: 760px; background: #FFFFFF; margin: auto; padding: 10px; border: 1px solid #999 !important; border: 2px outset transparent; border-bottom: 0px !important; border-bottom: 0px; padding-top: 10px; height: auto;">
					<div style="text-align: left; background-color: white; margin: auto; width: 95%; height: 220px !important; height: 250px; border-style: inset; border-width: 2px; overflow: auto; padding: 5px; margin-top: 20px;">
						<table border="0" cellpadding="0" cellspacing="0" height="95%" width="100%" class="FinishMessage">
							<tr>
								<td align="left" valign="top" height="70%">
									<div id="ExceptionMessage" style="background-color: Transparent; padding: auto; margin: auto; line-height: normal;">
									</div>
								</td>
							</tr>
						</table>
					</div>
					<div style="clear: both;"></div>
				</div>
				<!-- 错误信息文字区域结束 -->
				<!-- 错误信息操作按钮区域开始 -->
				<div id="Btn_ExceptoinContainer" style="width:760px; background:#ddd; margin:auto; padding:10px;border : 1px solid #999 !important;border : 2px outset transparent;">
					<table align="center" width="100%" cellpadding="8" cellspacing="0" id="Table6" style="table-layout: fixed; overflow: hidden; background: #ddd;">
						<tr style="background:#ddd;">
							<td style="padding-left: 25px; padding-right: 50px; background:#ddd; text-align: right; ">							
								<input type="button" name="BtnPreviours2" id="BtnPreviours2" value=" 返 回 " style="padding:2px 4px;"
									onclick="__SetupGuide__.GoBackWhenError(this.form)" /> <input type="button" name="BtnRetry" id="BtnRetry" value=" 重 试 " style="padding:2px 4px;"
									onclick="__SetupGuide__.RetryAfterError(this.form);" /> <input type="button" name="BtnCancel2" value=" 取 消 " style="padding:2px 4px;" onclick="__SetupGuide__.Cancel(this.form);" />
							</td>
						</tr>
					</table>
				</div>
				<!-- 错误信息操作按钮区域结束 -->
			</div>
			<!-- 错误信息区域结束 -->
		</form>
		<script type="text/javascript">
		//document.getElementById("AdminDir").value= CreateDirName();
	</script>
</body>
</html>
