独立的可执行文件和已安装的可执行文件有什么区别?

虽然我们大多数人都满足于为自己喜欢的软件安装可执行文件的“久经考验的”过程,但真的有必要这样做吗?我们真的可以提取那些相同的可执行文件而不是安装它们,并像它们的独立同类一样运行它们吗?...

独立的可执行文件和已安装的可执行文件有什么区别?

虽然我们大多数人都满足于为自己喜欢的软件安装可执行文件的“久经考验的”过程,但真的有必要这样做吗?我们真的可以提取那些相同的可执行文件而不是安装它们,并像它们的独立同类一样运行它们吗?

今天的问答环节是由SuperUser提供的,SuperUser是Stack Exchange的一个分支,是一个由社区驱动的问答网站分组。

问题

超级用户读者Tom Turkey想知道独立可执行文件和已安装可执行文件之间的区别:

I have noticed on Windows, at least, that you can download a direct, statically-linked executable file and launch it directly, or write your own program and execute it (even dynamically) without having to install it.

That brings me to my main point…what’s the purpose of the installation process? I mean besides maybe the Windows Registry. However, for practicality and usage purposes, it’s possible to have a single, independent, stand-alone program that can be run, stored on non-volatile storage, and accessed via the file system of whatever device it’s on, and executed on the OS.

So what’s the big deal with all the “install this” business if many great programs of virtually any magnitude can work perfectly without going through an installation configuration? It puzzles me a bit, and aside from a database or other metadata/access configuration systems, what is the real difference here if the latter (an installed executable) performs and works in the same way as a stand-alone?

Is there a difference here I’m unaware of with a non-installed program versus an installed one?

PS: This doesn’t just have to apply to Windows OSes, but any that implement a similar function.

独立的可执行文件和已安装的可执行文件之间真的有那么大的区别吗?还是它们比我们想象的更相似?

答案

超级用户贡献者Wyatt8740为我们提供了答案:

Brief answer: a stand-alone exe requires no libraries be installed on the computer to run, and requires no registry entries or other components.

An installed file can be a stand-alone in an installer package, but is generally dependent on a variety of components and libraries installed alongside it.

In many cases, through the use of Universal Extractor (unofficial update: here), you can extract the contents of an installer and run a program without administrative privileges in Windows. MSI installers can be unpacked with les**si.

In most other operating systems, all programs can be run without root/administrator privileges, through user-specific ‘bin’, ‘lib’, and other directories in the home directory. Personally, I despise installers the majority of the time, because they make it harder for me to use programs without administrative privileges when I don’t have them. But they are packaged that way by large companies to simplify the process for the average end user.

虽然我们已经了解到,可以提取和运行一些我们喜爱的软件作为独立的可执行文件,但有时为了在我们的系统上使用我们喜欢或需要的程序,我们无法逃避旧的“久经考验的”安装过程。


有什么要补充的解释吗?在评论中发出声音。想从其他精通技术的Stack Exchange用户那里了解更多答案吗?请在这里查看完整的讨论主题(包括大大扩展的答案)。

  • 发表于 2021-04-11 13:14
  • 阅读 ( 201 )
  • 分类:互联网

你可能感兴趣的文章

连接器(linker)和装载机(loader)的区别

...码与其他文件(如头文件)链接起来并创建扩展名为.exe的可执行文件的软件。加载程序是将链接器生成的可执行文件加载到主内存的系统软件。这是链接器和加载器之间的关键区别。 目录 1. 概述和主要区别 2.什么是链接器 3. ...

  • 发布于 2020-10-19 05:42
  • 阅读 ( 220 )

编译时间(compile time)和运行时(runtime)的区别

...义分析和代码生成等任务在编译时发生。运行编译时生成的可执行文件的时间段称为运行时。这两个术语都与不同的程序生命周期阶段有关。本文讨论编译时和运行时之间的区别。编译时和运行时的关键区别在于,编译时是将源...

  • 发布于 2020-10-19 10:25
  • 阅读 ( 769 )

源程序(source program)和目标程序(object program)的区别

... 源程序与目标程序的主要区别在于源程序是程序员编写的可读程序,而目标程序是通过编译源程序创建的机器可执行程序。 源程序可以编译或解释以供执行。反编译器有助于将目标程序转换回其原始源程序。需要注意的是,...

  • 发布于 2020-10-26 14:27
  • 阅读 ( 189 )

如何从linux命令行查看二进制文件

...总是知道它们的入口点和函数的位置。定位在随机地址的独立可执行文件(PIE)克服了这种敏感性。 如果我们用gcc编译器编译程序并提供-no-pie选项,我们将生成一个常规的可执行文件。 -o(输出文件)选项允许我们为可执行文...

  • 发布于 2021-04-02 04:41
  • 阅读 ( 354 )

如何在linux中向$path添加目录

...搜索顺序。 如果要查看命令是shell内置、别名、函数还是独立二进制mv/work/unfile,可以使用type命令,如下所示: type clear type cd 这告诉我们clear是一个二进制文件,在路径中找到的第一个文件位于/usr/bin。您的计算机上可能安装...

  • 发布于 2021-04-02 14:04
  • 阅读 ( 185 )

linux下如何使用which命令

...查找这些命令。 但是Bash如何定位其他命令、程序和外部独立二进制文件呢?Bash使用路径,实际上是一组路径,每个路径指向一个目录。然后,它在每个目录中搜索与您试图运行的命令或程序匹配的可执行文件。当它找到一个时...

  • 发布于 2021-04-02 20:07
  • 阅读 ( 166 )

如何在插入usb驱动器时自动运行windows程序

便携应用程序是一种自包含的可执行文件,可以移动到闪存驱动器上,无需安装即可运行,对于任何需要在多台Windows机器上工作的人来说都是很流行的工具。如果您想让您的工作流程更快,您可以添加一个“自动运行”文件,...

  • 发布于 2021-04-07 06:27
  • 阅读 ( 174 )

如何使用命令行在linux中查找文件和文件夹

...我们将在本文后面向您展示一个命令,它允许您确定命令的可执行文件(如果存在)的位置。 mlocate命令与标准locate命令不使用相同的数据库文件。因此,您可能希望通过在提示下键入以下命令手动创建数据库: sudo /etc/cron.daily...

  • 发布于 2021-04-07 17:51
  • 阅读 ( 179 )

如何在windows中用另一个文本编辑器替换记事本

...安装的应用程序的情况,所以最好找一个你可以作为一个独立的ZIP包下载的应用程序。便携应用是理想的选择。 我们已经测试了Metapad和Notepad2,它们都可以工作。如果你使用的是另一个应用程序,那么测试它是否有效就很容易...

  • 发布于 2021-04-08 07:22
  • 阅读 ( 131 )

如何使用cameyo在windows8.1中创建应用程序的可移植版本

...你在日常工作中使用,而不是其中之一。Cameyo是一个免费的可移植应用程序创建者,它从整个Windows程序中创建一个可执行(.exe)文件。将此文件复制到USB闪存驱动器或外部硬盘驱动器,您就可以在任何Windows计算机上运行该程序...

  • 发布于 2021-04-11 10:32
  • 阅读 ( 261 )
Es1ee
Es1ee

0 篇文章

相关推荐