在 NSIS 脚本中压缩文本文件的最佳方法是什么?

发布于 2024-10-10 11:56:25 字数 76 浏览 8 评论 0原文

假设可以从 NSIS 脚本中压缩文件,那么实现这一目标的最佳方法是什么以及实际的语句是什么?

有内置的 NSIS 指令吗?

Assuming that it is possible to compress a file from within an NSIS script, what is the best way to accomplish that and what would be the actual statement?

Is there a built-in NSIS instruction for that?

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

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

发布评论

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

评论(1

孤云独去闲 2024-10-17 11:56:25

您的问题并没有多大意义,您是在问如何安装文件,还是尝试使用 NSIS 作为某种通用文件压缩实用程序?

这是一个“安装”文件的基本脚本:

Outfile test.exe
Requestexecutionlevel user
Setcompressor LZMA
Page instfiles

Section
;Not a good idea to hardcode the destination like this, 
;normally you would use a directory page so the user can choose
SetOutPath "c:\SaveToThisFolder"

;Take thefile.txt from the system you compile on and output it on the end users system 
;into the directory specified by the SetOutPath call
File "thefile.txt"
Sectionend

如果您正在为某些应用程序编写实际的安装程序,您确实应该查看一些NSIS 附带的示例

Your question does not really make a lot of sense, are you asking how to install a file, or are you trying to use NSIS as some sort of general file compression utility?

Here is a basic script that "installs" a file:

Outfile test.exe
Requestexecutionlevel user
Setcompressor LZMA
Page instfiles

Section
;Not a good idea to hardcode the destination like this, 
;normally you would use a directory page so the user can choose
SetOutPath "c:\SaveToThisFolder"

;Take thefile.txt from the system you compile on and output it on the end users system 
;into the directory specified by the SetOutPath call
File "thefile.txt"
Sectionend

If you are writing an actual installer for some application, you really should take a look at some of the examples that ship with NSIS

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