Install Multiple msi files consecutively












1















I have just recently started using (and learning how to) script. I am using Powershell ISE and am trying to create a script that can be run on a new computer to install multiple/various programs. I have the programs in both .exe and .msi and want the programs to install silently, and consecutively. Again I am a beginner, but have put together the script below to get this done. I am trying to find out what variable/command will ensure that the programs install one by one.



msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'


I originally started this as a .bat file, and can run it to install the .exe files just fine, however they all run at the same time. Therefore, I figured creating a script (rather than a .bat file) would be my best bet. Any and all input and or help is greatly appreciated!










share|improve this question


















  • 3





    take a look at Get-Help Start-Process -Parameter wait for one way to do that. [grin]

    – Lee_Dailey
    Jan 2 at 15:35






  • 1





    A bat file is a script! You should be using doublequotes, not single quotes. If you open a Command Prompt window and enter Start /?, you can see the usage information for one possible thing to try; i.e. Start with its /Wait option.

    – Compo
    Jan 2 at 15:37


















1















I have just recently started using (and learning how to) script. I am using Powershell ISE and am trying to create a script that can be run on a new computer to install multiple/various programs. I have the programs in both .exe and .msi and want the programs to install silently, and consecutively. Again I am a beginner, but have put together the script below to get this done. I am trying to find out what variable/command will ensure that the programs install one by one.



msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'


I originally started this as a .bat file, and can run it to install the .exe files just fine, however they all run at the same time. Therefore, I figured creating a script (rather than a .bat file) would be my best bet. Any and all input and or help is greatly appreciated!










share|improve this question


















  • 3





    take a look at Get-Help Start-Process -Parameter wait for one way to do that. [grin]

    – Lee_Dailey
    Jan 2 at 15:35






  • 1





    A bat file is a script! You should be using doublequotes, not single quotes. If you open a Command Prompt window and enter Start /?, you can see the usage information for one possible thing to try; i.e. Start with its /Wait option.

    – Compo
    Jan 2 at 15:37
















1












1








1








I have just recently started using (and learning how to) script. I am using Powershell ISE and am trying to create a script that can be run on a new computer to install multiple/various programs. I have the programs in both .exe and .msi and want the programs to install silently, and consecutively. Again I am a beginner, but have put together the script below to get this done. I am trying to find out what variable/command will ensure that the programs install one by one.



msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'


I originally started this as a .bat file, and can run it to install the .exe files just fine, however they all run at the same time. Therefore, I figured creating a script (rather than a .bat file) would be my best bet. Any and all input and or help is greatly appreciated!










share|improve this question














I have just recently started using (and learning how to) script. I am using Powershell ISE and am trying to create a script that can be run on a new computer to install multiple/various programs. I have the programs in both .exe and .msi and want the programs to install silently, and consecutively. Again I am a beginner, but have put together the script below to get this done. I am trying to find out what variable/command will ensure that the programs install one by one.



msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'
msiexec.exe /q /i '\ServerFolderApplicationsmsi filesfile.msi'


I originally started this as a .bat file, and can run it to install the .exe files just fine, however they all run at the same time. Therefore, I figured creating a script (rather than a .bat file) would be my best bet. Any and all input and or help is greatly appreciated!







powershell batch-file install






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 2 at 15:28









Leesa MooreLeesa Moore

83




83








  • 3





    take a look at Get-Help Start-Process -Parameter wait for one way to do that. [grin]

    – Lee_Dailey
    Jan 2 at 15:35






  • 1





    A bat file is a script! You should be using doublequotes, not single quotes. If you open a Command Prompt window and enter Start /?, you can see the usage information for one possible thing to try; i.e. Start with its /Wait option.

    – Compo
    Jan 2 at 15:37
















  • 3





    take a look at Get-Help Start-Process -Parameter wait for one way to do that. [grin]

    – Lee_Dailey
    Jan 2 at 15:35






  • 1





    A bat file is a script! You should be using doublequotes, not single quotes. If you open a Command Prompt window and enter Start /?, you can see the usage information for one possible thing to try; i.e. Start with its /Wait option.

    – Compo
    Jan 2 at 15:37










3




3





take a look at Get-Help Start-Process -Parameter wait for one way to do that. [grin]

– Lee_Dailey
Jan 2 at 15:35





take a look at Get-Help Start-Process -Parameter wait for one way to do that. [grin]

