我当前正在使用以下代码添加指定路径中的所有文件
Section
SetOutPath $InstDir
!tempfile folders ; temporary .nsh
!system 'for /D %A in (.\ParentFolder\*) do @>>"${folders}" echo File /r "%~A\Same\Path\For\All\*.ext"'
!include "${folders}"
!delfile "${folders}"
SectionEnd
我该如何使每个文件都有一个复选框以允许选择单个文件?
您最初尝试使用
!system
是正确的,但您需要使用 FOR /R
(或批处理文件)并为每个文件生成 Section
:
!define FOLDERwithMYFILES "C:\stuff\myfiles"
!tempfile filesnsh
!system 'FOR /R "${FOLDERwithMYFILES}" %A in (*.*) do >>"${filesnsh}" echo Section "%~nA"&>>"${filesnsh}" File "%~A"&>>"${filesnsh}" echo SectionEnd'
!include "${filesnsh}"
!delfile "${filesnsh}"
Page Components
Page InstFiles