Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
Create Self-Extracting EXE with Icon, Setup File, Auto-Run, etc.
Demonstrates many of the features of using Chilkat Zip to create self-extracting executables.
Private Sub Command1_Click()
Dim zip As New ChilkatZip2
zip.UnlockComponent "UnlockCode"
' Set this property to use an icon for the EXE that is created.
zip.ExeIconFile = "box.ico"
' Use this property to automatically unzip when the EXE is double-clicked.
' 1 = EXE has no interface, 0 (the default) = EXE includes interface
zip.ExeNoInterface = 1
' Causes the EXE to automatically unzip to a pre-set directory.
zip.ExeUnzipDir = "c:\temp\myApp"
' Causes the EXE to run a program (that was contained within the EXE)
' immediately after extracting.
zip.AutoRun = "Setup.exe"
' Parameters can be passed to the AutoRun program.
zip.AutoRunParams = "-x -a -b"
' Causes the creation of an EXE that has no interface,
' and automatically selects a temporary directory for
' unzipping.
' zip.AutoTemp = 1
' Initialize the Zip object and add some files.
zip.NewZip "blahblahblah.zip"
zip.AppendOneFileOrDir "Setup.exe", 0
zip.AppendOneFileOrDir "hamlet.xml", 0
zip.AppendData "something.txt", "This is data"
success = zip.WriteExe("myPackage.exe")
If (success = 0) Then
MsgBox zip.LastErrorText
Else
MsgBox "Self-extracting EXE created."
End If
End Sub
|
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2009 Chilkat Software, Inc. All Rights Reserved.