[wix-users] Debug custom action in VS2017

Blair Murri osito at live.com
Fri Jan 25 10:22:16 PST 2019


Your debugger must be running elevated (as an administrator).

Using MessageBox doesn't always work (especially when debugging deferred CAs that don't "run as user". MSFT provides instructions, but the environment variables involved need to be set per-machine and it's recommended to reboot after setting them to ensure that they will be found by all the system services that need to see them

Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of Lmloge via wix-users <wix-users at lists.wixtoolset.org>
Sent: Friday, January 25, 2019 2:19:24 AM
To: wix-users at lists.wixtoolset.org
Cc: Lmloge
Subject: [wix-users] Debug custom action in VS2017

Hello,

After building a setup file
and while trying to install an application by running this setup file
something wrong is happening while executing a custom action.

To find out what's going wrong, I need to debug the code which is C/C++
code in Microsoft Visual Studio 2017.

To do that, I've put a "MessageBox()" function call in the custom action
code:
MessageBox(NULL, L"*** (Custom action) Please attach a debugger. ***",
L"(Custom action) Debug", MB_OK);

When I start the installation, the message box pops up.

In Visual Studio 2017, I select the menu "Debug -> Attach to process...".
I select the entry in the "Available processes" list :
------------+-----+--------------------------+------+-----------------------+-----------
Process     | ... | Title                    | Type | User
name             | Session
------------+-----+--------------------------+------+-----------------------+-----------
msiexec.exe | ... | (Custom action) Debug    | x86  |
<hostname>\<username> | 9
------------+-----+--------------------------+------+-----------------------+-----------
and click "Attach".
<hostname> is my machine name.
<username> is my system user name.

I get the error message:
"Unable to attach to process. Access is denied."

I have tried to make it work with no success.

Can you advise me what to do to be able to debug my custom action code?

Thank you.
Best regards.


____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/



More information about the wix-users mailing list