Back to index

python3.2  3.2.2
Defines | Functions
msisupport.c File Reference
#include "windows.h"
#include "msiquery.h"

Go to the source code of this file.

Defines

#define PSIZE   1024

Functions

static UINT debug (MSIHANDLE hInstall, LPCSTR msg)
UINT __declspec (dllexport)
BOOL APIENTRY DllMain (HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)

Define Documentation

#define PSIZE   1024

Function Documentation

UINT __declspec ( dllexport  )

Definition at line 22 of file msisupport.c.

{
#define PSIZE 1024
    WCHAR wpath[PSIZE];
    char path[PSIZE];
    UINT result;
    DWORD size = PSIZE;
    DWORD attributes;


    result = MsiGetPropertyW(hInstall, L"TARGETDIR", wpath, &size);
    if (result != ERROR_SUCCESS)
        return result;
    wpath[size] = L'\0';
    path[size] = L'\0';

    attributes = GetFileAttributesW(wpath);
    if (attributes == INVALID_FILE_ATTRIBUTES ||
        !(attributes & FILE_ATTRIBUTE_DIRECTORY))
    {
        return MsiSetPropertyA(hInstall, "TargetExists", "0");
    } else {
        return MsiSetPropertyA(hInstall, "TargetExists", "1");
    }
}
static UINT debug ( MSIHANDLE  hInstall,
LPCSTR  msg 
) [static]

Definition at line 8 of file msisupport.c.

{
    MSIHANDLE hRec = MsiCreateRecord(1);
    if (!hRec || MsiRecordSetStringA(hRec, 1, msg) != ERROR_SUCCESS) {
        return ERROR_INSTALL_FAILURE;
    }
    MsiProcessMessage(hInstall, INSTALLMESSAGE_INFO, hRec);
    MsiCloseHandle(hRec);
    return ERROR_SUCCESS;
}
BOOL APIENTRY DllMain ( HANDLE  hModule,
DWORD  ul_reason_for_call,
LPVOID  lpReserved 
)

Definition at line 87 of file msisupport.c.

{
    return TRUE;
}