Let User Add Subfolder to SFX Extract Folder

  • An earlier version of the program let me add a subfolder to the default Temp folder PA extracts an SFX file to. As it is PA dumps all the files into the top level Temporary folder and, in my opinion, makes a mess.

    Also, I have occasion to ask users of my product to find a particular file in the extracted set. It makes this much easier if they are all in a unique folder with a name of my choosing.

    If this feature exists please point me to it.

  • conexware

    did you try %temp%\name?

    (check for actual alias usage in help file, been while since i checked that out)… it should work fine!

  • @spwolf:

    did you try %temp%\name?

    That’s how the older version I was using worked. In the current version the extract location is chosen from a dropdown and you can only choose from fixed options. None of these three options has a subfolder.

    (check for actual alias usage in help file, been while since i checked that out)… it should work fine!

    My search of Help found no reference to the word alias and only one to the word actual and it was not on topic.

  • Another way to do this is to use the archive name as the subfolder name.

    I can see the possibility of conflicts this way but it most probably works.

  • conexware

    here is the help:

    conext sensitive help (press help in Make SFX window):

    “Default “UnZip To” folder” - This is the default folder in which the extracted files will be placed. If you select “Use TEMP directory”, the files will be extracted to the default Windows temporary directory. Click here for more info on advanced extract path options.

    and then click here leads you to this:

    Predefined extraction paths can be entered in either the Make SFX or SFX Wizard “Default UnZip To folder” field.

    Extraction Path Options

    Constant Description Typical or Example Path
    %temp% User’s temporary folder C:\WINDOWS\TEMP
    %temp-unique% A unique temporary folder C:\WINDOWS\TEMP~SFX345A
    %win% Windows Directory C:\WINDOWS
    %winsys% Windows System Files Directory C:\WINDOWS\SYSTEM
    %PROG% Program Files Folder C:\Program Files
    %DOCS% User’s documents folder C:\My Documents
    %DESKTOP% User’s Desktop Folder C:\Windows\Desktop
    %FONTS% Fonts Folder C:\Windows\Fonts

    You can also use registry entries. In this case, use the pipe symbol ( | ) to create sub-folders.


    Default UnZip To folder: %prog%\PowerArchiver\Skins
    Typically: C:\Program Files\PowerArchiver\Skins
    Default UnZip To folder: %temp%~test
    Typically: C:\Windows\Temp~test)

    Default UnZip To folder: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CommonFilesDir|MySoftware
    Typically: C:\Program Files\Common Files\MySoftware


  • conexware

    check example here

  • Okay. I think I’ve got it. It never dawned on me you could type in the dropdown items. And even if it did I wouldn’t have thought it understood relative paths.

    Thanks very much for your help.

    But, that leads to a new question. A caution in this help area says:

    Important information on using “run command line after extract” option

    In case you are using advanced extraction path option together with run command line after extracting option, you will need to use special “{p}” option in the run command line after extracting field so you can tell PowerArchiver SFX where to find extracted files.


    Default UnZip To folder: %temp-unique%
    Run Command Line: setup.exe
    Explanation: These options will run setup.exe from temporary path noted above.

    I do run a setup program after unzipping. But, I don’t understand these instructions.

    I don’t understand what a {p} option is. If my extract-to folder is FOOBAR it looks like I would use:

    Default UnZip To folder: %temp%\FOOBAR
    Run Command Line: setup.exe

    But, I don’t see how that’s added any {p} option?

  • conexware

    if you do just setup.exe, it will run setup.exe and thats it. If will run whatever is first setup.exe on that system in system path… if you do {p}\setup.exe, it will actually run %temp%\FOOBAR\setup.exe.

  • deleted

  • conexware

    no, you can add it if you want… it doesnt add it automatically, it is optional and up to you.

    so use {p}\setup.exe and it should be fine.

  • I’m still not sure I get it.

    If I use:
    Default UnZip To folder: %temp%\FOOBAR
    Run Command Line: setup.exe

    It will run setup.exe in the %temp%\FOOBAR folder. But, if I use {p}\setup.exe it will do something else???

    All I use PA for is to dump the files in a folder named FOOBAR under the default Temp directory and start Setup.exe in the folder FOOBAR and quit. Setup does the rest.

  • conexware

    Default UnZip To folder: %temp%\FOOBAR
    Run Command Line: {p}\setup.exe

    is what you should use… it runs specific path command line to where your executable is.

  • conexware

    p.s. just try it yourself and see if it works fine for you!

  • @spwolf:

    p.s. just try it yourself and see if it works fine for you!

    That’s what’s confusing. Not using (leaving out) the {p} seems to work fine. If I just use setup.exe, PA creates the subfolder and extracts the files into it and launches setup.

    Thank you very much for all your help.

    I still wish I could understand how adding the {p} is different than not adding it.

  • I think the problem is the example in manual is wrong since it doesn’t use the {p} option but is supposed to be an example of how to use the {p} option.

    I found this incredibly hard to decipher, and really don’t understand why SFX wouldn’t run the command line in the root extracted folder, especially when you set something like the default extract to temp folder.

    This could do with a lot of improvement, and better documentation.

Log in to reply