在 c++ 项目的 Visual Studio 安装项目结束时启动 exe

Launching an exe at the end of a Visual Studio Setup Project of a c++ Project

描述如何在 Visual Sutio 安装项目完成后启动 exe 的唯一有用资源是: https://www.codeproject.com/Articles/19560/Launching-Your-Application-After-Install-using-Vis.

但是,我的项目是用 c++ 编写的,我不知道如何集成 InstallerClass.cs,它是一个 c# class。

我知道它没有自动集成到安装中的原因是因为我收到错误:“这个 Windows 安装程序包有问题。一个程序 运行 作为一部分安装没有按预期完成。"

建议大家可以使用InstallShield实现程序安装后自动运行

实现方法是:在InstallScript脚本的OnEnd()函数中,调用可执行程序。

注意:INSTALLDIR预定义变量存储程序的安装目录。

你可以参考下面的例子

//Run dispatcher after installation
strPath=INSTALLDIR+"dispatcher";
strName="Frs.exe";
FindFile(strPath,strName,strResult);
if(strResult!="") then
    strPath=strPath+"\"+strName;
    LaunchAppAndWait(strPath,"",NOWAIT);
endif;