[wix-users] C++ custom action, Visual Studio 2015, Windows XP/Windows Server 2003

Ivanoff, Alex Alex.Ivanoff at shavlik.com
Fri Dec 11 09:58:04 PST 2015


Ok, I will be more specific. We have an installer that has quite a few C++ custom actions, statically linked to C runtime, of course. Initially it was built with VC++ 2010, and then upgraded to 2012 and now 2013. A few days ago we upgraded it to VC++ 2015 and some of the custom actions started failing with "Return value 3".

Our custom actions look like this:

auto hr = ::WcaInitialize(msiHandle, "ActionName");
if (FAILED(hr))
{
  return hr;
}

<do work>
If (<any errors>)
{
  return ::WcaFinalize(<error>);
}	

return ::WcaFinalize(ERROR_SUCCESS);



-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Mihajlo Cvetanovic
Sent: Friday, December 11, 2015 05:27
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] C++ custom action, Visual Studio 2015, Windows XP/Windows Server 2003

The system may be missing appropriate libraries. It's best to build your custom action library statically linked to CRT: Project properties > C/C++
> Code generation > Runtime library > Multi-threaded (/MT). Also, 
> because
C++ decorates function names you must explicitly undecorate them, so 
C++ that
MSI engine can call the functions. I declare them as extern "C" and list them in the .def file that is set in your project: Project properties > Linker > Module Definition File. Other two undecoration options are described here: http://stackoverflow.com/q/2133583

On Fri, Dec 11, 2015 at 6:50 AM, Ivanoff, Alex <Alex.Ivanoff at shavlik.com>
wrote:

> Are there any known issues with C++ custom action built with VS 2015 
> to run on Windows XP/Windows Server 2003?
>
> Thank you,
> Alex Ivanoff
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant 
> http://www.firegiant.com/
>

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



More information about the wix-users mailing list