Hi I have a Custom Action in C++ that gets the Com ports of a machine and I
need to get these into a listbox in my staller. I have the following but it
is the wcaAddTempRecord is not working and I cannot find any good
documentation on this. Thanks
extern "C" UINT __stdcall GetDatascanPort(MSIHANDLE hInstall)
{
AssertSz(FALSE, "debug here");
DebugBreak();
HRESULT hr = S_OK;
UINT er = ERROR_SUCCESS;
HKEY keyHandle;
DWORD i,openStatus,cb_value_buffer,cb_buffer,dwType;
char value_buffer[100],buffer[10];
MSIHANDLE hTable = NULL;
MSIHANDLE hColumns = NULL;
hr = WcaInitialize(hInstall, "GetDatascanPort");
ExitOnFailure(hr, "Failed to initialize");
WcaLog(LOGMSG_STANDARD, "Initialized.");
if (RegCreateKeyEx( HKEY_LOCAL_MACHINE,
"HARDWARE\\DEVICEMAP\\SERIALCOMM",
0,
"",
REG_OPTION_NON_VOLATILE,
KEY_QUERY_VALUE,
default_sa(),
&keyHandle,
&openStatus ) == ERROR_SUCCESS )
{
for (i=0;;i++)
{
cb_value_buffer = sizeof(value_buffer);
cb_buffer = sizeof(buffer);
if (RegEnumValue(keyHandle, i, value_buffer,
&cb_value_buffer,
NULL,
&dwType,
(unsigned char *) buffer,
&cb_buffer) !=
ERROR_SUCCESS)
break;
if (dwType != REG_SZ || strlen(buffer) > 6)
continue;
}
hr = WcaAddTempRecord(&hTable, &hColumns, L"ListBox", NULL, 0,
3, L"COMPORT", 1, L"Item 1");
RegCloseKey(keyHandle);
if (hTable)
MsiCloseHandle(hTable);
if (hColumns)
MsiCloseHandle(hColumns);
return WcaFinalize(hr);
}
LExit:
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
return WcaFinalize(er);
}
My list box is, it has a sample list item:
<Control Type="ListBox" Property="COMPORT" Id="Comport" Width="80"
Height="40" X="80" Y="165">
<ListBox Property="COMPORT">
<ListItem Text="COM 3" Value="0"/>
</ListBox>
Kind Regards,
Natalie Carr
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users