简体   繁体   中英

insertmacro is getting called twice

Hi I have below code in place

file: setup.nsi

Function .onInit
    Call functionXXX
FunctionEnd

File: Utils.nsh

!define someFunc "!insertmacro someFunc"
!macro someFunc source destination
    MessageBox "${source}, ${destination}"
!macroend 


Function functionXXX
    ${someFunc} "C:\MyApp\test.txt" "C:\MyApp\backup\test.txt"
FunctionEnd

If I run the script, macro being called twice, I am seeing the message box twice with same values. Why is this happening.

There is no way this code as posted here will MessageBox twice.

There has to be some other code calling it, try:

Function .onInit
    Messagebox mb_ok before
    Call functionXXX
    Messagebox mb_ok after
FunctionEnd

You should also be able to see all the steps in the compiler output...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM