所有,我正在尝试将一个添加Custom Action
到我的VS2010 SetUp Project
. 我想要做的是在安装过程中显示我的自定义赢表。而且我想将自定义win-form显示为模式对话框,以便用户在安装过程中不能忽略它。到目前为止,我从.继承了我的安装类System.windows.forms.IWin32Window
。但我不知道如何实现get
成员public IntPtr Handle
界面。
我所做的如下。请帮助审查它。谢谢。
[RunInstaller(true)]
public partial class MyInstaller : System.Configuration.Install.Installer,IWin32Window
{
public MyInstaller ()
{
InitializeComponent();
}
[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
public override void Install(IDictionary stateSaver)
{
base.Install(stateSaver);
}
[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
protected override void OnAfterInstall(IDictionary savedState)
{
base.OnAfterInstall(savedState);
}
[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
public override void Commit(IDictionary savedState)
{
base.Commit(savedState);
Form frm = new frmSelectSource();
frm.ShowDialog(this);
}
[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
public override void Rollback(IDictionary savedState)
{
base.Rollback(savedState);
}
[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
public override void Uninstall(IDictionary savedState)
{
base.Uninstall(savedState);
}
[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
protected override void OnCommitted(IDictionary savedState)
{
base.OnCommitted(savedState);
}
public IntPtr Handle
{
get { throw new NotImplementedException(); }
}
}
我不知道这是否是正确的方法。如果它是错误的或不可能做到。请告诉我。谢谢。