1

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.

  • I just observed that the problem is actually not with folder structure but the file am trying to call. If i call a bootstrapper the extraction fails else if i call a .net exe in "RunProgram" everything is extracted properly. – Suraj Rajendrakumar Sep 15 '14 at 05:03

2 Answers2

2

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.

  • Wow this saved me. From my perspective it looked like the self extracting zip wasn't extracting all the files at all. I was calling a batch file that had a start command in it and it must have been cleaning up some of the temp files when the bat ended. – WHol Jan 26 '16 at 11:23
0

One workaround is to nest the sfx. You first make an sfx that include all the necessary files, and then nest it together with your bootstrapper and a script to extract that and run your bootstrapper inside another sfx which will run that script.

See more: SFX with 7-zip : Is it possible to run a included .bat file before extracting the files?

Ooker
  • 1,969
  • 4
  • 28
  • 58