在Linux机器上创建自解压zip归档文件 [英] Creating a self-extracting zip archive on a linux box

查看:114
本文介绍了在Linux机器上创建自解压zip归档文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我没有遇到很多限制,所以我必须在linux机器上创建一个自解压ZIP归档文件.生成的归档文件只能在Windows上执行.这是可能吗?如果是这样,什么工具可以完成这项工作?

Due to a number of constraints that I won't get into, I have to create a self-extracting ZIP archive on a linux box. The resulting archive should be executable on Windows only. Is this at all possible? If so, what tools would do the job?

背景:当用户从我的linux盒下载安装程序包时,我需要使用特定的密钥预填充该安装程序包.我只在运行时知道该键;我的想法是使用该密钥编写一个简单的.xml文件,然后将具有该xml文件的.msi安装程序压缩到一个自解压存档中,然后将该文件发送到浏览器.如果您对如何实现它有其他想法,我也很想听听那些消息

Background: when the user downloads a setup package from my linux box, I need that setup package to be pre-populated with a certain key. I only know that key at runtime; my idea was to write a simple .xml file with that key, then zip up the .msi installer with that xml file into a self-extracting archive, and send that file to the browser. If you have alternative ideas on how to make it happen, I'd love to hear those, too

推荐答案

可以在以下页面找到您的答案: http://ubuntuforums.org/showthread.php?t=847329 请注意,除了使用Google并找到在逻辑上听起来可行的东西外,我不承担任何其他责任.我不保证这些信息将起作用,或者您将不再能够在网上找到所提到的材料.我只是Google的粉丝.我希望这会有所帮助.

Your answer can be found at the following page: http://ubuntuforums.org/showthread.php?t=847329 Please note that I do not take credit for anything other than using Google and finding something that sounds logically like it would work. I do not guarantee that this information will work, or that you will be able to find the mentioned materials online anymore. I'm just a fan of Google. I hope this helps.

问题几天前我不得不 创建一个Win32兼容 朋友的自解压ZIP文件. 听起来很简单,对.问题是 我没有Windows机器 附近,我不想安装 Wine下的所有存档程序.

The problem A few days back I had to create a Win32 compatible self-extracting ZIP file for a friend. Sounds easy, right. The problem was that I didn't have a Windows machine nearby and I didn't want to install any archiving programs under Wine.

注意:一个免费的ZIP程序,例如 Wine下的IZArc可用于创建 一个Win32自解压ZIP文件. 这将不包括在内 howto,抱歉.

NOTE: A freeware ZIP program such as IZArc under Wine can be used to create a Win32 self-extracting ZIP file too. That will not be covered by this howto, sorry.

我在Google上搜索的研究" 此论坛帖子的日期为2003年8月. 阅读它,我发现 自解压ZIP文件什么都没有 更多,但合适的解压缩二进制文件 然后是普通的ZIP文件.我用了 Info-ZIP中包含的unzipsfx.exe 解压缩5.52.

The "research" Googling around I found this forum post dated August 2003. Reading it I found out that self-extracting ZIP files are nothing more but a suitable unzip binary followed by a normal ZIP file. I used the unzipsfx.exe included in Info-ZIP UnZip 5.52.

该帖子上的链接起作用了一些 几天前,所以我开始动手了 我正在寻找的unzipsfx.exe. 今天,2008年7月2日,我找到了链接 死的.经过一番谷歌搜索后,我没有 在任何地方找到有效的链接.我读 几次牌照,并了解 我可以重新分发原始文件 包含许可证的unzipsfx.exe.

The link on that post worked a few days ago so I got my hands on the unzipsfx.exe that I was looking for. Today, 2nd July 2008 I found the link dead. After some googling I didn't find a working link anywhere. I read the licence a few times and understood that I can redistribute the original unzipsfx.exe with a license included.

请注意 unzipsfx-552_win32.tar.gz(80 kB)是 不是官方的Info-ZIP软件包,并且 它包括受版权保护的软件,该软件 我不相信.更多信息 还包含的Info-ZIP许可证 在压缩包中.的源代码 包含的二进制文件可以找到 在这里.

Please note that the unzipsfx-552_win32.tar.gz (80 kB) is not an official Info-ZIP package and it includes copyrighted software that I take no credit for. More info in the Info-ZIP license that is also included in the tarball. The source code for the binaries included can be found here.

解决方案

第一步,获取unzipsfx.exe和 拉链包: *打开终端(在Ubuntu中按alt + f2并键入gnome-terminal) *输入以下命令代码:

Step one, getting the unzipsfx.exe and zip package: * open the Terminal (in Ubuntu press alt+f2 and type gnome-terminal) * type in the following commands Code:

wget http://kolmoskone.homelinux.org/~kaja/kamaa/unzipsfx -552_win32.tar.gz tar zxf解压缩fx-552_win32.tar.gz sudo apt-get install zip

wget http://kolmoskone.homelinux.org/~kaja/kamaa/unzipsfx-552_win32.tar.gz tar zxf unzipsfx-552_win32.tar.gz sudo apt-get install zip

第二步,在 Ubuntu: *打开文件管理器(nautilus),然后选择要包含的文件 拉链 *右键单击并选择创建归档文件(或类似文件).选择一个 ZIP文件的位置,使用 主目录是最简单的.选择 键入.zip.参见man zip以获取信息 关于如何在命令中创建一个ZIP文件 线.

Step two, creating a ZIP file in Ubuntu: * open the file manager (nautilus) and select the files you want to have zipped * right click and select Create an archive (or similar). Select a location for the ZIP file, using your home directory is the easiest. Select type .zip. See man zip for information on how to create a ZIP file in command line.

第三步,制作ZIP文件 自解压 *输入以下命令代码:

Step three, making the ZIP file self-extracting * type in the following commands Code:

cat unzipsfx-552_win32/unzipsfx.exe MYZIPFILE.zip> mysfxfile.exe zip -A mysfxfile.exe

cat unzipsfx-552_win32/unzipsfx.exe MYZIPFILE.zip > mysfxfile.exe zip -A mysfxfile.exe

mysfxfile.exe现在可以在任何位置打开 Win32兼容系统(包括用于 例如Windows XP/2000/Vista,甚至 Linux中的Wine)或任何ZIP兼容文件 存档程序,例如文件滚轮 Ubuntu.

mysfxfile.exe can now be opened in any Win32 compatible system (including for example Windows XP/2000/Vista and even Wine in Linux) or ANY ZIP COMPATIBLE archive program such as file-roller in Ubuntu.

这篇关于在Linux机器上创建自解压zip归档文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