0

I'm using DotNetZip to make a self-extracting archive (SFXtest.exe) which runs a program once extracted (testapp.exe) - the problem I'm having is that the form displayed during the extraction remains showing until testapp.exe closes - ideally I would like the extraction form to close when extraction is complete, just leaving testapp.exe running.

Code example:

       Dim FileList As New List(Of String)
    FileList.Add("c:\test\testapp.exe")
    FileList.Add("c:\test\testdll.dll")

    Dim SFXSaveOptions As New SelfExtractorSaveOptions

    Using zip As New Ionic.Zip.ZipFile
        With SFXSaveOptions
            .DefaultExtractDirectory = Path.GetTempPath
            .ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently
            .Flavor = SelfExtractorFlavor.WinFormsApplication
            .Quiet = True
            .PostExtractCommandLine = "testapp.exe"
            .RemoveUnpackedFilesAfterExecute = False
        End With

        For i = 0 To 1
            zip.UpdateFile(FileList(i), "")
        Next

        zip.SaveSelfExtractor("c:\test\SFXTest.exe", SFXSaveOptions)
    End Using
Progman
  • 16,827
  • 6
  • 33
  • 48
  • Do you have to use the PostExtractCommandLine? Is it possible to just run testapp.exe via process.start afterwards? – Hursey Apr 07 '22 at 20:36
  • Afraid not - I'm not running a program at that point, just running the self-extracting zip. However, you gave me an idea of changing the PostExtractCommandLine to be cmd.exe /c start testapp.exe - but that didn't seem to work - the sfx didn't even display the extraction form, I'm not sure why. – Ozymandius257 Apr 08 '22 at 13:21

0 Answers0