将文件夹压缩为 exe 以在 Windows 中重复使用的最佳方法
我有一个有点荒谬的需要,即为最终用户提供一种非常简单的方法,将其系统上的程序文件中的程序目录捕获到自解压文件中,他们可以使用该文件在其他系统上复制该目录。
我想知道我有什么选择来提供尽可能接近一键点击的功能。最终用户不会费心自己压缩它,等等。
这些用户有这种需求,因为我们公司在相当长的时间内没有存档旧安装,并且升级并不总是一种选择。
I have the somewhat ridiculous need to provide an end-user with a VERY easy way to snag a program directory from Program Files on their system into a self extracting file they can use to replicate the directory on other systems.
I'm wondering what my options are to provide this as close to 1-click as possible. End users will not bother with zipping it themselves, etc.
These users have this need because our company did not archive old installs for a sizable gap of time and upgrading is not always an option.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
听起来您好像误以为您可以简单地将目录从一台计算机上的程序文件复制到一台新计算机上的程序文件中,并且它应该可以工作。
大多数 Mac 软件都是这样工作的,如果所有软件都这样工作那就太好了。
遗憾的是,Windows 安装程序经常在不同位置安装各种文件,将关键信息放入 Windows 注册表项,并具有其他注册和反盗版机制,导致该程序无法在新计算机上运行。
请参阅“是否可以仅克隆软件在机器上?”,“复制全部硬盘(具有 32 位 Windows 7)中安装的程序和文件并将其克隆/传输到另一台具有 64 位 Windows 7 的计算机", "有办法吗克隆 NTFS 硬盘但保留一些文件?”,等等。
如果您以某种方式知道您的特定应用程序没有这些外部依赖项,并且在仅复制文件夹,那么也许你可以:
或者,
It sounds like you laboring under the delusion that you can simply copy a directory from Program Files on one machines, into the Program Files on a new machine, and it should Just Work.
Most Mac software works that way, and it would be nice if all software worked that way.
Alas, Windows installers often install various files in a variety of locations, put critical information into Windows Registry entries, and have other registration and anti-piracy mechanisms such that the program does not work on the new machine.
See "Is it possible to clone only the software on a machine?", "Copy all installed programs & files in a hard disk (which has 32 bit Windows 7) and clone/transfer it to another computer which has 64 bit Windows 7", "Is there a way to clone an NTFS hard drive but leave some files out?", etc.
If you somehow know for a fact that your particular application does not have those external dependencies and will work just fine on the new machine after copying only the folder, then perhaps you could:
Or
如果您只是在寻找应用程序,那么使用 7zip 创建自解压 zip 可能是一个选择。如果您正在寻找一个库来编写自己的应用程序,那么您可以查看 ionic zip 并使用程序文件文件夹的环境变量来查找该文件夹(但是您只是压缩一个文件夹,其他依赖文件夹怎么样和注册表项?)。或者,如果您愿意复制整个系统,您也可以轻松地对其进行 Ghost/wim。
If you're just looking for an app then creating a self-extracting zip with 7zip may be an option. If you're looking for a lib to write your own app then you could look into ionic zip and use the environment variable for the program files folder to find that folder (but then you're just zipping a folder, how about other dependant folders and registry entries?). Or if you're willing to duplicate entire systems you could just as easily ghost/wim it.
我推荐 winrar 和自解压存档。 winrar 仍然是最好的存档和压缩程序之一。不是很贵。您将获得终身更新和支持许可证。自解压存档有很多选项,例如不同的预处理和不同的压缩器。它可以将存档分割成不同的大小。它有一个纠错代码,可以与命令行一起使用来编写脚本。这是一个完美的一键式解决方案。
I would recommend winrar and a self-extracting archive. winrar is still one of the best archive and compressor program availabe. It's not very expensive. You get a liftime update and support license. Self-extracting archive has many options like different pre-processing and different compressors. It can split the archive into different size. It's has an error correction code and it can be used with the command-line for scripting. It's a perfect 1-click solution.