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

Reply via email to