7

What parameters are ok to pass to the create archive wizard , in the 7-zip GUI, when you are creating a self extracting archive? The 7-Zip GUI has a field that allows you to type in multiple parameters.

screenshot

I tried an obvious parameter (shown below) but it fails for an unknown reason:

-oC:\
5
  • 1
    > What parameters are ok to pass to 7-zip .exe file creation while using the GUI Whatever parameters you need (if any). Check 7-zip.chm under Command Line Version->Switches for details.
    – Synetech
    Feb 23, 2012 at 21:32
  • Wait, are you asking what parameters to use in the GUI or what specifically parameters are required to create a self-extracting archive with the command-line version?
    – Synetech
    Feb 23, 2012 at 22:08
  • I am asking about the "parameter format" of the GUI. I have no problems with command line parameters. If anyone can explain why "-oC:\" will not work, that would be just as good of an answer to me.
    – djangofan
    Feb 24, 2012 at 17:35
  • 1
    There is no format, you just add your parameters like you would at the command-line. Is it specifically -o that you are trying to use? I believe that it won’t work because the output directory is derived from the Archive field, not the Parameters field. In fact, the GUI already exposes most of the parameters you are likely to use, so very few are used from the Parameters field.
    – Synetech
    Feb 24, 2012 at 17:39
  • @Synetech - ok, then can you give a working example of why (and how) someone would use that field in the GUI?
    – djangofan
    Mar 27, 2012 at 18:46

5 Answers 5

5

From what I can gather from your comments, it sounds like you are asking something else. It sounds like you are asking

  1. What is the purpose of the Parameters field of the 7-zip dialog?
  2. Why does it not work when you use the -o argument in that field?

If so, then the answers are simple (and related):

  1. The Parameters field is for specifying any options you need that are not available via dedicated dialog controls.

  2. The -o argument is ignored in the Parameters field because there is already a dedicated dialog control for the destination. The controls override corresponding options in the Parameters field.

Think about it this way, if you want to specify arguments in the Parameters field that already have dialog controls, then why use the GUI at all, why not just use the command-line in the first place? The dialog controls provide most options that are used and also reduce the possibility of error by specifying valid options. For example, the word-size options are already listed in the drop-down, so you cannot choose an invalid size like you can when specifying it in the Parameters field or command-line.


Some examples of usage of the Parameters field include:

  • One such argument is exclusion (-x switch). If you want to specify filenames to be excluded, there is no option to do so in the dialog, and so you would have to enter them in the Parameters field.

  • You would also use it to specify the -y switch to automatically say yes to everything instead of prompting you.

  • You can even use it to override some of the options that the dialog automatically sets such as subdirectory recursion. When you use the dialog, it automatically sets recursion. If you don’t want that, you would need to specify -r- in the Parameters field.

For a full list, you can look at the list of command-line arguments (7z /?) and compare it to the controls in the dialog.

3
  • @hit-and-run-downvoter, what’s your problem‽ No, literally; what is your issue with the answer? You clicked down, so obviously you have a problem with it, but without leaving a comment to explain what your problem is, nobody can address your problem. Of course if you clicked down without having a problem, then I guess that’s a completely different kind of problem you have…
    – Synetech
    May 11, 2013 at 17:54
  • No idea why this was downvoted, its the most useful answer here Aug 9, 2013 at 22:01
  • @CountMurphy, thanks for the support, unfortunately anonymous voting means no accountability and thus down-voting out of spite. :-/
    – Synetech
    Aug 10, 2013 at 0:26
4

Unfortunately the only parameters accepted at this time for the GUI "Add to Archive" dialog appear to be only for specifying compression method. There appears to be confusion about this and hopefully the developers will add more parameters to this GUI in future versions.

This is what documentation states is supported parameters:

Parameters
Allows you to specify parameters for compression. See the -m (Method) switch description for more details. Omit the -m prefix (as in -m switch) when using this dialog box.

Examples

  0=PPMd uses PPMd method for compressing files.

  0=bcj2 1=lzma:d23 2=lzma 3=lzma b0:1 b0s1:2 b0s2:3 uses BCJ2 filter (for x86 executables) and LZMA.

As for SFX creation it appears that there is no optional parameters to supply for the GUI.

Alternatively, The supplied documentation for command line -sfx may be of some use to you. Also, see http://7zsfx.info/en/ for examples and more than what documentation holds for sfx creation.

1
  • I am tempted to give you the credit for the answer. Still thinking about it.
    – djangofan
    Apr 19, 2012 at 16:56
0

7-Zip doesn’t use the -o switch for the output file path of self-extracting archives, it uses the -sfx switch.

For a regular archive you use:

-o c:\foobar.7z

But for a self-extracting archive you use:

-sfx c:\foobar.exe
3
  • See the screenshot I added.
    – iglvzx
    Feb 23, 2012 at 22:33
  • The screenshot doesn’t help; I already know about the parameter text box.
    – Synetech
    Feb 23, 2012 at 22:41
  • Alrighty then. :)
    – iglvzx
    Feb 23, 2012 at 22:47
0

All GUI and Command Line parameters are in each 7-zip installed dir's 7-zip.chm file.

page: https://sourceforge.net/p/openbor/tools/3021/tree/tools/7-Zip/7-zip.chm

download: https://sourceforge.net/p/openbor/tools/3021/tree/tools/7-Zip/7-zip.chm?format=raw

e.g. Using 7-zip GUI to compress files to a zip file. If you want to set the file name and subdir path encoding to UTF-8, you can fill param cu to do it. The cu param is locate in 7-zip.chm --> Command Line Version --> Switches --> -m --> cu=[off | on] off 7-Zip uses UTF-8 for file names that contain non-ASCII symbols.

0
+50

2019 update

In answer to the bounty : Nothing has changed.

From the help of the 7-Zip File Manager, quoted:

Parameters

Allows you to specify parameters for compression. See the -m (Method) switch description for more details. Omit the -m prefix (as in -m switch) when using this dialog box.

Examples

f=delta:4

uses Delta:4 filter (if you want to compress WAV files).

f=bcj2

uses BCJ2 filter (for x86 executables).

There are minor syntactical changes from the answer by Sn3akyP3t3, but in essence nothing has changed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .