在 php 中动态创建自解压 zip

发布于 2024-12-22 14:51:49 字数 362 浏览 4 评论 0原文

我正在编写一个打包一些文件的 php 脚本(一个 setup.exe 和一个 licence.txt,它是直接在 php 中为用户创建的)。我们不希望用户必须解压缩它并启动 setup.exe。 在计算机上,我们通过使用自解压 zip 解决了这个问题:

zip 称为 setup.exe zip 包含应用程序的图标 提取的目标是临时文件夹 解压过程是隐藏的

,所以如果用户点击setup.exe,他不知道这个setup.exe最后是一个zip。

但是在服务器上的 php 脚本中也可以这样做吗? 我尝试了普通的 ziparchive 对象和 pclzip,我可以使用这些库创建 zip。但我无法更改上面的参数...

谁能告诉我是否有解决方案?

I'm working on a php script packaging some files (a setup.exe and a licence.txt which is created direct in php for the user). We don't want that the user has to unzip it and start setup.exe.
On the computer we solved that by using selfextracting zips with:

zip is called setup.exe
zip has icon of the application
destination of extraction is temporary folder
extracting process is hidden

So if the user click on setup.exe he don't know that this setup.exe is a zip at the end.

But is that also possible on the server in the php script?
i tried the normal ziparchive object and pclzip and i can create the zip with these libraries. But i cannot change the parameters above...

Can anyone tell me if there's a solution for this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

相对绾红妆 2024-12-29 14:51:49

使用 PHP:exec 运行压缩和编译 exec 文件的外部应用程序,里面有你需要的东西。

PHP没有内置的函数来压缩和编译可执行文件。

Use PHP:exec to run an external application that compress and compile your exec file, with your stuff inside as you need.

PHP don't have built-in function to compress and compile and executable file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文