Problems with runProgram under InstallBuilder 16

Answered

Comments

3 comments

  • Avatar
    wojciechka

    InstalLBuilder always requires entire arguments to be quoted - so INSTALLDIR="${installdir.dos}\foo\installation" and INSTALLDIR="${INSTALLDIR}\jdk\${javaVersion}" may cause issues.

    Could you try changing your runProgram actions to the following and try if it resolves the issue?

    <runProgram> <program>msiexec</program> <programArguments>/passive /norestart /i "my msi file.msi" ADDLOCAL=Foo /lv "${installdir.dos}\foo\msi.log" "INSTALLDIR=${installdir.dos}\foo\installation"</programArguments> </runProgram> <runProgram> <program>${installdir}/jdk-8u73-windows-x64.exe</program> <programArguments>/s "INSTALLDIR=${INSTALLDIR}\jdk\${javaVersion}" /L "${INSTALLDIR}\jdk\log"</programArguments> </runProgram>

    0
    Comment actions Permalink
  • Avatar
    Dirk Stegemann

    We have a similar issue with <runProgram> action since moving from IB 15 to IB 16, although with IB itself (not with the generated installer).

    Our <runProgram> action is executed within the <postBuildActionList> build phase on the Windows build machine.

    Below is some very simplified code that still reproduces the issue:

    <postBuildActionList>
        <runProgram>
            <program>cmd</program>
            <programArguments>/c dir</programArguments>
    
            <ruleList>
                <platformTest type="windows" />
            </ruleList>
        </runProgram>
        <showInfo text="INFO: error code: '${program_exit_code}'; \
                   stderr: '${program_stderr}'; stdout: '${program_stdout}'" />
    </postBuildActionList>
    

    Output from IB 15 is:

     C:\test>build_win.bat
     [INFO] BITROCK_INSTALLER_TOOL_PATH: C:\Program Files (x86)\BitRock InstallBuilder for Qt 15.1.0\bin\builder-cli.exe
      Building TestApplication windows
      0% ______________ 50% ______________ 100%
      ##############################Info: INFO: error code: '0'; stderr: ''; stdout: ' Volume in drive C has no
     label.
      Volume Serial Number is 88A9-D7DB
    
      Directory of C:\test
    
     04/13/2016  05:00 PM    <DIR>          .
     04/13/2016  05:00 PM    <DIR>          ..
     04/13/2016  04:54 PM             1,333 build_win.bat
     04/13/2016  05:00 PM    <DIR>          components
     04/13/2016  05:00 PM    <DIR>          EULAs
     04/13/2016  05:00 PM    <DIR>          LocalizedStrings
     04/13/2016  05:04 PM    <DIR>          output
     04/13/2016  04:44 PM            18,498 project.xml
     04/13/2016  05:00 PM    <DIR>          signing
                    6 File(s)         34,295 bytes
                    7 Dir(s)  44,423,942,144 bytes free'
     Press [Enter] to continue:
     ###########
    

    Output from IB 16 is:

     C:\test>build_win.bat
     [INFO] BITROCK_INSTALLER_TOOL_PATH: C:\Program Files (x86)\BitRock InstallBuilder for Qt 16.3.0\bin\builder-cli.exe
      Building TestApplication windows
      0% ______________ 50% ______________ 100%
      ##############################
     Error: Unknown error while running cmd /c dir
     Error building project
    
    0
    Comment actions Permalink
  • Avatar
    ThomasH

    I'm providing an own answer, as this was the outcome of conversations with Bitrock's technical support:

    • The library for starting external programs has changed with IB 16, hence the differences to IB 15 behvior.
    • Support for MSIEXEC has been improved with IB 16.3.0 so that command-line arguments to msiexec now work (which I can confirm).
    • For other situations, wrapping external commands in a .bat/.com file on Windows is a reasonable workaround, esp. when those external programs demand that some command-line arguments must not be quoted at all (e.g. NSIS' /D option).
    • IB version > 16.1.0 has a convenience property for the <runProgram> action, <wrapInScript>1</wrapInScript>, which does this on the fly (which I find very useful).
    • The issue with the JDK installer was prob. a mistake on my side as I wasn't able to reproduce it after I posted the question. Both quoting schemes, "INSTALLDIR=..." and INSTALLDIR="...", seem to work fine with both IB 15 and IB 16.
    0
    Comment actions Permalink

Please sign in to leave a comment.