Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I capture the results of a YESNOCANCEL MessageBox without gotos/labels in NSIS installer scripting?
    primarykey
    data
    text
    <p>I would like to know how to use a YESNOCANCEL MessageBox in conjunction with IF logic from LogicLib.nsh in NSIS installer scripting to avoid having to use labels and gotos.</p> <p>Is there any way to capture the result of a MessageBox in a variable of some kind?</p> <p>Also, I know there are better things than NSIS out there, but using something else isn't a possibility at this point. =(</p> <p>Note the <code>{WHAT GOES HERE??}</code> in the below code. If this was just an If...Else... it would work fine.</p> <p>Thanks for the help</p> <pre><code>${If} ${Cmd} `MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION "PROGRAM X is already installed. Click YES to remove the installed version found in C:\Program Files(x86). Click NO to skip uninstall and choose a different install location (not recommended) or CANCEL to terminate the installer." IDYES` MessageBox MB_OK "Yes was clicked" ${ElseIf} {WHAT GOES HERE??} MessageBox MB_OK "No was clicked" ${Else} MessageBox MB_OK "Cancel was clicked" ${EndIf} </code></pre> <p><strong>Update</strong>: I also found this example, but I am not sure what <code>${||}</code> does or how it might help me.</p> <pre><code> ; ifcmd..||..| and if/unless cmd StrCpy $R2 "" ${IfCmd} MessageBox MB_YESNO "Please click Yes" IDYES ${||} StrCpy $R2 $R2A ${|} ${Unless} ${Cmd} `MessageBox MB_YESNO|MB_DEFBUTTON2 "Please click No" IDYES` StrCpy $R2 $R2B ${EndUnless} ${If} $R2 == "AB" DetailPrint "PASSED IfCmd/If Cmd test" ${Else} DetailPrint "FAILED IfCmd/If Cmd test" ${EndIf} </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload