Microsoft MVP성태의 닷넷 이야기
VS.NET IDE: 50. Orcas - UAC 설정 관련 [링크 복사], [링크+제목 복사],
조회: 29679
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

(시리즈 글이 8개 있습니다.)
VC++: 29. 필수 무결성 제어를 조절하는 방법(1) - Manifest 파일 이용
; https://www.sysnet.pe.kr/2/0/445

VC++: 30. 필수 무결성 제어를 조절하는 방법(2) - 직접 코딩
; https://www.sysnet.pe.kr/2/0/446

VS.NET IDE: 43. .NET에서의 필수 무결성 제어 조절하는 방법 - Manifest 파일 이용
; https://www.sysnet.pe.kr/2/0/450

VS.NET IDE: 50. Orcas - UAC 설정 관련
; https://www.sysnet.pe.kr/2/0/507

개발 환경 구성: 320. Visual Basic .NET 프로젝트에서 내장 Manifest 자원을 EXE 파일로부터 제거하는 방법
; https://www.sysnet.pe.kr/2/0/11228

VS.NET IDE: 122. 비주얼 스튜디오에서 관리자 권한을 요구하는 C# 콘솔 프로그램 제작
; https://www.sysnet.pe.kr/2/0/11318

개발 환경 구성: 572. .NET에서의 필수 무결성 제어 - 외부 Manifest 파일을 두는 방법
; https://www.sysnet.pe.kr/2/0/12634

VS.NET IDE: 181. Visual Studio - C/C++ 프로젝트에 application manifest 적용하는 방법
; https://www.sysnet.pe.kr/2/0/13304





Orcas - UAC 설정 관련


예전에 다음과 같은 글들을 남긴 적이 있었지요.

VC++ : 5. 신뢰도 등급을 조절하는 방법(1) - Manifest 파일 이용 
; https://www.sysnet.pe.kr/2/0/445

VC++ : 6. 신뢰도 등급을 조절하는 방법(2) - 직접 코딩 
; https://www.sysnet.pe.kr/2/0/446

VS.NET IDE : 5. .NET 에서의 신뢰도 등급을 조절하는 방법 - Manifest 파일 이용 
; https://www.sysnet.pe.kr/2/0/450

자... 이제 Orcas가 나왔습니다. 당연한 얘기겠지만, Orcas에서는 UAC를 위한 Manifest 설정을 편하게 할 수 있는 방법을 제공해 주고 있습니다.

먼저, VC++ 프로젝트에서는 어떻게 하는지 볼까요?

orcas_manifest_settings_1.png

간단하지요! 위와 같이 설정창을 통해서 "UAC Execution Level"을 직접 지정하는 것이 가능합니다.
음... 더 설명할 것이 없군요. ^^;

그럼, .NET 프로젝트에서는 어떻게 하는지 또 마저 살펴볼까요?
이 경우에는, 직접적인 프로젝트 설정창에서 제공해 주지 않고, 아래와 같이 "Application Manifest File" 유형의 항목을 추가하는 것에서 시작하게 됩니다.

orcas_manifest_settings_2.png

그러면, 프로젝트에 'app.manifest' 라는 파일이 생성되고 내용은 다음과 같습니다.

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" 
xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <!-- UAC Manifest Options
             If you want to change the Windows User Account Control level replace the 
             requestedExecutionLevel node with one of the following .
        <requestedExecutionLevel  level="asInvoker" />
        <requestedExecutionLevel  level="requireAdministrator" />
        <requestedExecutionLevel  level="highestAvailable" />
        -->
        <requestedExecutionLevel level="asInvoker" />
      </requestedPrivileges>
    </security>
  </trustInfo>
</asmv1:assembly>

이렇게 설정하고 빌드를 하고 나면, 왠지 대상 폴더에 "{응용 프로그램 이름}.exe.manifest" 라는 파일이 생성될 거라 기대가 되는데요.

음... ^^; 생성이 안되는 군요. ".NET 에서의 신뢰도 등급 조정 - Manifest 파일 이용" 에서 설명했던 데로, 어쩔 수 없이 "Enable ClickOnce Security Settings" 항목을 체크해 둬야만 기대했던 대로 동작하게 됩니다.

요건 한번... 건의를 해봐야 겠습니다. ^^

[내용 변경: 2007-06-12]
닷넷 프로젝트의 app.manifest를 하는 부분에서 제가 모르고 글을 쓰게 되었습니다.
알고 보니, app.manifest가 app.config 처럼 빌드 후에 별도로 외부 manifest로 존재하는 것이 아니라, 리소스로써 이미 포함되어 있었습니다. 따라서, 정상적으로 동작하는 것입니다.
참고로, manifest 관련한 빌드 옵션은 프로젝트 속성 창의 "Application" 탭의 "Resources" 그룹 상자안에 있는 "Icon and manifest"의 "Manifest" 콤보박스에서 "{manifest 파일명}", "Embed manifest with default settings", "Create application without a manifest" 값들 중의 하나를 택할 수 있습니다.

