Announcement

Collapse
No announcement yet.

Is there a limit to msiexec command line length in custom bootstrapper?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there a limit to msiexec command line length in custom bootstrapper?

    I have my own bootstrapper that calls MSI.RunMsiexec(). It seems like if the command line gets really long, I get a 1639 MSI setup return code (invalid command line)

    Code:
    [12/06/2019 11:19:08] Notice    Launch MSI setup.
    [12/06/2019 11:19:08] Notice    Command line: /norestart /qb -i "C:\Users\sen.SEN-VMWARE\AppData\Roaming\Downloaded Installations\{BCE4798C-5B13-46BE-9F90-BC67259FB635}\{B5209E18-D57B-4D1C-9A9D-38A92315C0D6}.msi" REINSTALL=ALL REINSTALLMODE=vomus MSIENFORCEUPGRADECOMPONENTRULES=1 PROP_HOST="zeus" PROP_PORT=22 PROP_USERNAME="ppro" PROP_UPLOAD_USERNAME="upload_ppro" PROP_TERM_WIDTH="81" PROP_TERM_HEIGHT="27" PROP_PRIVATEKEY="C:\ProgramData\ProducePro\PProClient\ppro-key.ppk" PROP_UPLOAD_PK="C:\Test\another\long\test.ppk" /l*v "C:\Users\sen.SEN-VMWARE\Documents\PProClientMSI.LOG"
    [12/06/2019 11:19:11] Notice    MSI setup return code: 1639
    If I shorten my PROP_UPLOAD_PK argument just slightly, the command runs fine:

    Code:
    [12/06/2019 10:57:53] Notice    Launch MSI setup.
    [12/06/2019 10:57:53] Notice    Command line: /norestart /qb -i "C:\Users\sen.SEN-VMWARE\AppData\Roaming\Downloaded Installations\{BCE4798C-5B13-46BE-9F90-BC67259FB635}\{AE128CC8-CE73-40B1-B4F0-7804AE8E934A}.msi" REINSTALL=ALL REINSTALLMODE=vomus MSIENFORCEUPGRADECOMPONENTRULES=1 PROP_HOST="zeus" PROP_PORT=22 PROP_USERNAME="ppro" PROP_UPLOAD_USERNAME="upload_ppro" PROP_TERM_WIDTH="81" PROP_TERM_HEIGHT="27" PROP_PRIVATEKEY="C:\ProgramData\ProducePro\PProClient\ppro-key.ppk" PROP_UPLOAD_PK="C:\Test\test.ppk" /l*v "C:\Users\sen.SEN-VMWARE\Documents\PProClientMSI.LOG"
    [12/06/2019 10:57:56] Notice    MSI setup return code: 0
    Also if I take the command that failed with 1639 and manually run it from a command prompt with msiexec, the installer runs successfully. It appears that I'm hitting a limitation with the command line length, but only from within the bootstrapper. Could this be true? Thanks.

  • #2
    It definitely seems like there is a bug if the command line string passed to MSI.RunMsiexec() is greater than 400 something characters in length (not sure on the exact length that breaks it).
    With a large string, this works:

    Code:
    local nReturnCode = Shell.Execute("msiexec.exe", "open", strCommandLine, "", SW_HIDE, true);
    While this does not:

    Code:
    local nReturnCode = MSI.RunMsiexec(strCommandLine);
    Ulrich, is this something you can look into? Is there anything wrong with using Shell.Execute as a work-around for now?

    Comment


    • #3
      Hello, sorry for the late reply. No, there is nothing wrong in using Shell.Execute() or File.Run() to start msiexec.exe with the same arguments. I do not have access to the source code, so I cannot answer if there is a limit for the length of the argument to MSI.RunMsiexec(), but based on your findings, I agree that it certainly looks as there is one.

      Update: I asked the team for a confirmation, and it appears that they used MAX_PATH for the buffer size for the argument. I suggest that you stick with the Shell.Execute() or File.Run() approach.

      Ulrich
      Last edited by Ulrich; 12-23-2019, 05:17 AM.

      Comment


      • #4
        OK, thank you Ulrich

        Comment

        Working...
        X