0
我在一節中多次調用一個宏。宏檢查目錄是否存在,如果不存在,則創建該目錄。在一節中多次使用宏
我的問題:我得到一個錯誤,因爲我從段內部多次調用這個宏。我怎樣才能解決我的編譯錯誤?
錯誤:「錯誤:標籤‘CreateDirThenInstall:’已經在部分宣稱」
你能告訴我怎麼樣,我可以在一節一次使用這個宏不止?
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