It looks like there may be some confusion as to what the arguments should be. The following code worked for me with the latest SevenZipSharp code on codeplex.
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim compressor As SevenZipSfx = New SevenZipSfx("7z.sfx")
compressor.MakeSfx("C:\Temp\cc_seal.7z", "C:\Temp\sfxseal.exe")
End Sub
I tried with the SevenZipSfx(SfxModule.Default) like in your example, but the module name wasn’t being set and I believe that’s where the “Object reference not set to an instance of an object” error was coming from, because I did this:
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim compressor As SevenZipSfx = New SevenZipSfx(SfxModule.Default)
compressor.ModuleFileName = "7z.sfx"
compressor.MakeSfx("C:\Temp\cc_seal.7z", "C:\Temp\sfxseal.exe")
End Sub
And it also worked for me without error. Take out the ModuleFileName line, and I got the same crash as you did.
Also notice that compressor.MakeSfx first argument needs to be a .7z file and not a .bat file. It will “work” but when you try to run the sfx.exe it will crash with something about it not being a valid 7zip file. So you'll need to compress your file/directory first.
Make sure 7z.sfx in in your application directory, or provide the path to it (it’s in the codeplex source download)
I tried it with the “7zxSD_All.sfx” file first, it extracts the file then Windows 7 gives an error about it not being installed correctly (I'm assuming Windows 7 thinks it's an install file and not a self extracting file). "7z.sfx" worked though.