프로젝트

일반

사용자정보

개정판 77cdac33

ID77cdac33b7bca4641193c97216f85dde1a21cb5e
상위 74abcf6f
하위 a7bee7cf

김태성이(가) 약 3년 전에 추가함

벽산 수정 후 백업

Change-Id: I8e3eb48f615478a49efa0ab4014a8ef17d273d0a

차이점 보기:

MarkusAutoUpdate/src/NetSparkle.Samples.NetFramework.WPF/MainWindow.xaml.cs
1 1
using NetSparkle.TestAppWPF.Common;
2
using NetSparkle.TestAppWPF.ViewModel;
2 3
using NetSparkleUpdater.Events;
3 4
using NetSparkleUpdater.SignatureVerifiers;
4 5
using System;
......
61 62

  
62 63
                if (!Directory.Exists(InstallPath))
63 64
                {
65
                    CheckAdmin();
64 66
                    Directory.CreateDirectory(InstallPath);
65 67
                }
66 68

  
......
70 72

  
71 73
                if (!File.Exists(KcomPath))
72 74
                {
75
                    CheckAdmin();
73 76
                    File.Copy(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "kcom.exe"), KcomPath);
74 77
                }
75 78

  
......
101 104
            }
102 105

  
103 106
        }
107
        private void CheckAdmin()
108
        {
109
            if (!VistaSecurity.IsAdmin())
110
            {
111
                var param = new ExtractParam(App.KcomParam);
112

  
113
                VistaSecurity.RestartElevated($"ADMIN {ObjectToBytesStringConvert.ObjectToBytesString(param)}");
114
            }
115
        }
104 116

  
105 117
        private void _sparkle_DownloadMadeProgress(object sender, AppCastItem item, ItemDownloadProgressEventArgs args)
106 118
        {
......
202 214
            viewModel.IsWait = true;
203 215

  
204 216
            ExtractFiles(InstallPath,tempStoragePath,downloadPath,KcomPath, App.KcomParam);
205

  
217
            if (VistaSecurity.IsAdmin())
218
            {
219
                ExtractFiles(InstallPath, tempStoragePath, downloadPath, KcomPath, App.KcomParam);
220
            }
221
            else
222
            {
223
                var param = new ExtractParam(tempStoragePath, downloadPath, App.KcomParam);
224
                VistaSecurity.RestartElevated($"EXT {ObjectToBytesStringConvert.ObjectToBytesString(param)}");
225
            }
206 226
            //ExtractProcess(item, downloadPath);
207 227
        }
208 228

  

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)