无需安装 GTK# 即可将 GTK Sharp 应用程序部署到 Windows
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5816895/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Deploy GTK Sharp applications to Windows without installing GTK#
提问by Kiril
I am developing a GTK# mono application under openSuse, but I am interested in deploying it for all three platforms (Windows 7, Snow Leopard and as many Linux distributions as I can test on).
我正在 openSuse 下开发一个 GTK# 单声道应用程序,但我有兴趣将它部署到所有三个平台(Windows 7、Snow Leopard 和我可以测试的尽可能多的 Linux 发行版)。
Deploying on Linux is not a problem as GTK# comes with the mono libraries, but for Windows I would not like to force the users to install GTK#. Is there a way to embed GTK# in the application, or at least integrate its installation with the installation of my program?
在 Linux 上部署不是问题,因为 GTK# 带有单声道库,但对于 Windows,我不想强迫用户安装 GTK#。有没有办法在应用程序中嵌入 GTK#,或者至少将其安装与我的程序安装集成?
采纳答案by ApprenticeHacker
You may deploy GTK# applications without forcing users to install GTK# for .NET on Windows in a number of ways.
您可以通过多种方式部署 GTK# 应用程序,而无需强制用户在 Windows 上安装 GTK# for .NET。
You may embedthe entire Mono runtime (19 MB overhead) into your Application. Then there won't be anydependencies, your users won't even need to install .NET or MONO. Here's a Guide(I think Banshee uses this).
You may copy all the GTK# assemblies into your program directory. It isn't recommended however because you may run into a lot of problems if the user has another version of the Gtk runtime installed. (Yes GTK+ also needs a runtime).
You may integrate the GTK# installer with the Windows Installer of your application. (Then your users will be able to install both with a single click, no forcing). Many Installer programs can do this.
You may use a Package Management System.
You may use Deployment Management / Dependency Management Software, but this is expensive since all the good ones are propriety.
您可以将整个 Mono 运行时(19 MB 开销)嵌入到您的应用程序中。这样就不会有任何依赖项,您的用户甚至不需要安装 .NET 或 MONO。这是一个指南(我认为 Banshee 使用这个)。
您可以将所有 GTK# 程序集复制到您的程序目录中。但是不推荐这样做,因为如果用户安装了另一个版本的 Gtk 运行时,您可能会遇到很多问题。(是的 GTK+ 也需要运行时)。
您可以将 GTK# 安装程序与应用程序的 Windows 安装程序集成。(然后您的用户只需单击一下即可安装两者,无需强制)。许多安装程序可以做到这一点。
您可以使用包管理系统。
您可以使用部署管理/依赖管理软件,但这很昂贵,因为所有好的软件都是适当的。
Though these workarounds can save trouble for your users, in the long run I recommend option 3
. It may prove worthwhile to have your users install GTK# because other workarounds may ultimately give more inconvenience to your users than a simple extra installation.
虽然这些变通办法可以为您的用户省去麻烦,但从长远来看,我推荐选项3
. 让您的用户安装 GTK# 可能被证明是值得的,因为与简单的额外安装相比,其他解决方法最终可能会给您的用户带来更多不便。