Jump to content

7-zip sfx extract to this folder


SoreGums

Recommended Posts

How do you just create a 7-zip sfx that extracts to a specified directory/place automatically without prompts?

Example.

Portable FireFox, doesn't need to be installed, just needs to be somewhere... I setup a stripped out version of PFF and 7-zip'd it up again (sfx) but when you execute pff.exe it asks where to extract to.

How do I get it to just extract to "c:\" ?

Thanks

Link to comment
Share on other sites


How do you just create a 7-zip sfx that extracts to a specified directory/place automatically without prompts?

Example.

Portable FireFox, doesn't need to be installed, just needs to be somewhere... I setup a stripped out version of PFF and 7-zip'd it up again (sfx) but when you execute pff.exe it asks where to extract to.

How do I get it to just extract to "c:\" ?

Thanks

I want to know something very similar. There are examples galore regarding Swithless installs, but what I want to do is use SFX to extract to a dir of choice and then execute a file in that directory, nothing else. I don't want to install anything except the compressed archive. Uncompress the archive to a folder - execute a file in the folder - end of story. Somehow this is not possible, but I know it is. I have a program that does it, just can't find info on how to pass the paramerter to execute the one file. This program uncompresses to a 7z.temp folder and then executes the file.

There's pleny of advice about passing arguments at the command level but nothing using the windows Parameters: of 7zip.

Link to comment
Share on other sites

@SoreGums

1. Download 7ZSD.sfx from it's homepage :

http://7zsfx.solta.ru/en/

2. Copy/paste the following into notepad and save it using 'UTF8' as 'config.txt' :

;!@Install@!UTF-8!
InstallPath="%Programfiles%\\Portable Firefox"
GUIMode="2"
;!@InstallEnd@!

(Change the path as you like, and remember to use double backslashes)

3. Make a 7z archive of the contents inside your 'Portable Firefox' folder.

4. Place the 7z archive, 7ZSD.sfx and config.txt into the same folder and copy/paste the following into a command prompt :

copy /b 7ZSD.sfx + config.txt + archive.7z Setup.exe

(Change 'Setup.exe' to whatever you want)

@vim

Use the above directions + additionally add the following to 'config.txt':

RunProgram="hidcon:setup.cmd"

Change 'setup.cmd' to whatever. If you don't run a batch file, then remove the 'hidcon:' part(it's used to hide the console window). You can run 'msi' files directly without using 'msistub.exe' or 'msiexec.exe' with this modified 7z SFX installer module(7ZSD.sfx). Btw, if you don't want a fixed extraction path and just want to use the temp folder, and also have the folder with the extracted files deleted afterwards, then remove the following from 'config.txt' :

InstallPath="x"

Edited by Martin H
Link to comment
Share on other sites

;!@Install@!UTF-8!
InstallPath="%Programfiles%\\Portable Firefox"
GUIMode="2"
;!@InstallEnd@!

Nice one thanks :)

I knew it was something to do with the config.txt

Is there a list of parameters anywhere, they are hard to find...

Thanks again :)

Link to comment
Share on other sites

have you tried looking in the 7-zip docs/help/online guides if there is a set commands you can run to achieve what you want?

Well in the help file I have with 7-zip here it lists parameters for config.txt but doesn't mention "InstallPath"

So if it did I'd have been good to go...

Link to comment
Share on other sites