– Lee_Dailey
Jan 2 at 15:35




1




1





A bat file is a script! You should be using doublequotes, not single quotes. If you open a Command Prompt window and enter Start /?, you can see the usage information for one possible thing to try; i.e. Start with its /Wait option.

– Compo
Jan 2 at 15:37







A bat file is a script! You should be using doublequotes, not single quotes. If you open a Command Prompt window and enter Start /?, you can see the usage information for one possible thing to try; i.e. Start with its /Wait option.

– Compo
Jan 2 at 15:37














2 Answers
2






active

oldest

votes


















0














You cannot run multiple .msi files all at once if that's what you're wanting. If you want to run them consecutively it would look like this in Powershell:



If it's an msi:



Start-Process msiexec.exe -Wait -ArgumentList '/I ProgramName.msi /quiet'


If it's an exe:



 Start-Process programname.exe -Wait -ArgumentList '/I /quiet'


And basically the -Wait parameter will wait until the windows installer closes until it proceeds to the next line of code. Some msi's do have different ways of classifying args depending on the developer. Sometimes it's /q, /qn or /quiet.






share|improve this answer































    0














    Windows Installer: the msiexec.exe engine should wait for your installation to complete before it exits. I suspect your command lines are wrong and that is why it looks like they all run and exit simultaneously.



    Sample Command Line: Maybe try this command line (maybe put in MyTest.cmd and run):



    msiexec.exe /i MySetup.msi /L*V C:MyLog.log /qn ADDLOCAL=ALL REBOOT=ReallySuppress ALLUSERS=1


    Repeat command line for each MSI you need to install.



    Logging:The log files should have unique names, obviously. You can enable logging for all MSI installations (section 'Globally for all setups on a machine'). Then you will find a new MSI-log file with a random name in the system's %TEMP% folder after each MSI operation. Sort by change date to find the latest one. To find errors in MSI logs, try searching for "value 3".



    More information available on request. Please do NOT add your own answer, edit your original question instead. Just add more info, delete or whatever you need. We have versioning so we can find what you delete as well if need be.






    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%2f54008974%2finstall-multiple-msi-files-consecutively%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      You cannot run multiple .msi files all at once if that's what you're wanting. If you want to run them consecutively it would look like this in Powershell:



      If it's an msi:



      Start-Process msiexec.exe -Wait -ArgumentList '/I ProgramName.msi /quiet'


      If it's an exe:



       Start-Process programname.exe -Wait -ArgumentList '/I /quiet'


      And basically the -Wait parameter will wait until the windows installer closes until it proceeds to the next line of code. Some msi's do have different ways of classifying args depending on the developer. Sometimes it's /q, /qn or /quiet.






      share|improve this answer




























        0














        You cannot run multiple .msi files all at once if that's what you're wanting. If you want to run them consecutively it would look like this in Powershell:



        If it's an msi:



        Start-Process msiexec.exe -Wait -ArgumentList '/I ProgramName.msi /quiet'


        If it's an exe:



         Start-Process programname.exe -Wait -ArgumentList '/I /quiet'


        And basically the -Wait parameter will wait until the windows installer closes until it proceeds to the next line of code. Some msi's do have different ways of classifying args depending on the developer. Sometimes it's /q, /qn or /quiet.






        share|improve this answer


























          0












          0








          0







          You cannot run multiple .msi files all at once if that's what you're wanting. If you want to run them consecutively it would look like this in Powershell:



          If it's an msi:



          Start-Process msiexec.exe -Wait -ArgumentList '/I ProgramName.msi /quiet'


          If it's an exe:



           Start-Process programname.exe -Wait -ArgumentList '/I /quiet'


          And basically the -Wait parameter will wait until the windows installer closes until it proceeds to the next line of code. Some msi's do have different ways of classifying args depending on the developer. Sometimes it's /q, /qn or /quiet.






          share|improve this answer













          You cannot run multiple .msi files all at once if that's what you're wanting. If you want to run them consecutively it would look like this in Powershell:



          If it's an msi:



          Start-Process msiexec.exe -Wait -ArgumentList '/I ProgramName.msi /quiet'


          If it's an exe:



           Start-Process programname.exe -Wait -ArgumentList '/I /quiet'


          And basically the -Wait parameter will wait until the windows installer closes until it proceeds to the next line of code. Some msi's do have different ways of classifying args depending on the developer. Sometimes it's /q, /qn or /quiet.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 2 at 22:59









          rad_rad_

          445




          445

























              0














              Windows Installer: the msiexec.exe engine should wait for your installation to complete before it exits. I suspect your command lines are wrong and that is why it looks like they all run and exit simultaneously.



              Sample Command Line: Maybe try this command line (maybe put in MyTest.cmd and run):



              msiexec.exe /i MySetup.msi /L*V C:MyLog.log /qn ADDLOCAL=ALL REBOOT=ReallySuppress ALLUSERS=1


              Repeat command line for each MSI you need to install.



              Logging:The log files should have unique names, obviously. You can enable logging for all MSI installations (section 'Globally for all setups on a machine'). Then you will find a new MSI-log file with a random name in the system's %TEMP% folder after each MSI operation. Sort by change date to find the latest one. To find errors in MSI logs, try searching for "value 3".



              More information available on request. Please do NOT add your own answer, edit your original question instead. Just add more info, delete or whatever you need. We have versioning so we can find what you delete as well if need be.






              share|improve this answer






























                0














                Windows Installer: the msiexec.exe engine should wait for your installation to complete before it exits. I suspect your command lines are wrong and that is why it looks like they all run and exit simultaneously.



                Sample Command Line: Maybe try this command line (maybe put in MyTest.cmd and run):



                msiexec.exe /i MySetup.msi /L*V C:MyLog.log /qn ADDLOCAL=ALL REBOOT=ReallySuppress ALLUSERS=1


                Repeat command line for each MSI you need to install.



                Logging:The log files should have unique names, obviously. You can enable logging for all MSI installations (section 'Globally for all setups on a machine'). Then you will find a new MSI-log file with a random name in the system's %TEMP% folder after each MSI operation. Sort by change date to find the latest one. To find errors in MSI logs, try searching for "value 3".



                More information available on request. Please do NOT add your own answer, edit your original question instead. Just add more info, delete or whatever you need. We have versioning so we can find what you delete as well if need be.






                share|improve this answer




























                  0












                  0








                  0







                  Windows Installer: the msiexec.exe engine should wait for your installation to complete before it exits. I suspect your command lines are wrong and that is why it looks like they all run and exit simultaneously.



                  Sample Command Line: Maybe try this command line (maybe put in MyTest.cmd and run):



                  msiexec.exe /i MySetup.msi /L*V C:MyLog.log /qn ADDLOCAL=ALL REBOOT=ReallySuppress ALLUSERS=1


                  Repeat command line for each MSI you need to install.



                  Logging:The log files should have unique names, obviously. You can enable logging for all MSI installations (section 'Globally for all setups on a machine'). Then you will find a new MSI-log file with a random name in the system's %TEMP% folder after each MSI operation. Sort by change date to find the latest one. To find errors in MSI logs, try searching for "value 3".



                  More information available on request. Please do NOT add your own answer, edit your original question instead. Just add more info, delete or whatever you need. We have versioning so we can find what you delete as well if need be.






                  share|improve this answer















                  Windows Installer: the msiexec.exe engine should wait for your installation to complete before it exits. I suspect your command lines are wrong and that is why it looks like they all run and exit simultaneously.



                  Sample Command Line: Maybe try this command line (maybe put in MyTest.cmd and run):



                  msiexec.exe /i MySetup.msi /L*V C:MyLog.log /qn ADDLOCAL=ALL REBOOT=ReallySuppress ALLUSERS=1


                  Repeat command line for each MSI you need to install.



                  Logging:The log files should have unique names, obviously. You can enable logging for all MSI installations (section 'Globally for all setups on a machine'). Then you will find a new MSI-log file with a random name in the system's %TEMP% folder after each MSI operation. Sort by change date to find the latest one. To find errors in MSI logs, try searching for "value 3".



                  More information available on request. Please do NOT add your own answer, edit your original question instead. Just add more info, delete or whatever you need. We have versioning so we can find what you delete as well if need be.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jan 3 at 2:22

























                  answered Jan 3 at 2:15









                  Stein ÅsmulStein Åsmul

                  22.6k1458123




                  22.6k1458123






























                      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%2f54008974%2finstall-multiple-msi-files-consecutively%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

                      MongoDB - Not Authorized To Execute Command

                      in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

                      Npm cannot find a required file even through it is in the searched directory