index.jsp.151001 7.6 KB

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