Hi, I'm stuck on this. I have this callback function at the bottom of a subscript (.nsh) file. (As you can see I'm using LogicLib):
Function InstallFoo
MessageBox MB_OK "Within InstallFoo function"
${If} ${FileExists} "$EXEDIR\Modules\foo.zip"
MessageBox MB_OK "foo.zip found, do install it!"
nsisunz::Unzip "$EXEDIR\Modules\foo.zip" "$INSTDIR\Foo"
${Else}
MessageBox MB_OK "No foo.zip found. Do nothing"
${EndIf}
MessageBox MB_OK "End reached"
FunctionEnd
Everything works exactly as I want it to when the 'foo.zip' is present, but when it isn't, the installer crashes, and I really can't understand why.
I would expect it to also be able to handle when the 'foo.zip' is not found, that is by doing nothing. What happens now is that the installer crashes with "setup.exe - Application Error, The instruction at "some-address" referenced memory at "some-other-address". The memory could not be "read".
I have the same type of code within sections in my scripts and it works fine there, whether zip-files present or not. It's just in this callback function it doesn't work, so I'm starting to think it has something to do with it being a callback function.
In the 'foo.zip file not present' - case I get the following MessageBoxes: "Within InstallFoo function" "No foo.zip found. Do nothing" "End reached"
And then the crash. I have a MessageBox printout within the section where the callback was called from also, that is, the first thing to happen after the return from the callback function, but it never gets there. Note, as soon as the foo.zip is there everything works just fine!
Does anyone have any idea of what I might be doing wrong here?