简体   繁体   English

如何将文件添加到现有NSIS安装程序

[英]How to add file to existing NSIS installer

I have an NSIS-generated installer and I need to create a new installer that is exactly the same, but has one extra file. 我有一个NSIS生成的安装程序,我需要创建一个完全相同的新安装程序,但有一个额外的文件。 What is the most direct way to do it? 最直接的方法是什么? I would prefer if I didn't have to keep the NSIS scripts around. 如果我不必保留NSIS脚本,我更愿意。 I have tried asking 7-Zip to simply add the file to the archive, but it says it does not support adding for this kind of archive. 我试过要求7-Zip简单地将文件添加到存档中,但它表示它不支持添加此类存档。

I noticed this similar question , but the solution suggested there (to provide the files separately) is not an option, because the installer is for end users. 我注意到这个类似的问题 ,但是建议的解决方案(单独提供文件)不是一个选项,因为安装程序是针对最终用户的。

7zip can extract files from [certain] NSIS installers but it cannot insert new ones. 7zip可以从[某些] NSIS安装程序中提取文件,但不能插入新文件。 NSIS has specific structure and it is sophisticated system not only simple archive. NSIS具有特定的结构,它是复杂的系统,不仅简单的存档。

If you have script for an old installer that simply add new file to it and recompile installer from sources. 如果您有旧安装程序的脚本,只需向其添加新文件并从源重新编译安装程序。 There is no other simple way to do it. 没有其他简单的方法可以做到这一点。

If you don't want to keep the .nsi you can store it in the installer instead 如果您不想保留.nsi,则可以将其存储在安装程序中

Section
goto +2
File "${__FILE__}"
SectionEnd

and just extract the .nsi with 7zip when you need to recompile... 当你需要重新编译时,只需用7zip解压缩.nsi ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM