如题,我是使用VS自带的安装布署工具来进行打包的,想在用户安装程序时,判断用户是否已安装该程序,如果安装了,就弹出提示,停止安装,我在网上查过资料,说要添加一个安装程序类,然后将这个项目发布,将DLL添加到自定义操作中就可以了,但是我做这个实现的时候,不知道应该如何停止安装及弹出提示框,有没有高手搞过这个啊,麻烦告诉小弟一下,非常着急,以下是安装程序类的实现代码:    [RunInstaller(true)]
    public partial class FileInstaller : System.Configuration.Install.Installer
    {
        private string strRegPath  = "Client";
        private string strPathName = "box.exe";        public FileInstaller()
        {
            InitializeComponent();
            this.BeforeInstall += new InstallEventHandler(InstallerTest_BeforeInstall);
        }        private void InstallerTest_BeforeInstall(object sender, InstallEventArgs e)
        {
            string path = this.Context.Parameters["targetdir"];
            string command = path + "\\box.exe";
            RegistryKey key = Registry.LocalMachine.OpenSubKey("SOFTWARE", true);            string src = RegeditClass.Access_Registry(key, strRegPath, strPathName);            if(src != "-1" && src != "-2")
            {
                if (!FileFunc.GetIsFile(command))
                {
                    我在这里加的判断,判断这个EXE如果存在就中断安装,并弹出提示
                }
            }
        }
    }
希望大哥们能尽快帮助小弟一下,我对winform不太熟