index.jsp.150630 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <%@ page language="java" contentType="text/html; charset=euc-kr"%>
  2. <%
  3. String domainName = request.getScheme()+"://"+ request.getServerName() + ":" + request.getServerPort();
  4. String systemName = request.getScheme()+"_"+ request.getServerName() + "_" + request.getServerPort();
  5. // 서버이름 가져오기
  6. String serverName = request.getServerName();
  7. /*
  8. // 서버이름 별로 아이콘이름 지정하기
  9. String iconName = "SCH LOCAL";
  10. // 아이콘 표시여부
  11. boolean iconShow = true;
  12. // 운영서버
  13. if ("hisx031.knuh.kr".equals(serverName)) // 운영
  14. {
  15. iconName = "SCH 운영 (XP)";
  16. iconShow = true;
  17. }
  18. // 교육서버
  19. else if("edu.knuh.kr".equals(serverName)) //개발
  20. {
  21. iconName = "SCH EDU (XP)";
  22. iconShow = true;
  23. }
  24. // 전환검증서버
  25. else if("rmig.knuh.kr".equals(serverName)) //검증
  26. {
  27. iconName = "SCH RMIG (XP)";
  28. iconShow = true;
  29. }
  30. // 전환서버
  31. else if ("mig.knuh.kr".equals(serverName)) // 운영
  32. {
  33. iconName = "SCH MIG (XP)";
  34. iconShow = true; // 운영일경우에만 아이콘 생성
  35. }
  36. // 개발서버
  37. else if ("dev.knuh.kr".equals(serverName)) //개발
  38. {
  39. iconName = "SCH DEV (XP)";
  40. iconShow = true;
  41. }
  42. */
  43. // 서버이름 별로 아이콘이름 지정하기
  44. String iconName = "KNUX LOCAL";
  45. // 아이콘 표시여부
  46. boolean iconShow = true;
  47. // 본원운영서버
  48. if ("hisx031.knuh.kr".equals(serverName)) // 운영
  49. {
  50. iconName = "KNUX 본원운영";
  51. iconShow = true;
  52. }
  53. // 본원교육서버
  54. else if("hisx031edu.knuh.kr".equals(serverName)) //교육
  55. {
  56. iconName = "KNUX 본원교육";
  57. iconShow = true;
  58. }
  59. // 칠곡운영서버
  60. else if("hisx032.knuh.kr".equals(serverName)) //운영
  61. {
  62. iconName = "KNUX 칠곡운영";
  63. iconShow = true;
  64. }
  65. // 칠곡교육서버
  66. else if ("hisx032edu.knuh.kr".equals(serverName)) // 교육
  67. {
  68. iconName = "KNUX 칠곡교육";
  69. iconShow = true;
  70. }
  71. // MIS운영서버
  72. else if ("misx030.knuh.kr".equals(serverName)) // 운영
  73. {
  74. iconName = "KNUX MIS운영";
  75. iconShow = true;
  76. }
  77. // MIS교육서버
  78. else if ("misx030edu.knuh.kr".equals(serverName)) // 교육
  79. {
  80. iconName = "KNUX MIS교육";
  81. iconShow = true;
  82. }
  83. %>
  84. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  85. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  86. <HTML xmlns="http://www.w3.org/1999/xhtml">
  87. <HEAD>
  88. <meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
  89. <meta http-equiv="X-UA-Compatible" content="requiresActiveX=true">
  90. <TITLE>HIMED2 Install Page</TITLE>
  91. <SCRIPT LANGUAGE="javascript">
  92. var sKey = "<%=systemName%>";
  93. var Server_Path = "<%=domainName%>";
  94. var bOnError = false;
  95. var XPLATFORM_CAB_VER = "2015,6,23,1";
  96. function window::onLoad() {
  97. TFSmartUpdater.protectSystemMenu(1);
  98. }
  99. function fn_load() {
  100. if(bOnError == false) {
  101. if(setComponentsInstall()) {
  102. fn_launch();
  103. fn_close();
  104. }
  105. }
  106. }
  107. function fn_close() {
  108. if(navigator.appVersion.indexOf("MSIE 7.") >= 0 || navigator.appVersion.indexOf("MSIE 8.") >= 0 ||
  109. navigator.appVersion.indexOf("MSIE 9.") >= 0 || navigator.appVersion.indexOf("MSIE 10.") >=0 ||
  110. navigator.appVersion.indexOf("Trident") >= 0 ) {
  111. window.open('about:blank','_self').close();
  112. } else {
  113. window.opener = self;
  114. self.close();
  115. }
  116. }
  117. function checkOS()
  118. {
  119. var strOS = "XP";
  120. if( navigator.appVersion.indexOf("Windows NT 6.2") != -1)
  121. strOS = "WIN8";
  122. else if( navigator.appVersion.indexOf("Windows NT 6.1") != -1)
  123. strOS = "WIN7";
  124. else if( navigator.appVersion.indexOf("Windows NT 6.0") != -1)
  125. strOS = "VISTA";
  126. else if( navigator.appVersion.indexOf("Windows 98") != -1)
  127. strOS = "98";
  128. else if( navigator.appVersion.indexOf("Windows NT 5.0") != -1)
  129. strOS = "2000";
  130. else if( navigator.appVersion.indexOf("Windows NT 5.2") != -1)
  131. strOS = "XP";
  132. else if( navigator.appVersion.indexOf("Windows NT 5.1") != -1)
  133. strOS = "XP";
  134. return strOS;
  135. }
  136. function fn_objectOnError() {
  137. bOnError = true;
  138. }
  139. function fn_launch() {
  140. XPLauncher.version = "9.2.1"; //XPLauncher 설정 상단에 위치해야 함.
  141. // XPLauncher.splashimage = Server_Path+"/install/loading_img.gif";
  142. XPLauncher.xadl = Server_Path + "/himed/xpapps/himed2.xadl";
  143. //XPLauncher.loadingimage = Server_Path + "/Images/img_loading.gif";
  144. //XPLauncher.splashimage = Server_Path + "/Images/trans.gif";
  145. XPLauncher.onlyone = false;
  146. if(checkOS() == "WIN8")
  147. {
  148. XPLauncher.componentpath = "%USERAPPLOCAL%";
  149. }
  150. /*
  151. <% if(iconShow == true) { %>
  152. XPLauncher.makeshortcut("<%=iconName%>",Server_Path + "/himed/install/EMR.ico","desktop");
  153. <% } %>
  154. */
  155. XPLauncher.launch();
  156. }
  157. function fn_download()
  158. {
  159. location.href = "./install/TobeSoft/XPlatform/XPLATFORM9.2.1_SetupEngine.exe";
  160. }
  161. function setComponentsInstall(){
  162. var result = false;
  163. try {
  164. //환경 변수 설정
  165. TFSmartUpdater.setCustomDir("{server}", Server_Path+"/himed/install" );
  166. TFSmartUpdater.setCustomDir("{client}", "C:\\\himed\\components" );
  167. TFSmartUpdater.setCustomDir("{systemdir}", "C:\\WINDOWS\\system32" );
  168. TFSmartUpdater.setCustomDir("{systemurl}", Server_Path + "/himed" );
  169. TFSmartUpdater.setCustomDir("{syswow64}", "C:\\WINDOWS\\SysWOW64" );
  170. TFSmartUpdater.setCustomDir("{ieoption}", "-nomerge ");
  171. //다운받을 파일의 목록인 jsp 파일의 경로를 넣어줌...
  172. var ret = TFSmartUpdater.getConfig(Server_Path+"/himed/install/config/configXP.jsp");
  173. if (ret == true)
  174. {
  175. TFSmartUpdater.ChangeWindowState(8);
  176. result = true;
  177. }else{
  178. deleteCookie();
  179. alert( "구성요소 설치 중 오류가 발생했습니다.\n\n사용중인 브라우저를 모두 닫고 다시 시도하시기 바랍니다." );
  180. }
  181. } catch(e) {
  182. deleteCookie();
  183. alert( "TFSmartUpdater가 설치되지 않았습니다. 설치후 진행하십시오." );
  184. } finally {
  185. return result;
  186. }
  187. }
  188. // 현재 모니터의 해상도를 구해서 적절한 nU 메인창의 크기를 구한다..
  189. function getOptimizeResolution() {
  190. var resol = new Array(2);
  191. resol[0] = screen.width;
  192. resol[1] = screen.height;
  193. // 기준 해상도 1280 * 1024 보다 큰 경우는 1280 * 1024 를 기준으로, 작으면 작은 것 기준으로
  194. if (resol[0] > 1280) {
  195. resol[0] = 1280;
  196. }
  197. if (resol[1] <= 1024) {
  198. resol[1] = resol[1] - 34; // 작업표시줄 영역빼기.
  199. } else if (resol[1] > 1024) {
  200. resol[1] = 1024 - 34;
  201. }
  202. return resol;
  203. }
  204. // 쿠키삭제
  205. function deleteCookie()
  206. {
  207. var cookieName = "HIS";// 쿠키명은 설정 정보에서 가져도록 고치자.
  208. //쿠키 소멸 날짜를 어제 날짜로 설정한다.
  209. var expireDate = new Date();
  210. expireDate.setDate( expireDate.getDate() - 1 );
  211. setCookie(cookieName,"",expireDate,"/",".knu.ac.kr");
  212. //alert(document.cookie);
  213. }
  214. function setCookie(name, value, expires, path, domain, secure) {
  215. var curCookie = name + "=" + escape(value) +
  216. ((expires) ? "; expires=" + expires.toGMTString() : "") +
  217. ((path) ? "; path=" + path : "") +
  218. ((domain) ? "; domain=" + domain : "") +
  219. ((secure) ? "; secure" : "");
  220. document.cookie = curCookie;
  221. }
  222. function TrustFormSmartUpdater(id, codebase, width, height)
  223. {
  224. var obj="";
  225. obj=obj+ "<OBJECT id='"+id+"' CLASSID='CLSID:ED5D862B-6A06-46DE-A929-F2C588742CBD' codebase='"+codebase+"' width='"+width+"' height='"+height+"'>";
  226. obj=obj+ "<PARAM name='deleteZipFile' value='true'/>"; // zip 파일을 지운다
  227. obj=obj+ "<PARAM name='registry' value='false'/>"; // registry를 이용하지 않는다.
  228. obj=obj+ "<PARAM name='configDir' value='C:\\\himed'/>"; // config 파일이 저장될 local 경로를 설정
  229. obj=obj+ "<PARAM name='enableLog' value ='true' />"; // log를 남긴다.
  230. obj=obj+ "<PARAM name='selfUi' value ='true' />"; // 자체 UI를 이용한다.
  231. obj=obj+ "<PARAM name='dlgNotClose' value='true' />"; // UI를 하나의 dialog로 사용한다.
  232. obj=obj+ "<PARAM name='fileinuse_hidden' value='skip'/>"; // FileInUse Dialog에서 button을 hidden 할 지 여부
  233. obj=obj+ "<PARAM name='deleteLogLevel' value='1'/>"; // 로그를 value달 전까지 보관 (1은 한달동안의 로그만 보관) added by CBJ 2012.03.23
  234. obj=obj+ "</OBJECT>";
  235. document.write(obj);
  236. }
  237. </SCRIPT>
  238. </HEAD>
  239. <BODY onload="fn_load()">
  240. <SCRIPT LANGUAGE="JavaScript">
  241. //XPLATFORM Engine
  242. document.write('<OBJECT ID="XPlatformAXCtrl" CLASSID="CLSID:7E0D6AB0-6E1E-441C-969A-CD85DCA58DFB" width="0" height="0" '
  243. + 'CodeBase="./install/TobeSoft/XPlatform/XPLATFORM9.2.1_SetupEngine.cab#VERSION='+XPLATFORM_CAB_VER+'" onError="fn_objectOnError()">'
  244. + '</OBJECT>');
  245. //XPLATFORM Launcher
  246. document.write('<OBJECT ID="XPLauncher" CLASSID="CLSID:A30D5481-7381-4dd9-B0F4-0D1D37449E97" width="0" height="0" '
  247. + 'Codebase="./install/TobeSoft/XPlatform/XPLATFORM9.2.1_XPLauncher.cab#VERSION='+XPLATFORM_CAB_VER+'" onError="fn_objectOnError()">'
  248. + '<PARAM NAME="key" VALUE="' + sKey + '">'
  249. + '</OBJECT>');
  250. // TFSmartUpdater
  251. <!--
  252. TrustFormSmartUpdater("TFSmartUpdater", Server_Path + "/himed/install/TrustForm/TFSmartUpdater_m.cab#version=2,6,4,7", "0", "0");
  253. //-->
  254. </SCRIPT>
  255. <div>XPLauncher 를 시작합니다.</div>
  256. </BODY>
  257. </HTML>