C# Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

C# Examples

Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML to XML
HTTP
IMAP
Encryption
MHT / HTML Email
MIME
RSA Encryption
S/MIME
Socket
Spider
Tar Archive
Upload
XML
XMP
Zip Compression


More Examples...
Email Object
POP3
SMTP
RSS
Atom
String
Byte Array
Self-Extractor

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

Create Self-Extracting EXE in C#

Download Chilkat .NET for 2.0 Framework

Download Chilkat .NET for 1.0 / 1.1 Framework

This is a simple example demonstrating how to create a self-extracting EXE in C#. It zips a directory tree and creates a .exe that can be run without the .NET runtime or any system DLLs (it is completely standalone).


private void CreateExe_Click(object sender, System.EventArgs e)
{
	// If this does not compile or work correctly,
	// download and install the latest version
	// of Chilkat .NET and try again.  Some of the
	// self-extracting EXE properties, such as AutoTemp
	// were added in a recent version.

	Chilkat.Zip zip = new Chilkat.Zip();
	zip.UnlockComponent("30-day trial");

	// We will never actually write test.zip, because
	// we'll be writing a self-extracting EXE instead.
	zip.NewZip("test.zip");

	zip.AppendFiles("./SendMail",true);

	// 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";
	
	// Set the title bar for the EXE
	zip.ExeTitle = "This is my self-extracting EXE";

	// Write a self-extracing EXE.  The LastError
	// property will contain error information if
	// it fails
	if (!zip.WriteExe("test.exe"))
	{
		textBox1.Text = zip.LastErrorText;
	}
	else
	{
		textBox1.Text = "Self-extracting EXE successfully created!";
	}


	// Make sure all resources are released.
	zip.CloseZip();
}


 

 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2008 Chilkat Software, Inc. All Rights Reserved.

Email Component · XML Parser