NSIS - Skip certain dialogs using command-line arguments?












0















Is there a way to make the NSIS installer skip certain dialogs?



It has these command-line arguments,



/S, /NCRC and /D=dir



Although /S and /NCRC can used for silent and unattended modes, is there are command-line arguments to make the installer skip certain dialogs in the installer and show the rest of the dialog? For example. skip the Welcome dialog and the next two dialogs and go to the fourth one.










share|improve this question



























    0















    Is there a way to make the NSIS installer skip certain dialogs?



    It has these command-line arguments,



    /S, /NCRC and /D=dir



    Although /S and /NCRC can used for silent and unattended modes, is there are command-line arguments to make the installer skip certain dialogs in the installer and show the rest of the dialog? For example. skip the Welcome dialog and the next two dialogs and go to the fourth one.










    share|improve this question

























      0












      0








      0








      Is there a way to make the NSIS installer skip certain dialogs?



      It has these command-line arguments,



      /S, /NCRC and /D=dir



      Although /S and /NCRC can used for silent and unattended modes, is there are command-line arguments to make the installer skip certain dialogs in the installer and show the rest of the dialog? For example. skip the Welcome dialog and the next two dialogs and go to the fourth one.










      share|improve this question














      Is there a way to make the NSIS installer skip certain dialogs?



      It has these command-line arguments,



      /S, /NCRC and /D=dir



      Although /S and /NCRC can used for silent and unattended modes, is there are command-line arguments to make the installer skip certain dialogs in the installer and show the rest of the dialog? For example. skip the Welcome dialog and the next two dialogs and go to the fourth one.







      dialog installer nsis silent-installer unattended-processing






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 24 '18 at 10:42









      Codename KCodename K

      150833




      150833
























          1 Answer
          1






          active

          oldest

          votes


















          1














          /S, /NCRC and /D= are the only installer parameters with built-in support, anything else you have to handle yourself.



          Pages can be skipped by calling Abort in the page pre callback. It is also possible to jump forward a specific number of pages. The GetOptions macro can be used to parse the command line.



          OutFile Test.exe
          RequestExecutionLevel user
          InstallDir $Temp

          !include LogicLib.nsh
          !include FileFunc.nsh

          Page License LicPre
          Page Components CmpPre
          Page Directory "" DiShow
          Page InstFiles

          Var SkippedL
          Var SkippedC

          !macro AbortIfCmdlineParam Switch Var
          ${GetParameters} $0
          ClearErrors
          ${GetOptions} $0 "${Switch}" $0
          ${IfNot} ${Errors}
          ${If} ${Var} = 0
          StrCpy ${Var} 1
          Abort
          ${EndIf}
          ${EndIf}
          !macroend

          Function LicPre
          !insertmacro AbortIfCmdlineParam "/SkipL" $SkippedL
          FunctionEnd

          Function CmpPre
          !insertmacro AbortIfCmdlineParam "/SkipC" $SkippedC
          FunctionEnd

          Function DiShow
          # Disable back button if both pages skipped, this is optional
          ${If} $SkippedL <> 0
          ${AndIf} $SkippedC <> 0
          GetDlgItem $0 $hwndparent 3
          EnableWindow $0 0
          ${EndIf}
          FunctionEnd

          Section
          SectionEnd


          Run as Test /SkipL /SkipC to skip both.



          Or:



          OutFile Test.exe
          RequestExecutionLevel user
          InstallDir $Temp

          !include LogicLib.nsh
          !include FileFunc.nsh

          Page License "" LicShow
          Page Components
          Page Directory
          Page InstFiles

          Function LicShow
          Var /Global HasSkipped
          ${GetParameters} $0
          ClearErrors
          ${GetOptions} $0 "/Skip=" $0
          ${IfNot} ${Errors}
          ${AndIf} $0 < 4 ; Don't let user skip InstFiles
          ${AndIf} $HasSkipped = 0
          StrCpy $HasSkipped 1
          SendMessage $HWNDPARENT 0x408 $0 ""
          ${EndIf}
          FunctionEnd


          Section
          SectionEnd


          ...and run as Test /Skip=2.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53457316%2fnsis-skip-certain-dialogs-using-command-line-arguments%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            /S, /NCRC and /D= are the only installer parameters with built-in support, anything else you have to handle yourself.



            Pages can be skipped by calling Abort in the page pre callback. It is also possible to jump forward a specific number of pages. The GetOptions macro can be used to parse the command line.



            OutFile Test.exe
            RequestExecutionLevel user
            InstallDir $Temp

            !include LogicLib.nsh
            !include FileFunc.nsh

            Page License LicPre
            Page Components CmpPre
            Page Directory "" DiShow
            Page InstFiles

            Var SkippedL
            Var SkippedC

            !macro AbortIfCmdlineParam Switch Var
            ${GetParameters} $0
            ClearErrors
            ${GetOptions} $0 "${Switch}" $0
            ${IfNot} ${Errors}
            ${If} ${Var} = 0
            StrCpy ${Var} 1
            Abort
            ${EndIf}
            ${EndIf}
            !macroend

            Function LicPre
            !insertmacro AbortIfCmdlineParam "/SkipL" $SkippedL
            FunctionEnd

            Function CmpPre
            !insertmacro AbortIfCmdlineParam "/SkipC" $SkippedC
            FunctionEnd

            Function DiShow
            # Disable back button if both pages skipped, this is optional
            ${If} $SkippedL <> 0
            ${AndIf} $SkippedC <> 0
            GetDlgItem $0 $hwndparent 3
            EnableWindow $0 0
            ${EndIf}
            FunctionEnd

            Section
            SectionEnd


            Run as Test /SkipL /SkipC to skip both.



            Or:



            OutFile Test.exe
            RequestExecutionLevel user
            InstallDir $Temp

            !include LogicLib.nsh
            !include FileFunc.nsh

            Page License "" LicShow
            Page Components
            Page Directory
            Page InstFiles

            Function LicShow
            Var /Global HasSkipped
            ${GetParameters} $0
            ClearErrors
            ${GetOptions} $0 "/Skip=" $0
            ${IfNot} ${Errors}
            ${AndIf} $0 < 4 ; Don't let user skip InstFiles
            ${AndIf} $HasSkipped = 0
            StrCpy $HasSkipped 1
            SendMessage $HWNDPARENT 0x408 $0 ""
            ${EndIf}
            FunctionEnd


            Section
            SectionEnd


            ...and run as Test /Skip=2.






            share|improve this answer




























              1














              /S, /NCRC and /D= are the only installer parameters with built-in support, anything else you have to handle yourself.



              Pages can be skipped by calling Abort in the page pre callback. It is also possible to jump forward a specific number of pages. The GetOptions macro can be used to parse the command line.



              OutFile Test.exe
              RequestExecutionLevel user
              InstallDir $Temp

              !include LogicLib.nsh
              !include FileFunc.nsh

              Page License LicPre
              Page Components CmpPre
              Page Directory "" DiShow
              Page InstFiles

              Var SkippedL
              Var SkippedC

              !macro AbortIfCmdlineParam Switch Var
              ${GetParameters} $0
              ClearErrors
              ${GetOptions} $0 "${Switch}" $0
              ${IfNot} ${Errors}
              ${If} ${Var} = 0
              StrCpy ${Var} 1
              Abort
              ${EndIf}
              ${EndIf}
              !macroend

              Function LicPre
              !insertmacro AbortIfCmdlineParam "/SkipL" $SkippedL
              FunctionEnd

              Function CmpPre
              !insertmacro AbortIfCmdlineParam "/SkipC" $SkippedC
              FunctionEnd

              Function DiShow
              # Disable back button if both pages skipped, this is optional
              ${If} $SkippedL <> 0
              ${AndIf} $SkippedC <> 0
              GetDlgItem $0 $hwndparent 3
              EnableWindow $0 0
              ${EndIf}
              FunctionEnd

              Section
              SectionEnd


              Run as Test /SkipL /SkipC to skip both.



              Or:



              OutFile Test.exe
              RequestExecutionLevel user
              InstallDir $Temp

              !include LogicLib.nsh
              !include FileFunc.nsh

              Page License "" LicShow
              Page Components
              Page Directory
              Page InstFiles

              Function LicShow
              Var /Global HasSkipped
              ${GetParameters} $0
              ClearErrors
              ${GetOptions} $0 "/Skip=" $0
              ${IfNot} ${Errors}
              ${AndIf} $0 < 4 ; Don't let user skip InstFiles
              ${AndIf} $HasSkipped = 0
              StrCpy $HasSkipped 1
              SendMessage $HWNDPARENT 0x408 $0 ""
              ${EndIf}
              FunctionEnd


              Section
              SectionEnd


              ...and run as Test /Skip=2.






              share|improve this answer


























                1












                1








                1







                /S, /NCRC and /D= are the only installer parameters with built-in support, anything else you have to handle yourself.



                Pages can be skipped by calling Abort in the page pre callback. It is also possible to jump forward a specific number of pages. The GetOptions macro can be used to parse the command line.



                OutFile Test.exe
                RequestExecutionLevel user
                InstallDir $Temp

                !include LogicLib.nsh
                !include FileFunc.nsh

                Page License LicPre
                Page Components CmpPre
                Page Directory "" DiShow
                Page InstFiles

                Var SkippedL
                Var SkippedC

                !macro AbortIfCmdlineParam Switch Var
                ${GetParameters} $0
                ClearErrors
                ${GetOptions} $0 "${Switch}" $0
                ${IfNot} ${Errors}
                ${If} ${Var} = 0
                StrCpy ${Var} 1
                Abort
                ${EndIf}
                ${EndIf}
                !macroend

                Function LicPre
                !insertmacro AbortIfCmdlineParam "/SkipL" $SkippedL
                FunctionEnd

                Function CmpPre
                !insertmacro AbortIfCmdlineParam "/SkipC" $SkippedC
                FunctionEnd

                Function DiShow
                # Disable back button if both pages skipped, this is optional
                ${If} $SkippedL <> 0
                ${AndIf} $SkippedC <> 0
                GetDlgItem $0 $hwndparent 3
                EnableWindow $0 0
                ${EndIf}
                FunctionEnd

                Section
                SectionEnd


                Run as Test /SkipL /SkipC to skip both.



                Or:



                OutFile Test.exe
                RequestExecutionLevel user
                InstallDir $Temp

                !include LogicLib.nsh
                !include FileFunc.nsh

                Page License "" LicShow
                Page Components
                Page Directory
                Page InstFiles

                Function LicShow
                Var /Global HasSkipped
                ${GetParameters} $0
                ClearErrors
                ${GetOptions} $0 "/Skip=" $0
                ${IfNot} ${Errors}
                ${AndIf} $0 < 4 ; Don't let user skip InstFiles
                ${AndIf} $HasSkipped = 0
                StrCpy $HasSkipped 1
                SendMessage $HWNDPARENT 0x408 $0 ""
                ${EndIf}
                FunctionEnd


                Section
                SectionEnd


                ...and run as Test /Skip=2.






                share|improve this answer













                /S, /NCRC and /D= are the only installer parameters with built-in support, anything else you have to handle yourself.



                Pages can be skipped by calling Abort in the page pre callback. It is also possible to jump forward a specific number of pages. The GetOptions macro can be used to parse the command line.



                OutFile Test.exe
                RequestExecutionLevel user
                InstallDir $Temp

                !include LogicLib.nsh
                !include FileFunc.nsh

                Page License LicPre
                Page Components CmpPre
                Page Directory "" DiShow
                Page InstFiles

                Var SkippedL
                Var SkippedC

                !macro AbortIfCmdlineParam Switch Var
                ${GetParameters} $0
                ClearErrors
                ${GetOptions} $0 "${Switch}" $0
                ${IfNot} ${Errors}
                ${If} ${Var} = 0
                StrCpy ${Var} 1
                Abort
                ${EndIf}
                ${EndIf}
                !macroend

                Function LicPre
                !insertmacro AbortIfCmdlineParam "/SkipL" $SkippedL
                FunctionEnd

                Function CmpPre
                !insertmacro AbortIfCmdlineParam "/SkipC" $SkippedC
                FunctionEnd

                Function DiShow
                # Disable back button if both pages skipped, this is optional
                ${If} $SkippedL <> 0
                ${AndIf} $SkippedC <> 0
                GetDlgItem $0 $hwndparent 3
                EnableWindow $0 0
                ${EndIf}
                FunctionEnd

                Section
                SectionEnd


                Run as Test /SkipL /SkipC to skip both.



                Or:



                OutFile Test.exe
                RequestExecutionLevel user
                InstallDir $Temp

                !include LogicLib.nsh
                !include FileFunc.nsh

                Page License "" LicShow
                Page Components
                Page Directory
                Page InstFiles

                Function LicShow
                Var /Global HasSkipped
                ${GetParameters} $0
                ClearErrors
                ${GetOptions} $0 "/Skip=" $0
                ${IfNot} ${Errors}
                ${AndIf} $0 < 4 ; Don't let user skip InstFiles
                ${AndIf} $HasSkipped = 0
                StrCpy $HasSkipped 1
                SendMessage $HWNDPARENT 0x408 $0 ""
                ${EndIf}
                FunctionEnd


                Section
                SectionEnd


                ...and run as Test /Skip=2.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 24 '18 at 16:34









                AndersAnders

                70.3k1075128




                70.3k1075128
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53457316%2fnsis-skip-certain-dialogs-using-command-line-arguments%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    404 Error Contact Form 7 ajax form submitting

                    How to know if a Active Directory user can login interactively

                    TypeError: fit_transform() missing 1 required positional argument: 'X'