I just finished porting an application from Windows into Linux.
I have to create an installer of the application.
The application is not open source => I should distribute the application's binaries (executable file, couple .so files, help files and images).
我刚刚完成从Windows迁移到Linux的应用程序。我必须创建应用程序的安装程序。应用程序不是开源的=>我应该分发应用程序的二进制文件(可执行文件,几个.so文件,帮助文件和图像)。
I found several methods to do it:
- RPM and DEB packages;
- installer in .sh files;
- Autopackage.
我发现了几种方法: - RPM和DEB包; - .sh文件中的安装程序; - 自动包装。
I don't like first method (RPM and DEB packages) because I don't want to mantain different packages for different Linux distros.
我不喜欢第一种方法(RPM和DEB包),因为我不想为不同的Linux发行版保留不同的包。
What is the best way to distribute a binary application for Linux?
为Linux分发二进制应用程序的最佳方法是什么?
8 个解决方案
#1
19
Having been through this a couple of times with commercial products, I think the very best answer is to use the native installer for each supported platform. Anything else produces an unpleasant experience for the end-user, and in practice you have to test on every platform you want to support anyway, so it's not really a significant burden to maintain packages for each. The idea that you can create a binary that can "just work" on every platform out there, including some you've never even heard of, just really doesn't work all that well.
经过几次商业化产品,我认为最好的答案是为每个支持的平台使用本机安装程序。其他任何事情都会给最终用户带来不愉快的体验,实际上你必须在你想要支持的每个平台上进行测试,因此维护每个平台的包装并不是一个很大的负担。您可以创建一个可以在每个平台上“正常工作”的二进制文件的想法,包括一些您从未听说过的平台,只是真的不能很好地工作。
My recommendation is that you pick a platform or two to support initially (Red Hat and Ubuntu would be my suggestions) and then let user demand drive the creation of additional installation packages. Perhaps make it known that you're willing to support additional platforms, for a modest fee that covers your time and effort in packaging and testing on that platform. If a platform proves to be very different, you may need to charge more for ongoing support.
我的建议是你选择一个或两个平台来支持最初(Red Hat和Ubuntu将是我的建议),然后让用户要求驱动创建额外的安装包。或许让人知道您愿意支持其他平台,只需支付适当的费用即可节省您在该平台上打包和测试的时间和精力。如果平台被证明是非常不同的,您可能需要为持续支持收取更多费用。
Oh, and I cannot overemphasize the value of virtual machines for scenarios like this. You need to build VMs for each platform you support, and perhaps multiple VMs per platform to make it easy to test different configurations.
哦,我不能过分强调虚拟机对于这种情况的价值。您需要为每个支持的平台构建VM,并且每个平台可能需要多个VM,以便于测试不同的配置。
#2
3
There were a lot of good answers (mine included :)) here. Although that is more about binary compatibility (which you do need to worry about).
这里有很多好的答案(我的包括:))。虽然这更多是关于二进制兼容性(您需要担心)。
For installer I would recommend autopackage (we successfully released several versions of our software with it), they did the "installer.sh" part already and more (desktop integration for example).
对于安装程序,我建议使用autopackage(我们已成功发布了几个版本的软件),他们已经完成了“installer.sh”部分以及更多(例如桌面集成)。
You have to be careful and test your upgrade scenarios and stuff, depending on how complex you package structure is, but it is pretty neat overall. I fixed few bugs with dependency handling in 1.2.6, so it should be fine.
您必须小心并测试升级方案和内容,具体取决于程序包结构的复杂程度,但总体上非常简洁。我在1.2.6中修复了一些带有依赖性处理的bug,所以应该没问题。
#3
2
I tell you an additional possibility, although I am not aware of its status: the Loki installer. Loki was a company doing videogames porting for Linux. It went down in 2002, but the installer is available.
我告诉你一个额外的可能性,虽然我不知道它的状态:Loki安装程序。 Loki是一家为Linux提供移植视频游戏的公司。它在2002年下降,但安装程序可用。
InstallShield is also available for linux. No idea on the status though.
InstallShield也可用于linux。虽然对状态一无所知。
Although many people are proposing you to go with tar.gz, please don't. I assume you want to provide a pleasant experience for the installation procedure to your users. A tar.gz is one of the most low level, low quality, low usability choices you can do. It works everywhere because it does basically nothing, as you know.
虽然很多人建议你使用tar.gz,但请不要。我假设您希望为用户提供安装过程的愉快体验。 tar.gz是您可以做的最低级别,低质量,低可用性选择之一。它可以在任何地方使用,因为它基本上没有,如你所知。
The guys at freedesktop.org and the LSB are quite clear on where to put stuff. What you need is a friendly program to do that. Autopackage imho has the numbers (I love it), but despite its age, I haven't seen a single program out there distributed as an autopackage.
freedesktop.org和LSB的人们非常清楚在哪里放东西。你需要的是一个友好的程序来做到这一点。 autopackage imho有数字(我喜欢它),但尽管它的年龄,我还没有看到一个单独的程序作为自动包装分发。
Evaluate it carefully, but don't skip the chance of being part of the momentum in favour of it, just because it's not popular. If it works for you, and it works for your users, everything else does not matter.
仔细评估它,但不要忽略成为支持它的势头的机会,因为它不受欢迎。如果它适合您,并且它适用于您的用户,其他一切都无关紧要。
#4
2
You may want to try out InstallBuilder. It is crossplatform (runs on Windows, Linux, Mac OS X, Solaris and nearly any other Unix platform out there). It is used by Intel, Motorola, GitHub, MySQL, Nokia/Trolltech and many other companies so you will be in good company :) In addition to binary installers, it can also create cross-distro RPMs and DEB packages.
您可能想要试用InstallBuilder。它是跨平台(在Windows,Linux,Mac OS X,Solaris和几乎任何其他Unix平台上运行)。它被英特尔,摩托罗拉,GitHub,MySQL,诺基亚/奇趣科技和许多其他公司使用,因此您将成为一个好公司:)除了二进制安装程序,它还可以创建跨发行版RPM和DEB包。
InstallBuilder is commercial, but we offer free licenses for open source programs and very significant discounts for mISVs or solo-developers, just drop us a line.
InstallBuilder是商业版,但我们为开源程序提供免费许可,并为mISV或独立开发者提供非常大的折扣,只需给我们留言。
#5
2
There is no best way (universally speaking). tar.gz the binaries, that should work.
没有最好的方法(普遍来说)。 tar.gz二进制文件,应该工作。
#6
2
Create a .tar.bz2 archive with the binary, then publish a feed for it, like this:
使用二进制文件创建.tar.bz2存档,然后为其发布订阅源,如下所示:
<?xml version="1.0" ?>
<interface uri="http://mysite/myprog.xml"
xmlns="http://zero-install.sourceforge.net/2004/injector/interface">
<name>MyProgram</name>
<summary>what it does</summary>
<description>A longer description goes here.</description>
<implementation main='bin/myprog'
id="sha1new=THEDIGEST"
version='1.0'>
<archive href='http://mysite/myprogram-1.0.tar.bz2'
size='10000'/>
</implementation>
</interface>
Sign it with your GPG key. You can use the tools on 0install.net to calculate the digest and add the GPG signature for you in the correct format.
使用您的GPG密钥签名。您可以使用0install.net上的工具计算摘要,并以正确的格式为您添加GPG签名。
Then, put it on your web-site at the address in the uri attribute. Any user on most Linux distributions (e.g. Ubuntu, Fedora, Debian, Gentoo, ArchLinux, etc) can then install and run your program with:
然后,将其放在您的网站上uri属性中的地址。大多数Linux发行版上的任何用户(例如Ubuntu,Fedora,Debian,Gentoo,ArchLinux等)都可以通过以下方式安装和运行您的程序:
0launch http://mysite/myprog.xml
Their system will also check for updates periodically. There are various GUIs for the different desktop environments, but the command-line will work everywhere.
他们的系统还会定期检查更新。不同的桌面环境有各种GUI,但命令行可以在任何地方使用。
Also look at some of the existing feeds for inspiration.
还要看一些现有的灵感源。
#7
0
It's possible to install an RPM on Debian and an APT on RHEL.
可以在Debian上安装RPM,在RHEL上安装APT。
If you are going to statically link this program, or dynamically link only with libraries that you will be distributing in the package, then it doesn't much matter how you distribute it. The simplest way is tar.gz and that would work.
如果您要静态链接此程序,或仅动态链接您将在程序包中分发的库,那么分发它的方式并不重要。最简单的方法是tar.gz,这样可行。
OTOH if it is dynamically linked with system libraries, and particularly if it has dependencies on dynamic libraries that will be shared with the client's other applications, then you kind of need to do either RPM, APT, or both.
OTOH如果它与系统库动态链接,特别是如果它依赖于将与客户端的其他应用程序共享的动态库,那么你需要做RPM,APT或两者兼而有之。
#8
0
I've also looked into this at work and I'd have to agree there really isn't a "best way". If your application is being distributed as source then I'd go with the make/configure methods packaged up in a tar.gz. That seems fairly universal in the Linux world.
我也在研究这个问题,我不得不同意这里没有“最好的方法”。如果您的应用程序是作为源分发的,那么我将使用tar.gz中打包的make / configure方法。这似乎在Linux世界中相当普遍。
A good way to get an idea of what to do is to look at larger organziation and see how they distribute their binaries.
了解要做什么的一个好方法是查看更大的组织,看看他们如何分发他们的二进制文件。
#1
19
Having been through this a couple of times with commercial products, I think the very best answer is to use the native installer for each supported platform. Anything else produces an unpleasant experience for the end-user, and in practice you have to test on every platform you want to support anyway, so it's not really a significant burden to maintain packages for each. The idea that you can create a binary that can "just work" on every platform out there, including some you've never even heard of, just really doesn't work all that well.
经过几次商业化产品,我认为最好的答案是为每个支持的平台使用本机安装程序。其他任何事情都会给最终用户带来不愉快的体验,实际上你必须在你想要支持的每个平台上进行测试,因此维护每个平台的包装并不是一个很大的负担。您可以创建一个可以在每个平台上“正常工作”的二进制文件的想法,包括一些您从未听说过的平台,只是真的不能很好地工作。
My recommendation is that you pick a platform or two to support initially (Red Hat and Ubuntu would be my suggestions) and then let user demand drive the creation of additional installation packages. Perhaps make it known that you're willing to support additional platforms, for a modest fee that covers your time and effort in packaging and testing on that platform. If a platform proves to be very different, you may need to charge more for ongoing support.
我的建议是你选择一个或两个平台来支持最初(Red Hat和Ubuntu将是我的建议),然后让用户要求驱动创建额外的安装包。或许让人知道您愿意支持其他平台,只需支付适当的费用即可节省您在该平台上打包和测试的时间和精力。如果平台被证明是非常不同的,您可能需要为持续支持收取更多费用。
Oh, and I cannot overemphasize the value of virtual machines for scenarios like this. You need to build VMs for each platform you support, and perhaps multiple VMs per platform to make it easy to test different configurations.
哦,我不能过分强调虚拟机对于这种情况的价值。您需要为每个支持的平台构建VM,并且每个平台可能需要多个VM,以便于测试不同的配置。
#2
3
There were a lot of good answers (mine included :)) here. Although that is more about binary compatibility (which you do need to worry about).
这里有很多好的答案(我的包括:))。虽然这更多是关于二进制兼容性(您需要担心)。
For installer I would recommend autopackage (we successfully released several versions of our software with it), they did the "installer.sh" part already and more (desktop integration for example).
对于安装程序,我建议使用autopackage(我们已成功发布了几个版本的软件),他们已经完成了“installer.sh”部分以及更多(例如桌面集成)。
You have to be careful and test your upgrade scenarios and stuff, depending on how complex you package structure is, but it is pretty neat overall. I fixed few bugs with dependency handling in 1.2.6, so it should be fine.
您必须小心并测试升级方案和内容,具体取决于程序包结构的复杂程度,但总体上非常简洁。我在1.2.6中修复了一些带有依赖性处理的bug,所以应该没问题。
#3
2
I tell you an additional possibility, although I am not aware of its status: the Loki installer. Loki was a company doing videogames porting for Linux. It went down in 2002, but the installer is available.
我告诉你一个额外的可能性,虽然我不知道它的状态:Loki安装程序。 Loki是一家为Linux提供移植视频游戏的公司。它在2002年下降,但安装程序可用。
InstallShield is also available for linux. No idea on the status though.
InstallShield也可用于linux。虽然对状态一无所知。
Although many people are proposing you to go with tar.gz, please don't. I assume you want to provide a pleasant experience for the installation procedure to your users. A tar.gz is one of the most low level, low quality, low usability choices you can do. It works everywhere because it does basically nothing, as you know.
虽然很多人建议你使用tar.gz,但请不要。我假设您希望为用户提供安装过程的愉快体验。 tar.gz是您可以做的最低级别,低质量,低可用性选择之一。它可以在任何地方使用,因为它基本上没有,如你所知。
The guys at freedesktop.org and the LSB are quite clear on where to put stuff. What you need is a friendly program to do that. Autopackage imho has the numbers (I love it), but despite its age, I haven't seen a single program out there distributed as an autopackage.
freedesktop.org和LSB的人们非常清楚在哪里放东西。你需要的是一个友好的程序来做到这一点。 autopackage imho有数字(我喜欢它),但尽管它的年龄,我还没有看到一个单独的程序作为自动包装分发。
Evaluate it carefully, but don't skip the chance of being part of the momentum in favour of it, just because it's not popular. If it works for you, and it works for your users, everything else does not matter.
仔细评估它,但不要忽略成为支持它的势头的机会,因为它不受欢迎。如果它适合您,并且它适用于您的用户,其他一切都无关紧要。
#4
2
You may want to try out InstallBuilder. It is crossplatform (runs on Windows, Linux, Mac OS X, Solaris and nearly any other Unix platform out there). It is used by Intel, Motorola, GitHub, MySQL, Nokia/Trolltech and many other companies so you will be in good company :) In addition to binary installers, it can also create cross-distro RPMs and DEB packages.
您可能想要试用InstallBuilder。它是跨平台(在Windows,Linux,Mac OS X,Solaris和几乎任何其他Unix平台上运行)。它被英特尔,摩托罗拉,GitHub,MySQL,诺基亚/奇趣科技和许多其他公司使用,因此您将成为一个好公司:)除了二进制安装程序,它还可以创建跨发行版RPM和DEB包。
InstallBuilder is commercial, but we offer free licenses for open source programs and very significant discounts for mISVs or solo-developers, just drop us a line.
InstallBuilder是商业版,但我们为开源程序提供免费许可,并为mISV或独立开发者提供非常大的折扣,只需给我们留言。
#5
2
There is no best way (universally speaking). tar.gz the binaries, that should work.
没有最好的方法(普遍来说)。 tar.gz二进制文件,应该工作。
#6
2
Create a .tar.bz2 archive with the binary, then publish a feed for it, like this:
使用二进制文件创建.tar.bz2存档,然后为其发布订阅源,如下所示:
<?xml version="1.0" ?>
<interface uri="http://mysite/myprog.xml"
xmlns="http://zero-install.sourceforge.net/2004/injector/interface">
<name>MyProgram</name>
<summary>what it does</summary>
<description>A longer description goes here.</description>
<implementation main='bin/myprog'
id="sha1new=THEDIGEST"
version='1.0'>
<archive href='http://mysite/myprogram-1.0.tar.bz2'
size='10000'/>
</implementation>
</interface>
Sign it with your GPG key. You can use the tools on 0install.net to calculate the digest and add the GPG signature for you in the correct format.
使用您的GPG密钥签名。您可以使用0install.net上的工具计算摘要,并以正确的格式为您添加GPG签名。
Then, put it on your web-site at the address in the uri attribute. Any user on most Linux distributions (e.g. Ubuntu, Fedora, Debian, Gentoo, ArchLinux, etc) can then install and run your program with:
然后,将其放在您的网站上uri属性中的地址。大多数Linux发行版上的任何用户(例如Ubuntu,Fedora,Debian,Gentoo,ArchLinux等)都可以通过以下方式安装和运行您的程序:
0launch http://mysite/myprog.xml
Their system will also check for updates periodically. There are various GUIs for the different desktop environments, but the command-line will work everywhere.
他们的系统还会定期检查更新。不同的桌面环境有各种GUI,但命令行可以在任何地方使用。
Also look at some of the existing feeds for inspiration.
还要看一些现有的灵感源。
#7
0
It's possible to install an RPM on Debian and an APT on RHEL.
可以在Debian上安装RPM,在RHEL上安装APT。
If you are going to statically link this program, or dynamically link only with libraries that you will be distributing in the package, then it doesn't much matter how you distribute it. The simplest way is tar.gz and that would work.
如果您要静态链接此程序,或仅动态链接您将在程序包中分发的库,那么分发它的方式并不重要。最简单的方法是tar.gz,这样可行。
OTOH if it is dynamically linked with system libraries, and particularly if it has dependencies on dynamic libraries that will be shared with the client's other applications, then you kind of need to do either RPM, APT, or both.
OTOH如果它与系统库动态链接,特别是如果它依赖于将与客户端的其他应用程序共享的动态库,那么你需要做RPM,APT或两者兼而有之。
#8
0
I've also looked into this at work and I'd have to agree there really isn't a "best way". If your application is being distributed as source then I'd go with the make/configure methods packaged up in a tar.gz. That seems fairly universal in the Linux world.
我也在研究这个问题,我不得不同意这里没有“最好的方法”。如果您的应用程序是作为源分发的,那么我将使用tar.gz中打包的make / configure方法。这似乎在Linux世界中相当普遍。
A good way to get an idea of what to do is to look at larger organziation and see how they distribute their binaries.
了解要做什么的一个好方法是查看更大的组织,看看他们如何分发他们的二进制文件。