Skip to content
DarkKaiser의 블로그
DarkKaiser의 블로그
  • 개발 관련 자료(노션)
  • Raspberry Pi(노션)
  • WD My Cloud(노션)
  • GitHub
DarkKaiser의 블로그

System.Configuration.Install 네임스페이스의 Installer 를 이용한 설치 프로젝트 작성

DarkKaiser, 2008년 4월 14일2023년 9월 6일
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Configuration.Install;

namespace WindowsApplication
{
  [System.ComponentModel.RunInstaller(true)]
  public class SetupInstaller : System.Configuration.Install.Installer
  {
    public SetupInstaller()
    {
      this.AfterInstall += new InstallEventHandler(SetupInstaller_AfterInstall);
      this.BeforeInstall += new InstallEventHandler(SetupInstaller_BeforeInstall);
      this.Committed += new InstallEventHandler(SetupInstaller_Committed);
    }

    // 셋업 설치가 완료되었을 때 호출
    void SetupInstaller_Committed(object sender, InstallEventArgs e)
    {
      // 아래 그림 3의 CustomActionData 내의 값을 읽어온다.
      string name = Context.Parameters["CUSTOM1"];
      string age = Context.Parameters["CUSTOM2"];

      MessageBox.Show(name + "\r\n" + age);
    }

    // WindowsApplication.exe 파일이 설치되기 직전에 호출
    void SetupInstaller_BeforeInstall(object sender, InstallEventArgs e)
    {
      MessageBox.Show("beforeInstall");
    }

    // WindowsApplication.exe 파일이 설치된후에 호출
    void SetupInstaller_AfterInstall(object sender, InstallEventArgs e)
    {
      MessageBox.Show("afterInstall");
    }
  }
}

[그림 1]
사용자 지정 작업 화면에서 위의 애트리뷰트가 구현된 실행파일을 등록한다. 그러면 셋업 설치시 혹은 설치가 완료되고 나서 해당 이벤트가 발생하게 된다.

사용자 삽입 이미지

[그림 2]
사용자 인터페이스 화면에서 새로운 입력란 대화상자를 추가하는 화면이다.
속성 페이지의 EditxProperty 값을 이용하여 그림3의 CustomActionData 에 값을 설정하면 소스 코드에서 이 값을 읽어들일 수 있다.

사용자 삽입 이미지

[그림 3]
위 그림 2의 EditxProperty 값을 CustomActionData 항목에 설정하는 화면

사용자 삽입 이미지
C# 설치프로젝트InstallerRunInstaller

글 내비게이션

Previous post
Next post

답글 남기기 응답 취소

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

최신 글

  • AssertJ 소개testCompile ‘org.assertj:assertj-core:3.6.2’ 2017년 9월 14일
  • 자주 사용되는 Lombok 어노테이션 2017년 9월 14일
  • 유니코드 #3 2017년 9월 14일
  • 유니코드 #2 2017년 9월 14일
  • 유니코드 #1 2017년 9월 14일

최신 댓글

    카테고리

    • 개인 자료 (1)
      • 일기 (1)
    • 주절주절 (7)
    • 프로그래밍 갤러리 (16)
    • 프로그래밍 언어 (186)
      • Java (29)
      • C/C++/VC++ (114)
      • C# (11)
      • Visual Basic (6)
      • 안드로이드 (9)
      • Objective-C (5)
      • JavaScript (4)
      • JSP/Servlet (2)
      • Python (4)
      • 어셈블러 (1)
    • 개발++ (44)
      • Book (11)
        • Joel On Software (10)
      • 프로젝트 관리 (6)
      • Maven (1)
      • 디버깅 (1)
      • DirectX (1)
      • Silverlight (1)
      • RESTful (1)
      • Hacking (1)
      • WDM (4)
      • VoIP (5)
      • 기타 (1)
    • 개발 도구 (15)
      • eclipse (14)
      • Sublime Text (1)
    • 네트워크 (7)
    • 설치 및 배포 (7)
      • InstallShield (2)
      • NSIS (4)
    • 버전 관리 (9)
      • Git (2)
      • CVS (2)
      • Subversion (5)
    • 데이터베이스 (7)
      • Oracle (3)
      • Sybase (2)
      • MS-SQL (2)
    • 단위테스트 (3)
      • JUnit (1)
      • NUnit (2)
    • 버그추적시스템 (2)
      • mantis (2)
    • 운영체제 (7)
      • Windows (5)
      • 리눅스 (2)
    • WAS (3)
      • WebLogic (3)
    • 디자인패턴 (1)
    • 디지털 이미지 프로세싱 (16)

    태그

    AutoExp.dat CppUnit CreateFile CVS Detours Generic ignore파일 Installer Isolation level LogCat OSI OSI 7 layer PRODUCTION_MODE request RunInstaller Runnable SafeInt session setPoperty startWebLogic.cmd STL synchronized TAB time_t VC Vector VS2005 날짜 디버깅 리치에디트컨트롤 매핑모드 문서화 주석 변환 사설 IP 성능 주석 트랜젝션 트리 프로젝트관리 프로파일러 픽셀 형변환 형식 확장자 히스토그램

    메타

    • 로그인
    • 엔트리 피드
    • 댓글 피드
    • WordPress.org
    ©2025 DarkKaiser의 블로그 | WordPress Theme by SuperbThemes