Visual C++ Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual C++ Examples

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


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

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

 

 

 

 

 

 

 

 

Create EXE that Downloads Zip from URL and Extracts

Creates an EXE that downloads a .zip from a URL and extracts.

Download Chilkat C++ Libraries for VC++ 8.0 / Win32

Download Chilkat C++ Libraries for VC++ 7.0 / Win32

Download Chilkat C++ Libraries for VC++ 6.0 / Win32

#include <CkZip.h>

void ChilkatSample(void)
    {
    CkZip zip;

    bool success;

    //  Any string unlocks the component for the 1st 30-days.
    success = zip.UnlockComponent("Anything for 30-day trial");
    if (success != true) {
        printf("%s\n",zip.lastErrorText());
        return;
    }

    //  This example creates a .exe that downloads the .zip from
    //  http://www.chilkatsoft.com/testData/testWithSetup.zip,
    //  unzips it, and runs the setup.exe contained within.
    //  This is an actual URL that can be tested. The setup.exe
    //  is a do-nothing program that simply displays a dialog box
    //  with an "OK" button.
    zip.put_ExeSourceUrl("http://www.chilkatsoft.com/testData/testWithSetup.zip");

    //  Set the AutoTemp property to create an EXE that
    //  extracts to an auto-chosen temp directory:
    zip.put_AutoTemp(true);

    //  Indicate the file within the .zip that should be run after
    //  extraction:
    //  Note: You may download the .zip at http://www.chilkatsoft.com/testData/testWithSetup.zip
    //  and examine it. You'll see that the "setup.exe" has a path
    //  within the .zip, therefore you must specify the path as it
    //  exists within the .zip:
    zip.put_AutoRun("bin/setup.exe");

    //  Indicate that we do not want a main dialog, but we *do* want
    //  a progress dialog.
    zip.SetExeConfigParam("ShowMain","0");
    zip.SetExeConfigParam("ShowProgress","1");

    //  Customize the progress dialog:
    zip.SetExeConfigParam("ProgressTitle","This is the progress dialog title");
    zip.SetExeConfigParam("ProgressCaption","This is the progress dialog caption");

    //  Write "mySfx.exe"

    success = zip.WriteExe("mySfx.exe");
    if (success != true) {
        printf("%s\n",zip.lastErrorText());
        return;
    }

    printf("EXE Created!\n");
    }

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

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

Mail Component · .NET Mail Component · XML Parser