Click here to Skip to main content
15,893,588 members
Articles / Programming Languages / C++

High elevation can be bad for your application: How to start a non-elevated process at the end of the installation

Rate me:
Please Sign up or sign in to vote.
4.74/5 (24 votes)
25 May 200710 min read 206.8K   2.4K   56  
A reusable DLL that uses code injection to launch a non-elevated application from an InnoSetup script
// Microsoft Visual C++ generated resource script.
//
#include "DLL-res.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS

#ifdef WIN32
#include "res32.rc"
#endif

#ifdef WIN64
#include "res64.rc"
#endif

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE 
BEGIN
    "DLL-res.h\0"
END

2 TEXTINCLUDE 
BEGIN
    "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
    "#include ""windows.h""\r\n"
    "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
    "\r\n"
    "#ifdef WIN32\r\n"
    "#include ""res32.rc""\r\n"
    "#endif\r\n"
    "\r\n"
    "#ifdef WIN64\r\n"
    "#include ""res64.rc""\r\n"
    "#endif\r\0"
END

3 TEXTINCLUDE 
BEGIN
    "\r\0"
END

#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 2,1,0,0
 PRODUCTVERSION 2,1,0,0
 FILEFLAGSMASK 0x17L
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x40004L
 FILETYPE 0x2L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "Comments", "http://www.winability.com"
            VALUE "CompanyName", "WinAbility� Software Corporation"
            VALUE "FileDescription", "VistaLib DLL"
            VALUE "FileVersion", "2, 1, 0, 0"
            VALUE "InternalName", "VistaLib.dll"
            VALUE "LegalCopyright", "Copyright (C) 2007, WinAbility� Software Corporation."
            VALUE "LegalTrademarks", "WinAbility and VistaLib are trademarks of WinAbility� Software Corporation."
            VALUE "OriginalFilename", "VistaLib.DLL"
            VALUE "ProductName", "VistaLib[TM]"
            VALUE "ProductVersion", "2.1"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END

#endif    // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
When not busy entertaining my two cats, I run my micro-ISV business at www.winability.com

Comments and Discussions