7z SFX Modified Module and Tools

520 posts in this topic


This looks like just the thing I need. I have a setup (multi file/directories) that I want to distribute as 1 file so I tried this.

I get a problem though. When my setup application should start to copy files that was included in the 7z file it says it can't find the files.

So, I started to look at this. I run my SFX exe which I created like this:




copy /b 7zsd_All.sfx + config.txt + MySetup.7z Test.exe

I then run test.exe and it takes a while (a lot of files) and at the same time I go to my users temp folder and see that it is decompressing all the files into a 7ZipSfx.000 directory.

Everything perfect so far!

Then it automatically starts my setup.exe and I click through my setup steps. Then the setup comes to the stage when it should start copying files and I get my error message which says that it can't find a file it should copy.

I now look at the temp directory and see that most of the files that were decompressed are gone, only a number of files starting with "_" are left behind and the setup.exe hasn't even finished its "thing" yet.

Any ideas what's going on, why it is removing the files before the setup has finished and how to get around this problem?

I'm doing this on a Windows 7 computer but the same thing happens on Windows Vista. Have not tested it on an XP machine.



Share this post

Link to post
Share on other sites

Some installshiled installers with setup.exe have this problem, 7zip sfx do not work so well so I use WinRAR sfx instead, it does not have this problem

One small note is that you should use two backslashes when in your config.txt to separate dirs

RunProgram="MyApp\\setup.exe" ; Two backslashes \\

So yea switch to WinRAR sfx just for this or try start /wait, also try calling it via cmd file


Share this post

Link to post
Share on other sites


Modules 1.4 alpha build 1774 (x86 & x64) are updated (June 6, 2010) and are accessible on: http://7zsfx.info/ru/download.html.


# The source code of 7-Zip version 9.14 beta (June 4, 2010) is used

+ Check necessary for unpacking process: free a place on a disk and the size of physical memory

+ 'WarningTitle', 'MiscFlags' parameters in a configuration file

+ '-mfX' switch

Wiki: http://7zsfx.info/en/wiki/

SVN repository: http://svn.7zsfx.info

Edited by gora

Share this post

Link to post
Share on other sites

Does anyone still have the exectools.7z from Oleg? All the links I've found all point to the now long dead http://unattended.solta.ru/exectools.7z

Hoping someone might still have it and wouldn't mind sharing :)

Wayback Machine!






Hmm close, but the exectools.7z is nowhere to be seen :(. The search continues...


Share this post

Link to post
Share on other sites

Wow thanks gora :)

jaclaz, I guess I looked over your link too quickly, as when I clicked the original one, the exectools.7z file wasn't there. The second ones you posted seemed to work though. I'll have to look at this web archive more. Seems like a good thing to be able to go back in time.


Share this post

Link to post
Share on other sites

Removing __CxxFrameHandler3(MSVCRT.DLL) dependency on x64:

This entry point is available in MSVCRT.DLL of Windows7 x64/Windows Srv 2008 R2, but unfortunately, it's missing in MSVCRT.DLL of Windows XP/2003 x64.

After searching, I found this post:


One reply suggests:

extern "C" void *__CxxFrameHandler;
extern "C" void __declspec(naked) __CxxFrameHandler3(void)
// Jump indirect: Jumps to __CxxFrameHandler
_asm jmp __CxxFrameHandler ; Trampoline bounce

It's good enough on x86, I suppose you may consider using that in your Exceptions.cpp, replacing your extern "C" void __CxxFrameHandler3. Yet x64 compiler doesn't support _asm and the keyword "naked". So you have to use the bloated C code on x64:

extern "C" void *__CxxFrameHandler( PEXCEPTION_RECORD rec, void * frame, PCONTEXT context, void ** dispatch );
extern "C" void __CxxFrameHandler3( PEXCEPTION_RECORD rec, void * frame, PCONTEXT context, void ** dispatch )
{ __CxxFrameHandler( rec, frame, context, dispatch ); }

I have tested it and it passed the linking with an old MSVCRT.LIB. You could look at this and try making some exceptions while executing/debugging, to see whether this works, and consider using it in your next version.


Added a screenshot:

post-82036-041651500 1283965476_thumb.pn

Edited by YumeYao

Share this post

Link to post
Share on other sites

In the Help File, 7zSD_En.chm, under "Examples" for the TotalCommander SFX,

a shortcut is created using the following line:

Shortcut="26,{%Var1%TOTALCMD.EXE},{},{Microsoft\\Internet Explorer\\Quick Launch},{File manager},{Total Commander}"

The help text then explains as follows:

A shortcut to Total Commander will be created in the current user Quick Launch panel as defined by 'type' option with the value of "26" (an undocumented feature).

My questions are:

Is there an undocumented 'type' option for creating a shortcut in the 'SendTo" Folder using the Shortcut= parameter? If Yes, what is the value?

If there is no such type option for directly creating a shortcut in the "SendTo' Folder using this parameter, is there a workaround for doing this?

I did try using '53' as the value with the {folder_for_shortcut} parameter set to {SendTo}, but this did not work.

Thanks for any assistance.


Share this post

