通过单一配置生成适用于Linux,Windows和MacOSX的安装程序的应用程序 [英] Application to generate installers for Linux, Windows and MacOSX from a single configuration

查看:123
本文介绍了通过单一配置生成适用于Linux,Windows和MacOSX的安装程序的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这就是我想要的:

给出一组定义(最好在Python中),以定义要在何处安装什么文件以及要运行什么后安装脚本等.我希望该程序为三个主要平台生成安装程序:

Given a set of definitions (preferably in Python) on what files to install where and what post-install script to run, etc.. I would like this program to generate installers for the three major platforms:

  • Windows上的MSI
  • 在MacOSX上为dmg
  • 在Linux上具有install.sh(以及rpm/deb,如果可能的话)的棒球

例如,

installconfig.py:

installconfig.py:

name = 'Foo'
version = '1.0'

components = {
    'core': {'recursive-include': 'image/'
              'target_dir': '$APPDIR'}
    'plugins': {'recursive-include': 'contrib/plugins',
                 'target_dir': '$APPDIR/plugins'}
}

def post_install():
    ...

我希望该程序生成Foo-1.0.x86.msi,Foo-1.0.universal.dmg和Foo-1.0-linux-x86.tar.gz.

And I want this program to generate Foo-1.0.x86.msi, Foo-1.0.universal.dmg and Foo-1.0-linux-x86.tar.gz.

您明白了.是否存在这样的程序? (它可以在后台使用Windows上的WiX.)

You get the idea. Does such a program exist? (It could, under the hood, make use of WiX on Windows).

注意1 :Foo可以是用任何编程语言编写的应用程序.没关系.

NOTE 1: Foo can be an application written in any programming language. That should not matter.

注意2 :特定于平台的内容应该是可能的.例如,我应该能够在Windows上指定合并模块.

NOTE 2: Platform-specific things should be possible. For example, I should be able to specify merge modules on Windows.

推荐答案

查看 CPack .如果将CMake用于您的构建系统,它可以很好地与CMake一起使用,但是如果没有它,它也可以使用.它使用CMake类型的语法,而不是Python,但是可以生成NSIS安装程序,ZIP存档,Linux,RPM,DEB和Mac OS X捆绑软件上的二进制可执行文件.

Look into CPack. It works very well with CMake, if you use that for your build system, but it also works without it. This uses CMake-type syntax, not Python, but it can generate NSIS installers, ZIP archives, binary executables on Linux, RPMs, DEBs, and Mac OS X bundles

这篇关于通过单一配置生成适用于Linux,Windows和MacOSX的安装程序的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