Menu

Bug report: 7zSD.sfx and passing parameters

Help
Anonymous
2011-11-01
2014-02-12
  • Anonymous

    Anonymous - 2011-11-01

    It looks like there's a bug that causes parameters passed to a self-extracting archive to be duplicated. I created a .exe following the instructions in 7zip_extra\Installer\readme.txt and I can see that if, for example, I add "/l installer.log" on the command line to enable logging of the MSI installation, msiexec gets run with:

    (note: '/i mymsi.msi' comes from ExecuteParameters in the config file)

    /i mymsi.msi /l installer.log/l installer.log

    I've tried both using the msi filename in ExecuteFile, or putting msiexec.exe in ExecuteFile and "/i mymsi.msi" in ExecuteParameters.

    Looking through the code, I also noticed that on line 239 and 240 of SfxSetup.c you add 2 to the length. Since each WCHAR is already 2 bytes don't you just need to add 1?

     
  • Igor Pavlov

    Igor Pavlov - 2011-11-02

    1) 7zSD.sfx doesn't use SfxSetup.c
    2) Describe all steps to reproduce that bad case with msi.

     
  • Anonymous

    Anonymous - 2011-11-02

    To replicate the problem, do the following:

    1. Create a configuration file "config.txt" with the following contents:

    ;!@Install@!UTF-8!
    Title="My Installer"
    ExecuteFile="msiexec.exe"
    ExecuteParameters="/i mymsi.msi"
    ;!@InstallEnd@!

    2. Run:

    7zip_extra\7zr.exe a -bd -ssc -t7z mymsi.7z mymsi.msi
    copy /b 7zip_extra\7zSD.sfx +config.txt + mymsi.7z mymsi.exe

    Where can I find the source for 7zSD.sfx?

     
  • Anonymous

    Anonymous - 2011-11-02

    To then see the problem, run the resulting mymsi.exe file with:

    mymsi.exe /l log.txt

    If you use something like Process Hacker you'll see the command line repeated.

     
  • Igor Pavlov

    Igor Pavlov - 2011-11-03

    Thanks for Bug report!
    I'll fix that BUG in next version.

    The patch:

    CPP\7zip\Bundles\SFXSetup\Main.cpp

        #ifdef _SHELL_EXECUTE
        executeFile = GetTextConfigValue(pairs, L"ExecuteFile");
        executeParameters = GetTextConfigValue(pairs, L"ExecuteParameters");
        #endif

        execInfo.lpFile = filePath;

        if (!switches.IsEmpty())
        {
          if (!executeParameters.IsEmpty())
            executeParameters += L' ';
          executeParameters += switches;
        }

     
  • Anonymous

    Anonymous - 2011-11-03

    Thanks, that fixed it!

     
  • bdimych

    bdimych - 2014-02-12

    Hi!
    Since the current stable 9.20 (2010-11-18) the newest extra package is only 2011-04-18 http://sourceforge.net/projects/sevenzip/files/7-Zip/9.22/7z922_extra.7z/download
    Is there more newer fixed 7zS.sfx?

     
    • mirh

      mirh - 2017-04-06

      Moved to LZMA SDK.

       

Log in to post a comment.