index.jsp.170719 8.3 KB

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