Custom Actions in CUB files are supposed to be immediate custom actions. Please read MSDN. Use MsiProcessMessage.
-----Original Message----- From: nagaram.c [mailto:nagara...@symphony.cc] Sent: Thursday, December 31, 2009 3:33 AM To: 'Schrieken, Rene'; 'General discussion for Windows Installer XML toolset.' Subject: Re: [WiX-users] writing to console from smoke.exe using customaction With the below code WriteFile is returning false, GetLastError shows Handle is invalid Nag _____ From: Schrieken, Rene [mailto:rene.schrie...@logica.com] Sent: Tuesday, December 29, 2009 11:41 AM To: General discussion for Windows Installer XML toolset. Cc: nagara...@symphony.cc Subject: RE: [WiX-users] writing to console from smoke.exe using customaction Looking at your code and reading msdn WriteConsole(szBuffer); might fail. Something with ansi and widechar but this is really not my area of expertise. Can you try to see if this might work: (everybody else: HELP!) AttachConsole(...); HANDLE file; file = GetStdHandle(STD_OUTPUT_HANDLE); // check if you have something valid // you might need an if for non-redirected output? BOOL ok; ok = WriteFile(file, szBuffer, somesafelenfunc(szBuffer), &written, NULL); // check if true is returned FreeConsole(...); Please save everything before you try this... _____ Van: nagaram.c [mailto:nagara...@symphony.cc] Verzonden: di 29-12-2009 8:04 Aan: Schrieken, Rene; 'General discussion for Windows Installer XML toolset.'; 'General discussion for Windows Installer XML toolset.' Onderwerp: Re: [WiX-users] writing to console from smoke.exe using customaction Thanks for that, but it is only writing to file what ever is displayed in the command window through other ICE(s) (ICE1 - 1CE100) performed by darice.cub, but not those of my CA even through it can display in the command window Nag _____ From: Schrieken, Rene [mailto:rene.schrie...@logica.com] Sent: Thursday, December 24, 2009 10:46 AM To: nagara...@symphony.cc; General discussion for Windows Installer XML toolset.; General discussion for Windows Installer XML toolset. Subject: RE: [WiX-users] writing to console from smoke.exe using customaction smoke.exe - cub myCub.cub myMSI.msi >> smoke.log (use two >> to redirect output, that will open the file for append, instead of create) _____ Van: nagaram.c [mailto:nagara...@symphony.cc] Verzonden: do 24-12-2009 6:46 Aan: 'General discussion for Windows Installer XML toolset.'; 'Blair' Onderwerp: Re: [WiX-users] writing to console from smoke.exe using customaction I found a solution, the custom action DLL isn't writing to console unless I call AttachConsole as like below cpid = GetCurrentProcessId(); hWnd = FindWindowEx(NULL, NULL, _T("ConsoleWindowClass"), NULL); //this need not be the same console where the process is running at //need to fetch parent process id & check if they are same GetWindowThreadProcessId(hWnd, & ppid); cppid = GetParentPID(cpid); //user defined function to get the parent id if(cppid == ppid) //then this is the same console what we are looking for { AttachConsole(cppid); WriteConsole(szBuffer); FreeConsole(); } else { //continue with FindWindow till the right parent is identified } Also smoke isn't calling CA directly instead its validation engine invokes these CA through msiexec process, so GetParentPID has to get its 2 parents for to cmd.exe PID Now I need to redirect validation errors that are displayed in console to log file I know this could be done by using something like smoke.exe - cub myCub.cub myMSI.msi > smoke.log but every time I run the smoke the log file gets overwritten, is there a way that I can append to the existing log file. If I do create my own logging in the CA then this log contains only those logs generated by my CA which in case the other validations of ICEs (1-100) done by darice.cub will not be listed into my log file, so this is not the efficient solution. It would be much efficient if the log file generated by > switch in the command line could get appended every time the program is executed Nag -----Original Message----- From: nagaram.c [mailto:nagara...@symphony.cc] Sent: Tuesday, December 22, 2009 11:54 PM To: 'Blair'; 'General discussion for Windows Installer XML toolset.' Subject: Re: [WiX-users] writing to console from smoke.exe using customaction I already tried below solution but is not writing to console, I think MsiProcessMessage works only if the custom action is run through msiexec or if the CA is immediate mode, but where as I am running these CA through smoke utility & for the CA to be made immediate I will have to create the CA from using installer project work space. In some of samples I have seen it uses OutputDebugString for writing it to the console Naga Ram M Chavakula | Project Manager O: 608.448.3116 |M: 0091.9885778079 | nagara...@symphony.cc Symphony Corporation | Hyderabad, A.P.India-500 082 | A SEI-CMMI Level 4 Company We synchronize business, technology and people -----Original Message----- From: Blair [mailto:os...@live.com] Sent: Tuesday, December 22, 2009 7:35 AM To: nagara...@symphony.cc; 'General discussion for Windows Installer XML toolset.' Subject: RE: [WiX-users] writing to console from smoke.exe using custom action You need to use MsiProcessMessage with the INSTALLMESSAGE_USER type. See http://msdn.microsoft.com/library/aa369205.aspx for details. -----Original Message----- From: nagaram.c [mailto:nagara...@symphony.cc] Sent: Tuesday, December 22, 2009 5:13 AM To: wix-users@lists.sourceforge.net Subject: [WiX-users] writing to console from smoke.exe using custom action Hi, I wrote a custom action dll in C++ & added to .cub file that I am using in -cub switch in smoke.exe, I was not successful in writing to console like the ICE(s) in darice.cub does it but I am able to display the log info in MessageBox. Thanks, Nag ---------------------------------------------------------------------------- -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ---------------------------------------------------------------------------- -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ---------------------------------------------------------------------------- -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users Please help Logica to respect the environment by not printing this email / Pour contribuer comme Logica au respect de l'environnement, merci de ne pas imprimer ce mail / Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica dabei, die Umwelt zu schützen. / Por favor ajude a Logica a respeitar o ambiente nao imprimindo este correio electronico. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. Please help Logica to respect the environment by not printing this email / Pour contribuer comme Logica au respect de l'environnement, merci de ne pas imprimer ce mail / Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica dabei, die Umwelt zu schützen. / Por favor ajude a Logica a respeitar o ambiente não imprimindo este correio electrónico. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. ---------------------------------------------------------------------------- -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users