哪些编程语言可以生成自包含的 windows .exes?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2585998/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 14:13:49  来源:igfitidea点击:

Which programming languages that can generate self contained windows .exes?

windowsexe

提问by Yazz.com

I want to make an easy to deploy Windows application and was was wondering which programming systems can create totally self contained Windows .exe files?

我想制作一个易于部署的 Windows 应用程序,并且想知道哪些编程系统可以创建完全独立的 Windows .exe 文件?

As a plus, if the same can be done with MacOSX and Linux from the same source this would be a bonus. I took a look at Realbasic but they have since abandoned the single .exe concept.

另外,如果相同来源的 MacOSX 和 Linux 可以做到这一点,这将是一个奖励。我看了一下 Realbasic,但他们已经放弃了单一的 .exe 概念。

update: i am looking for something that can run from Windows XP up to Windows 7, no matter what version of .NET is installed. Is this even possible?

更新:我正在寻找可以从 Windows XP 运行到 Windows 7 的东西,无论安装什么版本的 .NET。这甚至可能吗?

采纳答案by Davy Landman

Delphicompiles to one executable, and generates native windows executables. So no dependencies to any kind of framework. If you use Free Pascal (fpc)and the Lazarus IDE, you could even develop for Linux and Apple from the same source.

Delphi编译为一个可执行文件,并生成本机 Windows 可执行文件。所以不依赖于任何类型的框架。如果您使用Free Pascal (fpc)Lazarus IDE,您甚至可以从同一来源为 Linux 和 Apple 开发。

If your using external dll's this would become a bit more tricky, but you could pack them up in your resource file and still maintain the one exe property.

如果您使用外部 dll,这会变得有点棘手,但您可以将它们打包在您的资源文件中,并且仍然保持一个 exe 属性。

回答by Eric Petroelje

You can certainly do this with C/C++. Technically the runtime libraries are required, but they should already be installed on any windows, mac or linux system.

你当然可以用 C/C++ 做到这一点。从技术上讲,运行时库是必需的,但它们应该已经安装在任何 windows、mac 或 linux 系统上。

With .NET you can compile to an EXE, but of course the .NET framework is required. For newer versions of windows it should be installed by default, but on older versions (XP or older?) it may or may not be there. And of course you couldn't expect mono to be there by default on linux or mac either.

使用 .NET,您可以编译为 EXE,但当然需要 .NET 框架。对于较新版本的 Windows,它应该默认安装,但在较旧版本(XP 或更旧?)上,它可能存在也可能不存在。当然,您也不能指望在 linux 或 mac 上默认存在单声道。

回答by Stephen Kellett

For Windows the following languages are viable:

对于 Windows,以下语言是可行的:

  • C (MS, gcc)
  • C++ (MS, g++, Digital Mars)
  • D (Digital Mars)
  • Delphi (Embarcadero??? how do you spell that? just trips off the tongue doesn't it?)
  • Fortran (Intel, Salford Software)
  • Visual Basic 6 (MS)
  • Lua (you'll need a special toolto do it, but it is doable)
  • C#, VB.Net, F#, J#, etc (assuming that you don't mind using .Net technology)
  • C (MS, gcc)
  • C++(MS、g++、数字火星)
  • D(数字火星)
  • 德尔福(Embarcadero ???你怎么拼写?只是从舌头上绊倒不是吗?)
  • Fortran(英特尔、索尔福德软件)
  • Visual Basic 6 (MS)
  • Lua(你需要一个特殊的工具来做到这一点,但它是可行的)
  • C#、VB.Net、F#、J# 等(假设您不介意使用 .Net 技术)

回答by ytw

JavaFX 2.2 supports that. It allows creation of self-contained applications targeting Windows, Mac OS, and Linux.

JavaFX 2.2 支持这一点。它允许创建针对 Windows、Mac OS 和 Linux 的自包含应用程序。

Please follow this link for more information: http://docs.oracle.com/javafx/2/deployment/self-contained-packaging.htm.

请点击此链接了解更多信息:http: //docs.oracle.com/javafx/2/deployment/self-contained-packaging.htm

回答by Bryan Oakley

You can use Tcl/tk. The technology you should research is a "starpack", which combines a runtime executable (a starkit) with a platform-specific runtime (a "tclkit") to create a single-file executable. It's remarkable in the fact that it's not just compiled code, but an entire self-contained virtual filesystem that can include images, sound, data, etc.

您可以使用 Tcl/tk。您应该研究的技术是“starpack”,它将运行时可执行文件(starkit)与特定于平台的运行时(“tclkit”)结合起来,以创建单文件可执行文件。值得注意的是,它不仅仅是编译后的代码,而是一个完整的自包含虚拟文件系统,可以包含图像、声音、数据等。

This same technology works for many platforms from the same code base. The only thing that is different is the platform-specific runtime. You can even "cross compile" in that you can copy the runtime for multiple platforms onto your dev box and then build starpacks for each platform without having to actually be on each platform.

这种相同的技术适用于来自相同代码库的许多平台。唯一不同的是特定于平台的运行时。您甚至可以“交叉编译”,因为您可以将多个平台的运行时复制到您的开发箱中,然后为每个平台构建 Starpack,而不必实际在每个平台上。

回答by Donal Fellows

Tcl can do this, especially through producing starpacks. They can be produced for all platforms from the same code. Note that this also includes all the necessary runtime libraries (except for things like the C library, but you don't want to make thatstatic under normal circumstances).

Tcl 可以做到这一点,尤其是通过生产starpacks。它们可以从相同的代码为所有平台生成。请注意,这还包括所有必需的运行时库(C 库之类的库除外,但您不想在正常情况下将设为静态)。

回答by Dz-S.T.A.L

c/c++ purebasic delphi vb6

c/c++ purebasic delphi vb6

i hope this help :)

我希望这会有所帮助:)

回答by Nicero

Here's a good source for a number of basic-like programming languages that build small stand-alone EXEs. Some are cross-platform for Windows and Linux:

这是许多构建小型独立 EXE 的类似基本的编程语言的良好来源。有些是 Windows 和 Linux 的跨平台:

www.basic.mindteq.com

www.basic.mindteq.com

回答by Ashutosh

You can use Liberty Basic which is easy and cheap, you can easily make stand alone programs for windows but not possible to transfer to MacOS or Linux.

您可以使用既简单又便宜的 Liberty Basic,您可以轻松地为 Windows 制作独立程序,但无法转移到 MacOS 或 Linux。

回答by BigJoe714

I would recommend taking a look at AutoIt. It is an easy-to-use scripting language that will compile into an exe, so there are no runtimes needed. This would be for windows only though.

我建议看看 AutoIt。它是一种易于使用的脚本语言,可以编译为 exe,因此不需要运行时。不过,这仅适用于 Windows。

http://www.autoitscript.com/autoit3/index.shtml

http://www.autoitscript.com/autoit3/index.shtml

From the website:

从网站:

AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. ... AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying "runtimes" required!

AutoIt v3 是一种类似 BASIC 的免费软件脚本语言,旨在自动化 Windows GUI 和通用脚本。... AutoIt 也非常小巧、自成一体,可在所有版本的 Windows 上开箱即用,无需烦人的“运行时”!