python - 用于通过单一配置生成 Linux、Windows 和 MacOSX 安装程序的应用程序

标签 python installation cross-platform wix dmg

这就是我想要的:

给定一组定义(最好是用 Python 编写),确定要安装哪些文件以及要运行哪些安装后脚本等。我希望该程序能够为三个主要平台生成安装程序:

  • Windows 上的 MSI
  • MacOSX 上的 dmg
  • Linux 上带有 install.sh(以及 rpm/deb,如果可能)的压缩包

例如,

安装配置.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。

你明白了。这样的程序存在吗? (它可以在幕后利用 Windows 上的 WiX)。

注 1:Foo 可以是用任何编程语言编写的应用程序。这应该不重要。

注 2:特定于平台的事情应该是可能的。例如,我应该能够指定 merge modules在 Windows 上。

最佳答案

查看CPack 。如果您将 CMake 用于构建系统,它与 CMake 配合得很好,但没有它也能工作。它使用 CMake 类型的语法,而不是 Python,但它可以生成 NSIS 安装程序、ZIP 存档、Linux 上的二进制可执行文件、RPM、DEB 和 Mac OS X bundle

关于python - 用于通过单一配置生成 Linux、Windows 和 MacOSX 安装程序的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1430497/

相关文章:

python - os.path.expanduser ("~/x") 是否等同于 os.path.abspath(os.path.expanduser ("~/x"))?

python - Python 线程有问题吗?

python - 在 __init__ 中应用属性 setter 逻辑

python - Google 应用程序引擎 - Django - numpy pandas blaze

c++ - 在 ubuntu 中找不到 pthread_create

c# - 在 .Net 中解压 MSI

python - 如果出现子字符串,则拆分字符串

r - 将 R 基础 - Ubuntu 从 3.4.4 更新到 3.5.2 - Azure

c++ - 如何在 log4cpp 属性文件中使用环境变量

testing - 浏览器测试——是否值得测试多个操作系统?