개정판 af22332b
issue #745 markus client log 폴더 위치 변경
Change-Id: I0904bee8796ca2aa4836aa5af7f5d14478647fbe
KCOM/App.xaml.cs | ||
---|---|---|
1 | 1 |
|
2 |
using KCOM.Common; |
|
2 | 3 |
using KCOM.ServiceDeepView; |
3 | 4 |
using System; |
4 | 5 |
using System.Collections.Generic; |
... | ... | |
128 | 129 |
//Support.SetLicense(); |
129 | 130 |
|
130 | 131 |
string sBaseServiceURL = global::KCOM.Properties.Settings.Default.BaseClientAddress; |
132 |
|
|
133 |
var ipaddress = DNSHelper.GetDnsAdress(); |
|
134 |
|
|
135 |
try |
|
136 |
{ |
|
137 |
var hostName = Dns.GetHostEntry(ipaddress).HostName; |
|
138 |
|
|
139 |
if (!hostName.EndsWith(KCOM.Properties.Settings.Default.HOST_DOMAIN)) |
|
140 |
{ |
|
141 |
// 외부 사용자 |
|
142 |
sBaseServiceURL = global::KCOM.Properties.Settings.Default.Remote_BaseClientAddress; |
|
143 |
} |
|
144 |
} |
|
145 |
catch (Exception ex) |
|
146 |
{ |
|
147 |
System.Diagnostics.Debug.WriteLine(ex.ToString()); |
|
148 |
} |
|
131 | 149 |
#if DEBUG |
132 | 150 |
//_EndPoint = new EndpointAddress(@"http://10.11.252.3/MARKUS/ServiceDeepView.svc"); //효성 |
133 | 151 |
_EndPoint = new EndpointAddress(string.Format("{0}/ServiceDeepView.svc", sBaseServiceURL)); |
... | ... | |
145 | 163 |
versionPath = KCOM.Properties.Settings.Default.UpdateVer86; |
146 | 164 |
} |
147 | 165 |
|
148 |
// 20180921 version.xml check로 변경 |
|
149 |
var assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); |
|
150 |
try |
|
166 |
if (File.Exists(versionPath)) |
|
151 | 167 |
{ |
152 |
XmlDocument xdoc = new XmlDocument(); |
|
153 |
xdoc.Load(versionPath); |
|
154 |
XmlNode node = xdoc.SelectSingleNode("/RootElement/version"); |
|
155 |
|
|
156 |
if (assemblyVersion != node.InnerText) // node.InnerText 가 null이면 catch로 빠짐 |
|
168 |
// 20180921 version.xml check로 변경 |
|
169 |
var assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); |
|
170 |
try |
|
157 | 171 |
{ |
158 |
//if(MessageBox.Show("Ver. " + node.InnerText + " 업데이트가 있습니다.\r\nSmartUpdate를 실행합니다.", "MARKUS", MessageBoxButton.OKCancel) == MessageBoxResult.OK) |
|
159 |
//{ |
|
160 |
if(MessageBox.Show("Ver. " + node.InnerText , "MARKUS", MessageBoxButton.OKCancel) == MessageBoxResult.OK) |
|
172 |
XmlDocument xdoc = new XmlDocument(); |
|
173 |
xdoc.Load(versionPath); |
|
174 |
XmlNode node = xdoc.SelectSingleNode("/RootElement/version"); |
|
175 |
|
|
176 |
if (assemblyVersion != node.InnerText) // node.InnerText 가 null이면 catch로 빠짐 |
|
161 | 177 |
{ |
162 |
UpdateCheck(e); |
|
178 |
//if(MessageBox.Show("Ver. " + node.InnerText + " 업데이트가 있습니다.\r\nSmartUpdate를 실행합니다.", "MARKUS", MessageBoxButton.OKCancel) == MessageBoxResult.OK) |
|
179 |
//{ |
|
180 |
if (MessageBox.Show("Ver. " + node.InnerText, "MARKUS", MessageBoxButton.OKCancel) == MessageBoxResult.OK) |
|
181 |
{ |
|
182 |
UpdateCheck(e); |
|
183 |
} |
|
184 |
else |
|
185 |
{ |
|
186 |
base.Shutdown(); |
|
187 |
//현재 실행되고 있는 자기 자신 프로세스의 정보 // 위에꺼랑 두개 다 써줄필요가 있는..가? |
|
188 |
Process proc = Process.GetCurrentProcess(); |
|
189 |
proc.Kill(); |
|
190 |
} |
|
163 | 191 |
} |
164 | 192 |
else |
165 | 193 |
{ |
166 |
base.Shutdown(); |
|
167 |
//현재 실행되고 있는 자기 자신 프로세스의 정보 // 위에꺼랑 두개 다 써줄필요가 있는..가? |
|
168 |
Process proc = Process.GetCurrentProcess(); |
|
169 |
proc.Kill(); |
|
194 |
base.OnStartup(e); |
|
195 |
splash.Close(new TimeSpan(0, 0, 2)); |
|
170 | 196 |
} |
171 | 197 |
} |
172 |
else
|
|
198 |
catch (Exception ex) //2. 파일이 없거나 파일내에 version의 값이 없다면 KCOM 실행하기
|
|
173 | 199 |
{ |
200 |
ErrorLogFileWrite("KCOM//UpdateCheck ERR : " + ex); |
|
174 | 201 |
base.OnStartup(e); |
175 | 202 |
splash.Close(new TimeSpan(0, 0, 2)); |
176 |
}
|
|
203 |
} |
|
177 | 204 |
} |
178 |
catch (Exception ex) //2. 파일이 없거나 파일내에 version의 값이 없다면 KCOM 실행하기 |
|
179 |
{ |
|
180 |
ErrorLogFileWrite("KCOM//UpdateCheck ERR : " + ex); |
|
181 |
base.OnStartup(e); |
|
182 |
splash.Close(new TimeSpan(0, 0, 2)); |
|
183 |
} |
|
184 | 205 |
} |
185 | 206 |
catch (Exception ex) |
186 | 207 |
{ |
... | ... | |
215 | 236 |
{ |
216 | 237 |
try |
217 | 238 |
{ |
218 |
string pathString = AppDomain.CurrentDomain.BaseDirectory + "Err"; |
|
239 |
string FilePath = "C:\\ProgramData\\MARKUS\\"; |
|
240 |
//string pathString = AppDomain.CurrentDomain.BaseDirectory + "Err"; |
|
241 |
string pathString = FilePath + "Err"; |
|
242 |
|
|
219 | 243 |
if (!File.Exists(pathString)) |
220 | 244 |
{ |
221 | 245 |
Directory.CreateDirectory(pathString); |
KCOM/Common/DNSHelper.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Net; |
|
5 |
using System.Net.NetworkInformation; |
|
6 |
using System.Text; |
|
7 |
using System.Threading.Tasks; |
|
8 |
|
|
9 |
namespace KCOM.Common |
|
10 |
{ |
|
11 |
public class DNSHelper |
|
12 |
{ |
|
13 |
public static IPAddress GetDnsAdress() |
|
14 |
{ |
|
15 |
NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces(); |
|
16 |
|
|
17 |
foreach (NetworkInterface networkInterface in networkInterfaces) |
|
18 |
{ |
|
19 |
if (networkInterface.OperationalStatus == OperationalStatus.Up) |
|
20 |
{ |
|
21 |
IPInterfaceProperties ipProperties = networkInterface.GetIPProperties(); |
|
22 |
IPAddressCollection dnsAddresses = ipProperties.DnsAddresses; |
|
23 |
|
|
24 |
foreach (IPAddress dnsAdress in dnsAddresses) |
|
25 |
{ |
|
26 |
return dnsAdress; |
|
27 |
} |
|
28 |
} |
|
29 |
} |
|
30 |
return null; |
|
31 |
} |
|
32 |
} |
|
33 |
} |
KCOM/KCOM.csproj | ||
---|---|---|
241 | 241 |
<Compile Include="Common\Converter\PDFVisibleConverter.cs" /> |
242 | 242 |
<Compile Include="Common\Converter\SvgConverter.cs" /> |
243 | 243 |
<Compile Include="Common\Converter\SvgImageConverter.cs" /> |
244 |
<Compile Include="Common\DNSHelper.cs" /> |
|
244 | 245 |
<Compile Include="Common\FileStreamToBase64.cs" /> |
245 | 246 |
<Compile Include="Common\TempFile.cs" /> |
246 | 247 |
<Compile Include="Connected Services\ServiceDeepView\Reference.cs"> |
... | ... | |
624 | 625 |
<None Include="Properties\Settings.settings"> |
625 | 626 |
<Generator>SettingsSingleFileGenerator</Generator> |
626 | 627 |
<LastGenOutput>Settings.Designer.cs</LastGenOutput> |
628 |
<SubType>Designer</SubType> |
|
627 | 629 |
</None> |
628 | 630 |
<None Include="tessdata\deu.traineddata"> |
629 | 631 |
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
KCOM/Logger.cs | ||
---|---|---|
19 | 19 |
{ |
20 | 20 |
// string Msg = (string)text + " / " + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\r\n"; |
21 | 21 |
string Msg = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\t" + "REQ" + "\t" + name + "(" + (string)text + ")" + "\r\n"; |
22 |
string Dir = AppDomain.CurrentDomain.BaseDirectory + "Log";
|
|
22 |
string Dir = "C:\\ProgramData\\MARKUS\\" + "Log";
|
|
23 | 23 |
|
24 | 24 |
if (Directory.Exists(Dir) == false) |
25 | 25 |
{ |
... | ... | |
47 | 47 |
{ |
48 | 48 |
// string Msg = (string)text + " / " + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\r\n"; |
49 | 49 |
string Msg = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\t" + "RES" + "\t" + name + "(" + (string)text + ")" + "\r\n"; |
50 |
string Dir = AppDomain.CurrentDomain.BaseDirectory + "Log";
|
|
50 |
string Dir = "C:\\ProgramData\\MARKUS\\" + "Log";
|
|
51 | 51 |
|
52 | 52 |
if (Directory.Exists(Dir) == false) |
53 | 53 |
{ |
KCOM/Properties/Settings.Designer.cs | ||
---|---|---|
25 | 25 |
|
26 | 26 |
[global::System.Configuration.UserScopedSettingAttribute()] |
27 | 27 |
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
28 |
[global::System.Configuration.DefaultSettingValueAttribute("http://localhost:13009")]
|
|
28 |
[global::System.Configuration.DefaultSettingValueAttribute("http://www.devdoftech.co.kr:5979")]
|
|
29 | 29 |
public string BaseClientAddress { |
30 | 30 |
get { |
31 | 31 |
return ((string)(this["BaseClientAddress"])); |
... | ... | |
216 | 216 |
this["cad"] = value; |
217 | 217 |
} |
218 | 218 |
} |
219 |
|
|
220 |
[global::System.Configuration.UserScopedSettingAttribute()] |
|
221 |
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
|
222 |
[global::System.Configuration.DefaultSettingValueAttribute("DAELIM.COM")] |
|
223 |
public string HOST_DOMAIN { |
|
224 |
get { |
|
225 |
return ((string)(this["HOST_DOMAIN"])); |
|
226 |
} |
|
227 |
set { |
|
228 |
this["HOST_DOMAIN"] = value; |
|
229 |
} |
|
230 |
} |
|
231 |
|
|
232 |
[global::System.Configuration.UserScopedSettingAttribute()] |
|
233 |
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
|
234 |
[global::System.Configuration.DefaultSettingValueAttribute("http://www.devdoftech.co.kr:5979")] |
|
235 |
public string Remote_BaseClientAddress { |
|
236 |
get { |
|
237 |
return ((string)(this["Remote_BaseClientAddress"])); |
|
238 |
} |
|
239 |
set { |
|
240 |
this["Remote_BaseClientAddress"] = value; |
|
241 |
} |
|
242 |
} |
|
219 | 243 |
} |
220 | 244 |
} |
KCOM/Properties/Settings.settings | ||
---|---|---|
3 | 3 |
<Profiles /> |
4 | 4 |
<Settings> |
5 | 5 |
<Setting Name="BaseClientAddress" Type="System.String" Scope="User"> |
6 |
<Value Profile="(Default)">http://localhost:13009</Value>
|
|
6 |
<Value Profile="(Default)">http://www.devdoftech.co.kr:5979</Value>
|
|
7 | 7 |
</Setting> |
8 | 8 |
<Setting Name="KCOM_kr_co_devdoftech_cloud_FileUpload" Type="(Web Service URL)" Scope="Application"> |
9 | 9 |
<Value Profile="(Default)">http://cloud.devdoftech.co.kr:5977/ImageUpload/FileUpload.asmx</Value> |
... | ... | |
56 | 56 |
<Setting Name="cad" Type="System.Int32" Scope="User"> |
57 | 57 |
<Value Profile="(Default)">1</Value> |
58 | 58 |
</Setting> |
59 |
<Setting Name="HOST_DOMAIN" Type="System.String" Scope="User"> |
|
60 |
<Value Profile="(Default)">DAELIM.COM</Value> |
|
61 |
</Setting> |
|
62 |
<Setting Name="Remote_BaseClientAddress" Type="System.String" Scope="User"> |
|
63 |
<Value Profile="(Default)">http://www.devdoftech.co.kr:5979</Value> |
|
64 |
</Setting> |
|
59 | 65 |
</Settings> |
60 | 66 |
</SettingsFile> |
KCOM/app.config | ||
---|---|---|
45 | 45 |
<userSettings> |
46 | 46 |
<KCOM.Properties.Settings> |
47 | 47 |
<setting name="BaseClientAddress" serializeAs="String"> |
48 |
<value>http://localhost:13009</value>
|
|
48 |
<value>http://www.devdoftech.co.kr:5979</value>
|
|
49 | 49 |
</setting> |
50 | 50 |
<setting name="HubAddress" serializeAs="String"> |
51 | 51 |
<value>http://www.devdoftech.co.kr:5100/</value> |
... | ... | |
74 | 74 |
<setting name="cad" serializeAs="String"> |
75 | 75 |
<value>1</value> |
76 | 76 |
</setting> |
77 |
<setting name="HOST_DOMAIN" serializeAs="String"> |
|
78 |
<value>DAELIM.COM</value> |
|
79 |
</setting> |
|
80 |
<setting name="Remote_BaseClientAddress" serializeAs="String"> |
|
81 |
<value>http://www.devdoftech.co.kr:5979</value> |
|
82 |
</setting> |
|
77 | 83 |
</KCOM.Properties.Settings> |
78 | 84 |
</userSettings> |
79 | 85 |
<system.serviceModel> |
SmartUpdate/MainWindow.xaml.cs | ||
---|---|---|
312 | 312 |
{ |
313 | 313 |
try |
314 | 314 |
{ |
315 |
string pathString = AppDomain.CurrentDomain.BaseDirectory + "UpdateLog\\Err";
|
|
315 |
string pathString = "C:\\ProgramData\\MARKUS\\" + "UpdateLog\\Err";
|
|
316 | 316 |
if (!File.Exists(pathString)) |
317 | 317 |
{ |
318 | 318 |
Directory.CreateDirectory(pathString); |
... | ... | |
332 | 332 |
{ |
333 | 333 |
try |
334 | 334 |
{ |
335 |
string pathString = AppDomain.CurrentDomain.BaseDirectory + "UpdateLog";
|
|
335 |
string pathString = "C:\\ProgramData\\MARKUS\\" + "UpdateLog";
|
|
336 | 336 |
if (!File.Exists(pathString)) |
337 | 337 |
{ |
338 | 338 |
Directory.CreateDirectory(pathString); |
내보내기 Unified diff