Custom action DLL for Windows Installer
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
I am trying to invoke a Win32 DLL from the Windows Installer to perform certain custom actions. For this purpose I have exposed 1 API
MY_DLL_API UINT MyCustomActionLaunch(MSIHANDLE hMsiModule)
{MessageBoxW (NULL, L"MyCustomAction launch", L"MyCustomAction", MB\_OK); WCHAR msg \[500\] = {0}; WCHAR vbuff \[1024\] = {0}; DWORD vlen = 1024; UINT gp = MsiGetPropertyW(hMsiModule, L"ProgramFilesFolder", vbuff, &vlen); **if(gp == ERROR\_SUCCESS ) { if (wcslen(vbuff) <= 0) { MessageBoxW(NULL , L"Zero Bytes",L"MyCustomAction" , MB\_OK); } MessageBoxW(NULL, vbuff, L"MyCustomAction", MB\_OK); }** else { MessageBoxW (NULL, L"Failure", L"MyCustomAction", MB\_OK); } return -1;
}
I find that no bytes are being copied, where I am querying for a standard property . This DLL is being developed in VC6. Does anyone see anything wrong here ?
Engineering is the effort !