There is a tool out there called "depends.exe" that does this *and* provides a 
spiffy tree that shows all the dependencies your code has.  I use this tool 
*all the time* to figure out how "heavy" a piece of code is.  Fewer 
dependencies the better.

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of LEMIRE, JOHN
Sent: Friday, April 27, 2007 9:44 AM
To: WiX-users@lists.sourceforge.net
Subject: Re: [WiX-users] Logging in a custom action

I've lost track of what your CA actually does (if it was ever mentioned) but 
have you tried using a dummy exe shell and having it do a load lib / 
getprocaddress on your CA?
This may be a way to find a dependency problem on that box.
I once ran into one trying to use a winsock api on a W2K box. WS2_32.dll was 
there but the older version didn't support the method I was using.. 
(::GetAddrInfo I think)


________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rob Mensching
Sent: Friday, April 27, 2007 9:18 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; WiX-users@lists.sourceforge.net
Subject: Re: [WiX-users] Logging in a custom action

You may have other problems (like dependencies that aren't being met thus your 
code is immediately failing) but assuming that your code is running correctly, 
you're not going to see any messages.  Why?  Your answer to my last question.

::MsiProcessMessage() will not work from a UI "DoAction".  Windows Installer 
restriction.

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, April 27, 2007 6:52 AM
To: Rob Mensching; [EMAIL PROTECTED]; WiX-users@lists.sourceforge.net
Subject: RE: [WiX-users] Logging in a custom action

I'll try to answer your questions, but this is my first experience doing any 
sort of work in Visual Studio, so I'm largely unfamiliar.  I'm also using 2003, 
which seems that is partially contributing to my problems.

Basically the installer seemed to be working, except on one particular vista 64 
machine where it looks like it is failing in a particular CA.
At that point I decided I needed to find out how to do some logging from within 
the Custom Action so I could diagnose the problem beyond 'returned status 3.'


That leads me to believe that any dependency that might not be met was 
introduced when I included wcautil.lib and dutil.lib.
In order to get this to compile, I also had to build without /clr.  Not 
something I'm familiar with, but I'm aware of the managed code is bad in CAs 
mantra, so that sounded reasonable.

Are you dynamically linking against MSVCRT?
I'm not sure... how might I find out?

It is possible your CustomAction has some dependency and failing to load right 
off the bat.
Would it be that the DLL itself has a dependency ( as opposed to the CA) 
because that could be the case.
>From trying to isolate the problem, the CA itself currently has nothing but 
>"return ERROR_SUCCES" and it still dies.

            Also, can you share the .wxs authoring for the CustomAction
Is this what you mean?
<CustomAction Id='VerifyLicenseDir' BinaryKey='LicenseFileUtils' 
DllEntry='VerifyLicenseDir' />

            When is it being scheduled?
