I will understand how to create a SFX using SevenZipSharp library.
First of all I need to say I can't find any property to set the compression level, and all of that.
And when I try to make an SFX of a file, I get this error:
"Object reference not set to an instance of an object."
If I try to make an SFX of a folder, I get this error:
"Access to the path 'C:\test' is denied."
(But is not True, I'm Admin and I've tested it with more avaliable folders...)
This is the full class where I'm trying to understand all of this... :
Imports SevenZip
Public Class Form1
Dim dll As String = "7z64.dll"
Private Function SevenZipSharp_Compress_SFX(ByVal Input_DirOrFile As String, _
ByVal OutputFileName As String) As Boolean
Try
' Set library path
SevenZipCompressor.SetLibraryPath(dll)
' Create compressor
Dim Compressor As SevenZipSfx = New SevenZipSfx(SfxModule.Default)
' Set SFX parameters
' ¿?
' Start compression
Compressor.MakeSfx(Input_DirOrFile, OutputFileName)
Catch ex As Exception
'Return False ' File not compressed
Throw New Exception(ex.Message)
End Try
Return True ' File compressed
End Function
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
SevenZipSharp_Compress_SFX("C:\test\file.bat", "C:\7zSFX.exe")
End Sub
End Class
UPDATE:
@For Everyone:
please I pray to someone who will answer my question at least you used to create a SFX SevenZipSharp to tell me what I'm doing wrong and how to fix it, not to answer to say that they are user permission issues, please read the comments.