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

  • Home
  • SEARCH
  • 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 8119569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:50:08+00:00 2026-06-06T04:50:08+00:00

I have an NSIS installer that has the start menu folders hard-coded using this

  • 0

I have an NSIS installer that has the start menu folders hard-coded using this code…

Var SMDir ;Start menu folder
!insertmacro MUI_PAGE_STARTMENU 0 $SMDir

Section -StartMenu
  !insertmacro MUI_STARTMENU_WRITE_BEGIN 0
  CreateDirectory "$SMPrograms\MY Program\My Folder"
  CreateShortCut "$DESKTOP\My Program" "$INSTDIR\start.exe"
  CreateShortCut "$SMPROGRAMS\MY Program\My Shortcut.lnk" "$INSTDIR\start.exe"
  CreateShortCut "$SMPROGRAMS\My Program\Uninstall.lnk" "$INSTDIR\uninstall.exe"

This all works apart from on the ‘Choose Start Menu Folder’ it doesn’t let me change the default installation directory.

Is there a way to fix this or alternatively how can I skip this page but still trigger the StartMenu section?

  • 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-06T04:50:10+00:00Added an answer on June 6, 2026 at 4:50 am

    If you don’t want a startmenu selection page at all just remove !insertmacro MUI_PAGE_STARTMENU ... and the two !insertmacro MUI_STARTMENU_* macros in the -StartMenu section.

    If you want to allow the user to choose the directory then you must use the variable and not hardcode the path:

    outfile test.exe
    name "SM Test"
    requestexecutionlevel user ;Single user/"Just me" installer
    
    !define MUI_COMPONENTSPAGE_NODESC
    !include mui2.nsh
    
    Var SMDir ;Start menu folder
    !insertmacro MUI_PAGE_COMPONENTS
    ;!define MUI_STARTMENUPAGE_DEFAULTFOLDER "MY Program" ;Default, name is used if not defined
    !insertmacro MUI_PAGE_STARTMENU 0 $SMDir
    !insertmacro MUI_PAGE_INSTFILES
    !insertmacro MUI_LANGUAGE English
    
    
    Section -StartMenu
    !insertmacro MUI_STARTMENU_WRITE_BEGIN 0 ;This macro sets $SMDir and skips to MUI_STARTMENU_WRITE_END if the "Don't create shortcuts" checkbox is checked... 
    CreateDirectory "$SMPrograms\$SMDir"
    CreateShortCut "$SMPROGRAMS\$SMDir\Myapp.lnk" "$INSTDIR\start.exe"
    !insertmacro MUI_STARTMENU_WRITE_END
    SectionEnd
    
    Section "Desktop Shortcut"
    CreateShortCut "$DESKTOP\Myapp.lnk" "$INSTDIR\start.exe"
    SectionEnd
    

    (If you are installing as administrator then you should call SetShellVarContext all before accessing $SMPrograms and you should probably not create a desktop shortcut)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a NSIS installer that at a point has to check if java
I have an NSIS installer script that I'm using to deploy a py2exe-built app
I have a NSIS installer that we previously built using nAnt scripts that copy
I have an NSIS based installer that I need to be able generate slightly
I have created a mini installer in NSIS that installs patches for my application.
I have a rather large project whose Installer is written using NSIS. My problem
We have a product that we need to create an installer for. It has
I have a batch file that I need to run within my NSIS installer.
I have a NSIS installer that installs my non-Metro application on Windows 8. After
Can a NSIS Function have more than one parameter? Why wont this code compile?

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.