セクション内で何度もマクロを呼び出しています。マクロは、ディレクトリが存在するかどうかをチェックし、存在しない場合はそのディレクトリを作成します。
私の問題:セクション内からこのマクロを複数回呼び出しているため、エラーが発生します。コンパイル エラーを修正するにはどうすればよいですか?
エラー:「エラー: ラベル "CreateDirThenInstall:" セクションで既に宣言されています」
このマクロを 1 つのセクションで複数回使用する方法を教えてください。
Section "Install Plugin Files" MainSetup
!insertmacro ValidateDir "c:/blah"
setOutPath "c:/blah"
file "C:/blah/a.txt"
file "C:/blah/b.txt"
!insertmacro ValidateDir "c:/other"
setOutPath "c:/other"
file "c:/other/a.txt"
file "c:/other/b.txt"
sectionend
!macro ValidateDir dir
IfFileExists "$dir" ExitMacro CreateDirThenInstall
CreateDirThenInstall: # Error here: Error: label "CreateDirThenInstall:" already declared in section
createDirectory "${dir}"
ExitMacro:
!macroend