7zip – Create self-extracting Archive (sfx) with specified Extract path

7-ziparchivingextractself-extractingzip

Hello SuperUser Experts,

Thank you for your help in advanced. I am trying to get the 7zip SFX archive to create an executable. I am able to get the executable. But when I run it, it give the downloads path for Extract to:. I would like to to change to %AppData%\Roaming by default. Screenshot below will give an idea of what I am trying to do.

7zip settings

Extract To: dialogue box

There are no setup.exe or anything inside the archive, it has just few files that needs to go to Roaming folder. This is for many of our users, who can get this updates without them specifying a path. (It is always easy when users do not have to specify a path, otherwise, it is my experience that the users can pick most unusual paths!!)

Thank you.

Update

Here is what I have tried so far. my config file content is

;!@Install@!UTF-8!
InstallPath="%AppData%\\Roaming\\Notepad++"
;!@InstallEnd@!

This is the command line call.

copy /b 7zS.sfx + config.txt + Installer.7z myinstaller.exe

Unfortunately it does not work. It gives the following path. It should be %AppData%\\Roaming\\Notepad++.

[Extract path]

Best Answer

Try 7z SFX Builder, it's free, supports command line parameters, and also you can specify extraction path on the GUI Main Tab:

Main tab

Related Question