Skip to content
⌘ NSIS Forum Archive

NSIS Help - what's the meaning of this?

5 posts

Comperio#

NSIS Help - what's the meaning of this?

I was browsing the NSIS help files looking for information about installer (and uninstaller) error levels.

I found this example of how to get the error level of an uninstaller by simulating the TEMP file copy like so:


CopyFiles $INSTDIR\uninstaller.exe $TEMP
ExecWait '"$TEMP\uninstaller.exe" _?=$INSTDIR' $0
DetailPrint "uninstaller set error level $0"
What I don't understand is the purpose for the "_?=$INSTDIR" in the command line (shown in red above). I've searched the manual and the forums but haven't found anything on this. Can someone please elaborate? 😕
Comperio#
That's exactly what the help files say. I know why the command should be used, but what I'm trying to understand is how it works.

In other words, why add the extra _?=$INSTDIR to the end of the command? What does this do?
Afrow UK#
Passes the $INSTDIR to the uninstaller. Without it the uninstaller will set $INSTDIR to $EXEDIR which may be no good if the uninstaller is not in the install folder.
It also allows the uninstaller executer (e.g. a NSIS installer with ExecWait) to wait for the uninstaller to finish.

When using _?=, everything after it will become $INSTDIR therefore it must always be the last parameter used.

-Stu
Comperio#
Thanks for the info, Afrow.

Is this command-line parameter listed in help files? (If not, it should be.)