如何在开发人员之间划分 NSIS 脚本?

发布于 2024-07-21 05:05:06 字数 138 浏览 6 评论 0原文

我想将 NSIS 安装程序的开发任务分配给几个开发人员。 我如何以物理方式组织代码? 当他们签入 SVN 时,是否必须编辑和合并单个 .nsi 脚本? 是否可以将 NSIS 脚本划分为模块化的独立文件? 这将是理想的。

谢谢!

I'd like to divide tasks for the development of a NSIS installer among a couple of developers. How can I physically organize the code? Do they have to edit and merge the single .nsi script when they check into SVN? Is it possible to divide NSIS scripts into modular, separate files? This would be ideal.

Thanks!

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

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

发布评论

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

评论(4

梦途 2024-07-28 05:05:06

我使用一个“主”nsi 文件来构成实际的安装程序生成和 MUI 代码,但它包含 nsi 文件中的“额外”函数定义以及每个安装程序“部分”的单独文件。

例子:


!include "LibraryFunction1.nsh"
!include "LibraryFunction2.nsh"
!include "LibraryFunction3.nsh"

; Basic Defines and MUI code Go HERE

; Output file information
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "File-${BUILD_VER_ABRV}-${BUILD_VER_MIN}.exe"
InstallDir "$PROGRAMFILES\Location\"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""

; now include file sections
!include "FileSectionDefinition1.nsh"
!include "FileSectionDefinition2.nsh"
!include "FileSectionDefinition3.nsh"
!include "Uninstall.nsh"

I use a "main" nsi file that makes up the actual installer generation and MUI code, but it includes "extra" function definitions from nsi files as well as seperate files for each installer "section".

Example:


!include "LibraryFunction1.nsh"
!include "LibraryFunction2.nsh"
!include "LibraryFunction3.nsh"

; Basic Defines and MUI code Go HERE

; Output file information
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "File-${BUILD_VER_ABRV}-${BUILD_VER_MIN}.exe"
InstallDir "$PROGRAMFILES\Location\"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""

; now include file sections
!include "FileSectionDefinition1.nsh"
!include "FileSectionDefinition2.nsh"
!include "FileSectionDefinition3.nsh"
!include "Uninstall.nsh"
浅浅淡淡 2024-07-28 05:05:06

!include "uninstaller.nsh" 等(包含文件通常具有 .nsh 扩展名)

!include "uninstaller.nsh" etc (include files normally have the .nsh extension)

原来分手还会想你 2024-07-28 05:05:06

您可以将一些代码分解为头文件 (.nsh),并将它们包含在您认为合适的脚本中。 例如,我的所有安装程序都具有相同的基本 MUI 页面、文本、图像以及先决条件(.NET 框架)。 所以我有一个包含文件,它使用所有 !defines 和 !insertmacro MUI_PAGE_x 设置 MUI。 然后另一个文件包含用于确定必要的先决条件是否到位的函数。

You can break out some code into header files (.nsh) and include them in your script as you see fit. For instance all of my installers have the same basic MUI pages, text, images, as well as prerequisites (.NET framework). So I have an include file that sets up the MUI with all the !defines and !insertmacro MUI_PAGE_x. Then another file contains the functions used to determine if the necessary prereqs are in place.

属性 2024-07-28 05:05:06

在某些情况下可能有效的一个模糊选项是生成 NSI。 我有点半走了那条路。

An obscure option that may work in some cases is to generate the NSI. I kind of half took that path.

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