如何使用安装程序激活exe文件,作为事件

本文关键字:事件 文件 exe 何使用 安装 程序 激活 | 更新日期: 2023-09-27 18:13:46

我有一个WindowsForm Application,在Form2我有一个install button。我想做一个事件,当我点击install来播放executable file的位置在这里:D:'Mat'R2008a'win64和名称setup.exe。额外的条件是:我希望这个exeinstaller.ini设置一起玩,谁在这里:

string path = AppDomain.CurrentDomain.BaseDirectory.ToString();
 string installerfilename = path + "installer.ini";

我想让我的应用程序像一个安装程序

我试图使用这段代码,但不工作:

private void Install_Click(object sender, EventArgs e)
        {
string desktopPath = @"D:'Mat'NSIS'R2008a'win64";
            ProcessStartInfo psi = new ProcessStartInfo();
            psi.Arguments = "/s /v /qn /min";
            psi.CreateNoWindow = true;
            psi.WindowStyle = ProcessWindowStyle.Hidden;
            psi.FileName = desktopPath + "''" + "setup.exe";
            psi.UseShellExecute = false;
            Process.Start(psi);
            this.Visible = false;
        }

我想运行setup.exeinstaller.ini文件

如何使用安装程序激活exe文件,作为事件

你需要在安装按钮点击事件时启动一个进程。它将调用你的exe文件

Process.Start("location of your setup file");