7zipsfx

7zip sfx is executing RunProgram before it extracts all the files


I have a 7 zip self extracting exe, it is archived as shown below:

[mainfolder]
         start.exe (a C++ bootstrapper)
         [subfolder] (contains all my applications assemblies and executable

Now my config.txt is running the start.exe (through "RunProgram") which will actually run a executable in [subfolder]. Now this is failing as the extraction all the files in [subfolder] is still not complete (i did find all files in extraction location) by the time "start.exe" is started.

One other strange thing is the extraction of all files in [subfolder] is completed if at all i specify to run a exe inside subfolder in config file i.e to "RunProgram", or even i specify a random text to "RunProgram" at least the extraction is complete.

What it could be that if prefer to run a file in [mainfolder] causes the [subfolder] to be extracted incompletely? Please help.


Solution

  • It was a wrong analysis, the problem was not with extraction.. all the time it was extracting properly. But when i was trying to call bootstrapper it used to call another exe and exit so SFX thought the process has finished executing and was deleting files.

    So when there is chain of calls from diff application care should be taken that at least the application you start from (through "RunProgram","ExecuteFile" or from any thing..) stays alive till all needy application exits.