简体   繁体   English

insertmacro被调用两次

[英]insertmacro is getting called twice

Hi I have below code in place 嗨,我有下面的代码

file: setup.nsi 文件:setup.nsi

Function .onInit
    Call functionXXX
FunctionEnd

File: Utils.nsh 档案: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. 此处张贴的此代码无法将MessageBox两次。

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... 您还应该能够看到编译器输出中的所有步骤...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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