Skip to content
⌘ NSIS Forum Archive

Issue with variables

4 posts

Mircea M#

Issue with variables

Hi, I have the following function 2 functions:

Function instVid
${If} $video = "0"
MessageBox MB_OK "$source"
Call instVideo
${EndIf}
FunctionEnd
and

Function instVideo
MessageBox MB_OK "$source"
FunctionEnd
The functions are in 2 separate NSI files:
  • instVid is in Setup.nsi where I have an
    !include Video.nsi
  • instVideo is in Video.nsi where only this function is declared.


The variable $source is declared globally, in Setup.nsi and it's value is set in another function, also in Setup.nsi.

My problem is that the MessageBox in instVid shows "C:\install" but the one in instVideo "$source" (when it should show the same thing as before).

What am I missing here? Please help!

Thank you!
Mircea M#
Nope, no warnings about this. Just that some functions (that I commented out) are not used and code is being zeroed...
Mircea M#
Anders, you were right, somewhat 🙂. In my original script I did not get any errors. Then I stripped down the whole code to exactly the bare minimum and I did get the error. The problem was that I did the !include video.nsi before declaring the variables. Moved the variables at the beginning of the script, before the !include, and it works!