Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8870791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:49:30+00:00 2026-06-14T17:49:30+00:00

I have this NSIS script: Section !${SECTION_MAIN} sectionMainID SetOutPath $INSTDIR whileRuns: LockedList::FindProcess $INSTDIR\bin\${PRODUCT_NAME}.exe Pop

  • 0

I have this NSIS script:

Section "!${SECTION_MAIN}" sectionMainID
    SetOutPath "$INSTDIR"
    whileRuns:
                LockedList::FindProcess "$INSTDIR\bin\${PRODUCT_NAME}.exe"
                Pop $R0
                ${If} $R0 != ``
                      MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "this is running. Please close it first."  IDOK OK IDCANCEL CANCEL 
                      OK:
                         Goto whileMLRuns
                      CANCEL:
                         Abort
                ${EndIf}

I would like to change it to silent mode. In silent mode, i would like that automatically messagebox is ended with a CANCEL. so, according to doc, i put a /SD flag, with the command IDCANCEL in the end of line with MessageBox inside. Like that :

Section "!${SECTION_MAIN}" sectionMainID
    SetOutPath "$INSTDIR"
    whileRuns:
                LockedList::FindProcess "$INSTDIR\bin\${PRODUCT_NAME}.exe"
                Pop $R0
                ${If} $R0 != ``
                      MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "this is running. Please close it first."  IDOK OK IDCANCEL CANCEL /SD IDCANCEL
                      OK:
                         Goto whileMLRuns
                      CANCEL:
                         Abort
                ${EndIf}

However, this is failing. So, I changed it to

Section "!${SECTION_MAIN}" sectionMainID
    SetOutPath "$INSTDIR"
    whileRuns:
                LockedList::FindProcess "$INSTDIR\bin\${PRODUCT_NAME}.exe"
                Pop $R0
                ${If} $R0 != ``
                      MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "this is running. Please close it first."  IDOK OK IDCANCEL CANCEL /SD CANCEL
                      OK:
                         Goto whileMLRuns
                      CANCEL:
                         Abort
                ${EndIf}

with now CANCEL instead of IDCANCEL in the same line. This is because with this syntax it is branched with the same syntax as in user interaction mode. However, it seems not to be working either.

What is wrong with my flag, how can i fix that ? Should i use a syntax with a jump instead ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:49:32+00:00Added an answer on June 14, 2026 at 5:49 pm

    I think the parameter order does matter. Try to use IDCANCEL with following order:

    MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "a-message" /SD IDCANCEL IDOK OK IDCANCEL CANCEL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a NSIS script with a number of sections and a section group.
I have written nsis script for Java project.once i have clicked uninstaller.exe Start menu
I have an NSIS script that run external program, this program returns C++ type
Have some problems with NSIS uninstall code. RMDir /r $SMPROGRAMS\${PRODUCT_NAME} In Windows 7 this
I have created EXE file using NSIS script.I have created custom page using following
I have an NSIS installer that has the start menu folders hard-coded using this
I have a NSIS script that is working well for a large application. I
I'm working on an NSIS script in which I have two directory pages. One
I have an NSIS installer script that I'm using to deploy a py2exe-built app
I builded nsis script successfully for my java project. I have converted my java

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.