我想我必须自己做每件事(叹气);-)
using System;
using System.ComponentModel;
using System.IO;
namespace Hawk
{
[RunInstaller(true)]
public class Installer : System.Configuration.Install.Installer
{
public override void Install(System.Collections.IDictionary stateSaver)
{
base.Install(stateSaver);
try
{
string assemblyPath = this.Context.Parameters["assemblypath"];
// e.g. C:\Program Files\[MANUFACTURER]\[PROGRAM]\[CUSTOM_INSTALLER].dll
MyCustomCode.Initialize(assemblyPath);
}
catch (Exception ex)
{
//TODO message box to show error
this.Rollback(stateSaver);
}
}
}
}