package com.mingsoft.servlet.install;

import java.io.File;
import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.mingsoft.constant.ArticleConstant;
import com.mingsoft.servlet.BaseServlet;

/**
 * @author 荣繁奎
 * @date:2013-11-10 下午05:30:36
 * @version : 用户注册 跳转
 * QQ:1096199590
 * 技术支持：铭飞科技
 * 官网：www.ming-soft.com
 */
@SuppressWarnings("serial")
public class InstallServlet extends BaseServlet {


	@Override
	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		super.doGet(request, response);
		String myPath = this.getServletContext().getRealPath(ArticleConstant.INSTALL_PATH);
	    File f = new File(myPath);
	    //判断用户是否已经安装过此软件
	    if(f.exists()){
	    	request.getRequestDispatcher("index.htm").forward(request, response);
	    }else{
	    	response.sendRedirect("installStepServlet?step=1");
	    }
	}
}