위와 같은 사항들은 다음의 토픽을 보고 알게 되었습니다. ^^
UAC with .NET in Visual Studio 2008 
; https://docs.microsoft.com/en-us/archive/blogs/knom/uac-with-net-in-visual-studio-2008 

자... 그러고 보니, 외부 manifest 파일로 존재하도록 만드는 방법은 간단합니다. 왠지 아주 정석인 것 같은 방법은 아니지만.
1. "app.manifest" 파일을 "{응용 프로그램 실행 파일명}.manifest" 명으로 바꿉니다.
2. 속성창에서 "Copy to Output Directory" 값을 "Copy always 또는 Copy if newer"로 바꿉니다.
그럼, 된건가요? 이것으로, 리소스로 포함할 때와, 외부 파일로 빼고 싶은 때를 "Application" 탭에서 지정할 수 있게 되었습니다.



[이 토픽에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 4/7/2021]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... [121]  122  123  124  125  126  127  128  129  130  131  132  133  134  135  ...
NoWriterDateCnt.TitleFile(s)
10991정성태6/13/201626876오류 유형: 338. octave-gui 실행 시 "octave-gui.exe has stopped working" 오류
10990정성태6/13/201628040오류 유형: 337. missing type specifier - [type] assumed. Note: C++ does not support default-[type]
10989정성태6/7/201624718.NET Framework: 596. C# - WCF wsDualHttpBinding의 ClientBaseAddress 속성 - 두 번째 이야기
10988정성태6/3/201625789기타: 57. Outlook blocked access to the following potentially unsafe attachments
10987정성태6/2/201626882.NET Framework: 595. XLL 파일에 포함된 .NET 어셈블리를 추출하는 방법
10986정성태6/1/201627841.NET Framework: 594. C# - WCF wsDualHttpBinding의 ClientBaseAddress 속성
10985정성태6/1/201625610오류 유형: 336. An error occurred while ejecting 'DVD RW drive ...'
10984정성태5/31/201631431.NET Framework: 593. C# - wsDualHttpBinding WCF 예제 프로그램파일 다운로드1
10983정성태5/30/201624898VC++: 97. C++ 템플릿 remove_pointer, enable_if, is_pointer 사용 예제파일 다운로드1
10982정성태5/26/201623221오류 유형: 335. SQL Server Management Studio - The database ... is not accessible.
10981정성태5/24/201629219.NET Framework: 592. C# - Lights Out 퍼즐 풀기 [2]파일 다운로드1
10980정성태5/24/201625799VS.NET IDE: 108. Visual Studio 2013/2015를 위한 "Macros for Visual Studio"
10979정성태5/23/201628393.NET Framework: 591. C# - 조합(Combination) 예제 코드 - 두 번째 이야기파일 다운로드1
10978정성태5/23/201627720.NET Framework: 590. C# - 모든 경우의 수를 조합하는 코드 (2)파일 다운로드1
10977정성태5/23/201632597.NET Framework: 589. C# - 모든 경우의 수를 조합하는 코드 (1)파일 다운로드1
10976정성태5/20/201627329Math: 18. C# - 오일러 공식을 이용한 복소수 값의 라디안 회전파일 다운로드1
10975정성태5/20/201627611Math: 17. C# - 복소수 타입의 승수를 지원하는 Power 메서드파일 다운로드1
10974정성태5/20/201627279.NET Framework: 588. C# - OxyPlot 라이브러리로 복소수 표현파일 다운로드1
10973정성태5/20/201632122.NET Framework: 587. C# Plotting 라이브러리 OxyPlot [3]파일 다운로드1
10972정성태5/19/201632596Math: 16. C# - 갈루아 필드 GF(2) 연산 [3]파일 다운로드1
10971정성태5/19/201623934오류 유형: 334. Visual Studio - 빌드 시 경고 warning MSB3884: Could not find rule set file "...". [2]
10970정성태5/19/201629345오류 유형: 333. OxyPlot 라이브러리의 컨트롤을 Toolbox에 등록 시 오류 [2]
10969정성태5/18/201627276.NET Framework: 586. C# - 파일 확장자에 연결된 프로그램을 등록하는 방법 (3) - "Open with" 목록에 등록파일 다운로드1
10968정성태5/18/201623586오류 유형: 332. Visual Studio - 단위 테스트 생성 시 "Design time expression evaluation" 오류 메시지
10967정성태5/12/201629055.NET Framework: 585. C# - 파일 확장자에 연결된 프로그램을 등록하는 방법 (2) - 웹 브라우저가 다운로드 후 자동 실행
10966정성태5/12/201637120.NET Framework: 584. C# - 파일 확장자에 연결된 프로그램을 등록하는 방법 (1) - 기본 [1]파일 다운로드1
... [121]  122  123  124  125  126  127  128  129  130  131  132  133  134  135  ...