Thanks Peter..:) Il give that a go..:) -----Original Message----- From: Peter Shirtcliffe [mailto:pshirtcli...@sdl.com] Sent: 20 September 2012 11:53 To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Populate a list box from a custom action
Your call to wcaaddtemprecord looks ok. The only thing I can guess at is that you need to specify all 4 columns of the ListBox table, rather than just the 3 you have. The other difference from my code is that I also have MSIDBERROR insertError = MSIDBERROR_NOERROR; And I give &insertError as the 4th argument. -----Original Message----- From: Natalie Carr [mailto:natalie.c...@measuresoft.com] Sent: 20 September 2012 10:58 To: wix-users@lists.sourceforge.net Subject: [WiX-users] Populate a list box from a custom action 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 WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users SDL PLC confidential, all rights reserved. If you are not the intended recipient of this mail SDL requests and requires that you delete it without acting upon or copying any of its contents, and we further request that you advise us. SDL PLC is a public limited company registered in England and Wales. Registered number: 02675207. Registered address: Globe House, Clivemont Road, Maidenhead, Berkshire SL6 7DY, UK. ---------------------------------------------------------------------------- -- 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 WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ 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 WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users