创建一个安装两个程序的安装程序?

Creating an installer that installs two programs?

我有一个电子应用程序,我希望我的用户能够安装。但是,此应用程序的依赖项是我压缩在 .zip 文件中的 C++ 程序包。我需要用户解压这个文件,放到Program Files下的某个目录下(目标平台是windows)。是否可以创建一个既安装电子应用程序又包含可以解压缩并放入该目录的有效负载的安装程序?

是的,这是可能的。一个 Electron 应用程序只是一堆文件,您可以随意打包它们。 electron-builder

是打包 Electron 应用程序的好工具

electron-builder 使用 NSIS by default to build Windows setups. It also provides a way to customize the NSIS script

If you want to include additional resources for use during installation, such as scripts or additional installers, you can place them in the build directory and include them with File. For example, to include and run extramsi.msi during installation, place it in the build directory and use the following:

!macro customInstall
  File /oname=$PLUGINSDIR\extramsi.msi "${BUILD_RESOURCES_DIR}\extramsi.msi"
  ExecWait '"msiexec" /i "$PLUGINSDIR\extramsi.msi" /passive'
!macroend

在您的情况下,您可能希望包含 7zip standalone console version 和附加的 .zip 文件,而不是 extramsi.msi。您可以使用此自定义脚本将此文件提取到您想要的任何位置