개정판 8de0cf00
자동업데이트 외부에서 연결 가능하도록 수정
Change-Id: I7dae8d0c0bf5519bdbd0341308545e5e1ad4361e
MarkusAutoUpdate/src/NetSparkle.Samples.NetFramework.WPF/App.xaml.cs | ||
---|---|---|
1 | 1 |
using log4net; |
2 |
using NetSparkle.TestAppWPF.Common; |
|
2 | 3 |
using Salaros.Configuration; |
3 | 4 |
using System; |
4 | 5 |
using System.Collections.Generic; |
... | ... | |
17 | 18 |
{ |
18 | 19 |
public static string KcomParam = null; |
19 | 20 |
public static string AppCastUri = null; |
21 |
public static bool IsExternal = false; |
|
22 |
public static string ExternalAddress = null; |
|
20 | 23 |
|
21 | 24 |
public static ILog logger = LogManager.GetLogger(typeof(App)); |
22 | 25 |
|
... | ... | |
43 | 46 |
|
44 | 47 |
AppCastUri = config.GetValue("APP_CAST", "URI"); |
45 | 48 |
|
49 |
var hostDomain = config.GetValue("HOST_DOMAIN", "DOMAIN"); |
|
50 |
|
|
51 |
if(hostDomain != null) |
|
52 |
{ |
|
53 |
var hostEntry = DnsHelper.GetHostEntryTask(); |
|
54 |
|
|
55 |
if(hostEntry == null) |
|
56 |
{ |
|
57 |
IsExternal = true; |
|
58 |
} |
|
59 |
else if(!string.IsNullOrWhiteSpace(hostDomain) && !hostEntry.HostName.ToUpper().EndsWith(hostDomain.ToUpper())) |
|
60 |
{ |
|
61 |
IsExternal = true; |
|
62 |
} |
|
63 |
} |
|
64 |
|
|
65 |
if (IsExternal) |
|
66 |
{ |
|
67 |
ExternalAddress = config.GetValue("APP_CAST", "EXTERNAL_URI"); |
|
68 |
|
|
69 |
var uri = UriHelper.ChangeAddress(new Uri(AppCastUri), ExternalAddress); |
|
70 |
|
|
71 |
AppCastUri = uri.ToString(); |
|
72 |
} |
|
73 |
|
|
74 |
|
|
46 | 75 |
App.logger.Info($"App Cast Uri : {AppCastUri}"); |
47 | 76 |
|
48 | 77 |
base.OnStartup(e); |
내보내기 Unified diff