nsis - nsis 中的组件共享文件
问题描述
我有 4 个 nsis 组件,它们有几个共享文件,每个都有不同的文件夹。
如何包含共享文件并将它们复制到选定的组件文件夹中?通常,如果我将共享文件与文件一起包含在一个部分中,那么我将在安装程序中有重复的文件,并且安装程序会很重。
我可以为这个问题做些什么?
解决方案
As far as I understand it, the SetDatablockOptimize
instruction will optimize the installer and not include duplicate files.
This command tells the compiler whether or not to do datablock optimizations. Datablock optimizations have the compiler check to see if any data being added to the data block is already in the data block, and if so, it is simply referenced as opposed to added (can save a little bit of size). It is highly recommended to leave this option on.
Apart from that, you could always use functions that extract the files and change the output path before calling those functions.
Section
SetOutPath "first_path"
Call ExtractBaseFiles
SetOutPath "second_path"
Call ExtractBaseFiles
SectionEnd
Function ExtractBaseFiles
File "first_file"
File "second_file"
FunctionEnd
推荐阅读
- anylogic - 限制由 if else 函数选择的托盘架的空间
- android - RecyclerView 中的 BaseAdapter 仅显示一项问题
- spring - 如何测试 commonsMultipartFile 文件?
- python - 无法通过 SubProcess 库对 Python Flask 服务进行后台处理
- r - 对于 R 中的大矩阵,如何有效地计算所有可能组合中的归一化比率?
- python - 如何使用python获取特定的文本表单xml文件?
- reactjs - 单击提交按钮期间未触发验证
- node.js - Gremlin Javascript 按功能排序
- ios - 如何找出哪个约束不起作用或产生问题
- ionic-framework - 离子/模板服务工作者不会自动更新