It is run when the user clicks the next button in a custom dialog.
________________________________
From: Rob Mensching [mailto:[EMAIL PROTECTED]
Sent: Friday, April 27, 2007 12:29 AM
To: Rowland, Chris; [EMAIL PROTECTED]; WiX-users@lists.sourceforge.net
Subject: RE: [WiX-users] Logging in a custom action

Are you dynamically linking against MSVCRT?  More specifically, what are the 
dependencies your CustomAction has on the OS and are they all met?  It is 
possible your CustomAction has some dependency and failing to load right off 
the bat.  Also, can you share the .wxs authoring for the CustomAction.  When is 
it being scheduled?

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Thursday, April 26, 2007 2:20 PM
To: [EMAIL PROTECTED]; WiX-users@lists.sourceforge.net
Subject: Re: [WiX-users] Logging in a custom action

Yeah, the error was in the custom action. (It returned the value 3)

I had tried to attach to msiexec.exe before to debug, but didn't make any 
progress with that.

Can you show me how you fired off the MessageBox from within your CA?


This is a lot of debugging just so I can debug :)
________________________________
From: Brian Simoneau [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 26, 2007 4:57 PM
To: Rowland, Chris; WiX-users@lists.sourceforge.net
Subject: RE: [WiX-users] Logging in a custom action

Was the error in the custom action itself?  If so, then you can always try to 
debug the custom action in Visual Studio.  I was able to do this by adding a 
MessageBox to the beginning of the custom action and then attaching to the 
MessageBox when the custom action was run.  If the error was when launching the 
custom action, there may be a missing dependency.

-Brian Simoneau
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 26, 2007 4:51 PM
To: Brian Simoneau; WiX-users@lists.sourceforge.net
Subject: RE: [WiX-users] Logging in a custom action
After an obscene amount of headbanging, I finally managed to get it to build 
(with warnings) with the almighty T() call.

Unfortunately that resulted in a CA that caused the installer to quit due to an 
error.  If only I could log what was going on ><

Assuming the lack of wrapping my strings was not the issue, is there anything 
else (no matter how obvious, cause it might not be obvious to me) that I might 
be doing wrong?

________________________________
From: Brian Simoneau [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 26, 2007 3:18 PM
To: Rowland, Chris; WiX-users@lists.sourceforge.net
Subject: RE: [WiX-users] Logging in a custom action

_T is a macro defined in tchar.h.  I believe this was included in earlier 
Visual Studios because my custom actions were originally written in VS2003.  It 
looks like __out and others are defined in sal.h.

-Brian Simoneau
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 26, 2007 3:05 PM
To: Brian Simoneau; WiX-users@lists.sourceforge.net
Subject: RE: [WiX-users] Logging in a custom action
It's an immediate CA.  I tried wrapping my strings with _T() but _T is not 
defined. Another VS05 difference?

Could my definitions be causing a problem? I more or less copied them from a 
forum post I saw regarding a similar problem.

#define __out /* ? */
#define __in /* ? */
#define __inout /* ? */
#define __in_bcount(THING) /* ? */

________________________________
From: Brian Simoneau [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 26, 2007 2:59 PM
To: Rowland, Chris; WiX-users@lists.sourceforge.net
Subject: RE: [WiX-users] Logging in a custom action

That code looks the same as what I am using except that I have _T() around my 
strings.  Are you running your custom action immediate or deferred?

-Brian Simoneau
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 26, 2007 2:31 PM
To: Brian Simoneau; WiX-users@lists.sourceforge.net
Subject: RE: [WiX-users] Logging in a custom action
Thanks for the continuing advice.  I'm still not seeing any log out put though. 
 I've commented out the guts of my CA, so now I have just:

extern "C" UINT __stdcall VerifyLicenseDir(MSIHANDLE hInstall)
{
      WcaInitialize(hInstall, "VerifyLicenseDir");
      WcaLog(LOGMSG_STANDARD, "Enter VerifyLicenseDir");
      return WcaFinalize(ERROR_SUCCESS);
}

MSI (c) (04:F4) [14:19:38:375]: Doing action: VerifyLicenseDir
MSI (c) (04:F4) [14:19:38:375]: Note: 1: 2205 2:  3: ActionText
Action 14:19:38: VerifyLicenseDir.
Action start 14:19:38: VerifyLicenseDir.
MSI (c) (04:C8) [14:19:38:390]: Invoking remote custom action. DLL: C:\... 
Entrypoint: VerifyLicenseDir
MSI (c) (04:C0) [14:19:38:390]: Cloaking enabled.
MSI (c) (04:C0) [14:19:38:390]: Attempting to enable all disabled priveleges 
before calling Install on Server
MSI (c) (04:C0) [14:19:38:390]: Connected to service for CA interface.
Action ended 14:19:38: VerifyLicenseDir. Return value 1.

Did I feed WcaInitialize a bad 2nd argument? I was guessing it was just going 
to be used as an identifier in the log output.
Do I need to call WcaGlobalInitialize/WcaGlobalFinalize in some way as well?

Thanks again for your help.  Google doesn't reveal much on this subject :(

________________________________
From: Brian Simoneau [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 26, 2007 1:58 PM
To: Rowland, Chris; WiX-users@lists.sourceforge.net
Subject: RE: [WiX-users] Logging in a custom action

You have to call WcaInitialize in your method before you can call WcaLog.  You 
also need to call WcaFinalize before you exit the method.  So your last line 
could look something like:
return WcaFinalize(ERROR_SUCCESS);

-Brian Simonea

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to