Delays when creating multiple self extractor archive files

Jun 19, 2012 at 10:19 AM

Hi,

i am creating a self extracting archive file. The code is executed three times by the same process to create three files in three different locations. Everytime the save self extracting archive is called there is a longer delay in the time it takes.

First call 1 second,second call 1 minute, third call 12 minutes. Does anyone have any explanations for the delay.

Here is the code below:

 

public bool BuildSelfExtractExe(string sourceFolder, string localZipDir,

 

string zipName, string posCbFolder)

{

 

bool succeeded = true;

 

 

string fullZipPath = Path.Combine(localZipDir, zipName);

UprInstrumentation.RaiseMessage(eventSourceName,

new UprException(UprExceptionType.EnumTypeInfo, "Ionic Zip set options - Start"));

SelfExtractorSaveOptions options =

new SelfExtractorSaveOptions();

options.DefaultExtractDirectory = posCbFolder;

options.Flavor = SelfExtractorFlavor.ConsoleApplication;

options.ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently;

options.Quiet =

false;

UprInstrumentation.RaiseMessage(eventSourceName,

new UprException(UprExceptionType.EnumTypeInfo, "Ionic Zip set options - End"));

UprInstrumentation.RaiseMessage(eventSourceName,

new UprException(UprExceptionType.EnumTypeInfo, "Ionic Zip file Create - Start"));

ZipFile zipFile =

new ZipFile();

zipFile.AddDirectory(sourceFolder);

 

// Set AutoTemp to true if you wish the EXE to automatically

 

// unzip into a auto-selected temp directory when the EXE

 

// is run.

 

//zip.AutoTemp = true;

 

// Set AutoRun to the name of an EXE within the

 

// archive to automatically run it after the

 

// self-extracting EXE is unzipped.

 

//zip.AutoRun = "setup.exe";

 

//zip.ExeNoInterface = true;

 

 

// Write a self-extracing EXE. The LastError

 

// property will contain error information if

 

// it fails

 

DirectoryInfo zipDir = new DirectoryInfo(localZipDir);

 

if (!zipDir.Exists)

{

 

Directory.CreateDirectory(localZipDir);

}

UprInstrumentation.RaiseMessage(eventSourceName,

new UprException(UprExceptionType.EnumTypeInfo, "Ionic Zip file crate - End"));

UprInstrumentation.RaiseMessage(eventSourceName,

new UprException(UprExceptionType.EnumTypeInfo, "Ionic Zip save self extractor - Start"));

 

zipFile.SaveSelfExtractor(fullZipPath, options);

UprInstrumentation.RaiseMessage(eventSourceName,

new UprException(UprExceptionType.EnumTypeInfo, "Ionic Zip save self extractor - End"));

 

// Make sure all resources are released.

UprInstrumentation.RaiseMessage(eventSourceName,

new UprException(UprExceptionType.EnumTypeInfo, "Ionic Zip relase resources - Start"));

zipFile.Dispose();

UprInstrumentation.RaiseMessage(eventSourceName,

new UprException(UprExceptionType.EnumTypeInfo, "Ionic Zip relase resources - End"));

 

return succeeded;