Encrypts a folder with its contents into a a password protected SFX (self extracting) executable file.
The generated executable file requires .NET Framework 2.0 or upper.
Namespace: DidiSoft.SfxThe generated executable file requires .NET Framework 2.0 or upper.
Assembly: DidiSoft.Pgp (in DidiSoft.Pgp.dll) Version: 1.7.3.35547
Syntax
| C# |
|---|
public void EnryptFolderToExe( string inputFolder, string encryptionPassword, string outputExeFile ) |
| Visual Basic |
|---|
Public Sub EnryptFolderToExe ( _ inputFolder As String, _ encryptionPassword As String, _ outputExeFile As String _ ) |
| Visual C++ |
|---|
public: void EnryptFolderToExe( String^ inputFolder, String^ encryptionPassword, String^ outputExeFile ) |
Parameters
- inputFolder
- Type: System..::..String
input folder to be encrypted
- encryptionPassword
- Type: System..::..String
encryption/decryption password
- outputExeFile
- Type: System..::..String
output executable file location
Remarks
The generated SFX (self extracting) executable file upon execution shows a dialog box
that requires the same password used for encryption in order to extract the encrypted file.
If the output exe file already exists, it will be overwritten.
If the output exe file already exists, it will be overwritten.
Examples
This example shows how to create a password protected self extracting (SFX) executable file
with default options.
CopyC#
CopyVB.NET
class SfxFromFolder { static void Main(string[] args) { // decryption password string password = "pass123"; SfxCreator sfx = new SfxCreator(); sfx.TargetDotNetFramework = SfxCreator.DotNetFramework.SELECT_FROM_EXECUTING_PROGRAM; sfx.EnryptFolderToExe(@"DataFiles", password, "sfx_demo.exe"); } }
Imports System Imports DidiSoft.Sfx Module SfxExeFromFolderDemo Sub Main() ' decryption password Dim password As String = "pass123" ' create the self extracting file Dim sfx As New SfxCreator() sfx.TargetDotNetFramework = SfxCreator.DotNetFramework.SELECT_FROM_EXECUTING_PROGRAM sfx.EnryptFolderToExe("DataFiles", password, "sfx_demo.exe") End Sub End Module