개정판 ffddbe4e
issue #660: Version check 로직 수정.
Change-Id: I3f08587b1580063d3cdd57a534490c2f1e60c240
KCOM/MainWindow.xaml.cs | ||
---|---|---|
407 | 407 |
string updateurl = string.Empty; |
408 | 408 |
try |
409 | 409 |
{ |
410 |
updateurl = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetVersionData(Environment.Is64BitProcess, Assembly.GetExecutingAssembly().GetName().Version.ToString()); |
|
410 |
bool is64bit = Environment.Is64BitProcess; |
|
411 |
string clientversion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); |
|
412 |
updateurl = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetVersionData(is64bit, clientversion); |
|
411 | 413 |
|
412 |
if (Check_Uri.UriCheckBool(updateurl))
|
|
414 |
if (Check_Uri.isUri(updateurl))
|
|
413 | 415 |
{ |
414 | 416 |
DialogParameters parameters = new DialogParameters() |
415 | 417 |
{ |
... | ... | |
428 | 430 |
{ |
429 | 431 |
if (e.DialogResult == true) |
430 | 432 |
{ |
431 |
isUpdateCheck = true; |
|
432 |
|
|
433 |
//this.Close(); |
|
433 |
isUpdateCheck = true; |
|
434 | 434 |
} |
435 | 435 |
else |
436 | 436 |
{ |
KCOM_API/ServiceDeepView.svc.cs | ||
---|---|---|
24 | 24 |
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] |
25 | 25 |
public partial class ServiceDeepView : System.Web.Services.WebService |
26 | 26 |
{ |
27 |
//[OperationContract] |
|
28 |
//public List<HoneyheadTEXT> GetSearchText(int pageNo, string filePath,bool IsAllPage) //0아 아니면 지정 페이지 |
|
29 |
//{ |
|
30 |
|
|
31 |
// return null; |
|
32 |
//} |
|
33 |
|
|
27 |
/// <summary> |
|
28 |
/// Client Version 과 Server Version 을 비교하여 Server Version 이 최신이면 다운로드 url 리턴. |
|
29 |
/// </summary> |
|
30 |
/// <param name="is64BitProcess">64bit = true, 32bit = false</param> |
|
31 |
/// <param name="markusVer">client version</param> |
|
32 |
/// <returns></returns> |
|
34 | 33 |
[OperationContract] |
35 | 34 |
public string GetVersionData(bool is64BitProcess, string markusVer) |
36 | 35 |
{ |
37 | 36 |
string url = null; |
38 |
int[] markusVersion = Array.ConvertAll<string, int>(markusVer.Split('.'), int.Parse); |
|
39 | 37 |
|
40 | 38 |
try |
41 | 39 |
{ |
40 |
Version client_version = new Version(markusVer); |
|
41 |
|
|
42 |
//DB에서 version 정보와 다운로드 url 을 Select |
|
43 |
PROPERTIES dbvalue = null; |
|
42 | 44 |
using (KCOMEntities uc = new KCOMEntities(ConnectStringBuilder.KCOMConnectionString().ToString())) |
43 |
{ |
|
44 |
if (is64BitProcess) //64 bit machine |
|
45 |
{ |
|
46 |
string wherestr = string.Empty; |
|
47 |
if (is64BitProcess) |
|
45 | 48 |
{ |
46 |
var versionData = uc.PROPERTIES.Where(data => data.TYPE == "Update_x64").FirstOrDefault(); |
|
47 |
int[] dbversion = Array.ConvertAll<string, int>(versionData.PROPERTY.Split('.'), int.Parse); |
|
48 |
if (dbversion[0] > markusVersion[0] || dbversion[1] > markusVersion[1] || dbversion[2] > markusVersion[2] || dbversion[3] > markusVersion[3]) |
|
49 |
{ |
|
50 |
url = versionData.VALUE; |
|
51 |
} |
|
49 |
wherestr = "Update_x64"; |
|
52 | 50 |
} |
53 | 51 |
else |
54 | 52 |
{ |
55 |
var versionData = uc.PROPERTIES.Where(data => data.TYPE == "Update_x84").FirstOrDefault(); |
|
56 |
int[] dbversion = Array.ConvertAll<string, int>(versionData.PROPERTY.Split('.'), int.Parse); |
|
57 |
if (dbversion[0] > markusVersion[0] || dbversion[1] > markusVersion[1] || dbversion[2] > markusVersion[2] || dbversion[3] > markusVersion[3]) |
|
58 |
{ |
|
59 |
url = versionData.VALUE; |
|
60 |
} |
|
61 |
} |
|
53 |
wherestr = "Update_x84"; |
|
54 |
} |
|
55 |
dbvalue = uc.PROPERTIES.Where(data => data.TYPE == wherestr).FirstOrDefault(); |
|
56 |
} |
|
57 |
|
|
58 |
//서버 버전이 최신이면 0보다 큰값 리턴 |
|
59 |
Version server_version = new Version(dbvalue.PROPERTY); |
|
60 |
int result = server_version.CompareTo(client_version); |
|
61 |
if (result > 0) |
|
62 |
{ |
|
63 |
url = dbvalue.VALUE; |
|
62 | 64 |
} |
63 | 65 |
} |
64 | 66 |
catch (Exception) |
... | ... | |
2979 | 2981 |
return results; |
2980 | 2982 |
} |
2981 | 2983 |
#endregion |
2982 |
} |
|
2984 |
}
|
|
2983 | 2985 |
} |
내보내기 Unified diff