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");
}
}
}

[그림 …

Read More