Link to post
Share on other sites
Is there an undocumented 'type' option for creating a shortcut in the 'SendTo" Folder using the Shortcut= parameter? If Yes, what is the value?


Full list undocumented 'type' option (Russian OS):

7zSfxFolder35= C:\Documents and Settings\All Users\Application Data

7zSfxFolder22= C:\Documents and Settings\All Users\Ãëàâíîå ìåíþ

7zSfxFolder23= C:\Documents and Settings\All Users\Ãëàâíîå ìåíþ\Ïðîãðàììû

7zSfxFolder24= C:\Documents and Settings\All Users\Ãëàâíîå ìåíþ\Ïðîãðàììû\Àâòîçàãðóçêà

7zSfxFolder47= C:\Documents and Settings\All Users\Ãëàâíîå ìåíþ\Ïðîãðàììû\Àäìèíèñòðèðîâàíèå

7zSfxFolder46= C:\Documents and Settings\All Users\Äîêóìåíòû

CommonDocuments= C:\Documents and Settings\All Users\Äîêóìåíòû

7zSfxFolder55= C:\Documents and Settings\All Users\Äîêóìåíòû\Ìîè âèäåîçàïèñè

7zSfxFolder54= C:\Documents and Settings\All Users\Äîêóìåíòû\Ìîè ðèñóíêè

7zSfxFolder53= C:\Documents and Settings\All Users\Äîêóìåíòû\Ìîÿ ìóçûêà

7zSfxFolder31= C:\Documents and Settings\All Users\Èçáðàííîå

7zSfxFolder25= C:\Documents and Settings\All Users\Ðàáî÷èé ñòîë

CommonDesktop= C:\Documents and Settings\All Users\Ðàáî÷èé ñòîë

7zSfxFolder45= C:\Documents and Settings\All Users\Øàáëîíû

- 7zSfxFolder40= C:\Documents and Settings\gora

7zSfxFolder26= C:\Documents and Settings\gora\Application Data

7zSfxFolder33= C:\Documents and Settings\gora\Cookies

7zSfxFolder28= C:\Documents and Settings\gora\Local Settings\Application Data

- 7zSfxFolder59= C:\Documents and Settings\gora\Local Settings\Application Data\Microsoft\CD Burning

7zSfxFolder34= C:\Documents and Settings\gora\Local Settings\History

7zSfxFolder32= C:\Documents and Settings\gora\Local Settings\Temporary Internet Files

7zSfxFolder19= C:\Documents and Settings\gora\NetHood

7zSfxFolder27= C:\Documents and Settings\gora\PrintHood

7zSfxFolder08= C:\Documents and Settings\gora\Recent

7zSfxFolder09= C:\Documents and Settings\gora\SendTo

7zSfxFolder11= C:\Documents and Settings\gora\Ãëàâíîå ìåíþ

7zSfxFolder02= C:\Documents and Settings\gora\Ãëàâíîå ìåíþ\Ïðîãðàììû

7zSfxFolder07= C:\Documents and Settings\gora\Ãëàâíîå ìåíþ\Ïðîãðàììû\Àâòîçàãðóçêà

7zSfxFolder06= C:\Documents and Settings\gora\Èçáðàííîå

7zSfxFolder05= C:\Documents and Settings\gora\Ìîè äîêóìåíòû

MyDocs= C:\Documents and Settings\gora\Ìîè äîêóìåíòû

MyDocuments= C:\Documents and Settings\gora\Ìîè äîêóìåíòû

- 7zSfxFolder39= C:\Documents and Settings\gora\Ìîè äîêóìåíòû\Ìîè ðèñóíêè

- 7zSfxFolder13= C:\Documents and Settings\gora\Ìîè äîêóìåíòû\Ìîÿ ìóçûêà

- 7zSfxFolder00= C:\Documents and Settings\gora\Ðàáî÷èé ñòîë

7zSfxFolder16= C:\Documents and Settings\gora\Ðàáî÷èé ñòîë

UserDesktop= C:\Documents and Settings\gora\Ðàáî÷èé ñòîë

7zSfxFolder21= C:\Documents and Settings\gora\Øàáëîíû

7zSfxFolder38= C:\Program Files

7zSfxFolder43= C:\Program Files\Common Files

7zSfxFolder36= C:\WINDOWS

7zSfxFolder20= C:\WINDOWS\Fonts

7zSfxFolder56= C:\WINDOWS\resources

7zSfxFolder37= C:\WINDOWS\system32

7zSfxFolder41= C:\WINDOWS\system32


1 Variables marked with a sign "-" in the beginning of a line, do not exist on Ò13

2 Users (in the resulted example "gora") on Ò13 do not exist and instead of it will be used everywhere "Default User"


Share this post

Link to post
Share on other sites

its to bad that the %%S parameter cannot be manipulated in any way to read an sfx that has spaces in the path I even tried fooling it by adding quotes around the \"%%S\"

but no matter what Ive tried, it won't return an SFX on a path with spaces.. :(

wonderful app!


Share this post

Link to post
Share on other sites


please give me more info about problem, i.e. configuration file, execution pathes etc.

so I was able to reproduce this problem


Share this post

Link to post
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.