1. Download 7ZSD.sfx from the first link listed on this russian page :
http://7zsfx.solta.ru/downloads_RU.html
2. Copy/paste the following into notepad and save it using 'UTF8' as 'config.txt' :
;!@Install@!UTF-8!
InstallPath="%Programfiles%\\Portable Firefox"
GUIMode="2"
;!@InstallEnd@!
(Change the path as you like, and remember to use double backslashes)
3. Make a 7z archive of the contents inside your 'Portable Firefox' folder.
4. Place the 7z archive, 7ZSD.sfx and config.txt into the same folder and copy/paste the following into a command prompt :copy /b 7ZSD.sfx + config.txt + archive.7z Setup.exe
(Change 'Setup.exe' to whatever you want)
Use the above directions + additionally add the following to 'config.txt':
RunProgram="hidcon:setup.cmd"
Change 'setup.cmd' to whatever. If you don't run a batch file, then remove the 'hidcon:' part(it's used to hide the console window). You can run 'msi' files directly without using 'msistub.exe' or 'msiexec.exe' with this modified 7z SFX installer module(7ZSD.sfx). Btw, if you don't want a fixed extraction path and just want to use the temp folder, and also have the folder with the extracted files deleted afterwards, then remove the following from 'config.txt' :
InstallPath="x"

@Martin H, Thank you, just what I was looking for. I noticed that your Russian link *.sfx is much smaller than the one given by the guide on 7zip installers. I though my immediate install would have been different. I noticed several people modifing the *.sfx using Reshack. I have looked inside. Someone modified the % expanding to be just % and then below their was a word saying Loading in the gray area. Are theri any tuts on the dialouge modifing?

Thanks again for your help. Interestingly you helped two people with one "stone" :)

EDIT: I first googled and for some reason the above "babelfish" site never came up. Great find.

I also was wondering about the "config.txt" parameters...now if I can just figure out how to use

Reshack on the SFX file I'll be set.

Edited by vim
Link to comment
Share on other sites

Hi again, vim :) (And btw, you are very welcome, mate!)

The moded module i linked to is smaller because it is made for only decompressing LZMA(default 7z archiving algorithm). There are also three other versions of the module on the site for other algorithms. Another reason is that it's the 7ZSD.sfx version, instead of the frequently other used 7zS.sfx version of the module. The difference between the two is that the 7ZSD.sfx version is dynamically linked to MSVCRT.dll, whereas 7zS.sfx is statically linked to it, and so since all newer Windows OSes includes MSVCRT.dll by default in their OS, then there's no reason to use the version of the module which wasts additional space on statically linking to that lib also(unless you want to support legacy OS's also). The moded module has now abandoned the 7zS.sfx version and now only supports the 7ZSD.sfx version. This module isn't UPX'd, because you can't change the icon on a SFX installer made with a UPX'd module, but you can just UPX the module after you have changed the icon, if you care about saving about half of the modules uncompressed size. I'm not sure what it is you're trying to archive with your reshacking question, so i can't answer specifically, however this moded module itself allready includes several parameters for changing the text, fonts, buttons, logos and extraction dialogs etc. For example, you can reshack the normal module to e.g. completely hide the extraction dialog, but with this moded module, then you just add the parameter :

GUIMode="2"

. On the site i linked to earlier, then there is also another section which shows various examples and pictures of how it looks during the installation and then also lists the needed code for 'config.txt' to archieve that result. If what you are after isn't allready covered by the new feature set of the moded module, then i'm affraid that i can't help you, since i don't personally have any other experience with reshacking exe's other than the simple process of changing icons on my selfmade 7z switchless installers.

CU, Martin.

Link to comment
Share on other sites

Awesome info there and yeah I picked up on the fact that it wasn't the same sfx module used around the place and have made my auto extract pff file and works great on w2k/xp/vista (chose to extract to %appdata% since vista has all the new permissions stuff).

I changed the icon and made the dialog show with a short message, works great.

Thanks again.

edit: after checking out more parameters there is a neat shortcut creation line too which is really good!

Edited by SoreGums
Link to comment
Share on other sites

@SoreGums

You are very welcome, mate :) Yeah, i'm also really impressed with all the new great parameters that is available now with this version of the module, and indeed, the shortcut creation parameter is indeed simply brilliant :) Other things which i like the most, is the 'hidcon:' switch for the 'RunProgram=' parameter, so the console window is completely hidden during batch file loading and the ability to run MSI installers directly, without needing msistub.exe or msiexec.exe.

CU, Martin.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...