110,534
社区成员
发帖
与我相关
我的任务
分享
namespace ClassLibrary1
{
[RunInstaller(true)]
public class Installer : System.Configuration.Install.Installer
{
public override void Install(IDictionary stateSaver)
{
base.Install(stateSaver);
Microsoft.Win32.RegistryKey hklm = Registry.LocalMachine;
Microsoft.Win32.RegistryKey software = hklm.OpenSubKey("SOFTWARE", true);
Microsoft.Win32.RegistryKey aimdir = software.CreateSubKey("管理系统");
aimdir.SetValue("mica", this.Context.Parameters["targetdir"].ToString());
aimdir.SetValue("database","Emgn");
File.Delete(this.Context.Parameters["targetdir"] + "\\database.sql");//删除安装目录里的database.sql文件。
//你也可以在这里对其他文件进行操作!
}
}
}