Wix: "Found mismatched entry point <Product> for specified output package type .exe"

Viewed 45

I'm creating a Wix installer and in its properties I set the Output type to "Windows Installer Package (.msi)"

When I do that, the package builds without any problems or warnings. But the package needs to execute a Custom Action after installation, and that needs to run with elevated privileges.

So I decide to change the installer to an Executable. In the Installer tab I change the Output type to "Executable Package (.exe)"

When I build it then, a warning is raised: "Found mismatched entry point . Expected for specified output package type .exe. [name here] [path here]\obj\x64\Debug\Product.wixobj 0 "

Okay but.... "Product.wixobj" is not one of my source files; it is generated during the build.

So what do I need to change, and where, in my source files (the .wxs file, perhaps?) to stop it generating a .wixobj file that then leads to this warning?

Let me apologise straight off the bat here: I don't really know or understand what information you might need to answer this question, so if you need anything, please ask and I will be happy to provide. What I can tell you is that in the .wxs file I set InstallerVersion to 500, InstallScope to perMachine and the Platform to x64.

1 Answers

If you want an exe installer you would have to create a WIX setup bundle and call your msi there. But you can also run an elevated custom action from your msi.

// State that your msi needs to be run elevated.
<Package ... InstallPrivileges="elevated"/>   

// Pass properties to the elevated CA. Property and Id of the elevated CA must match. Can be accessed via CA methods session.CustomActionData dictionary.
<CustomAction Id='ElevatedCA.SetCustomActionData' Property='ElevatedCA' Value='CAPROPERTY=[MSIPROPERTY];'/>
// Define an async deferred custom action
<CustomAction Id='ElevatedCA' BinaryKey='CustomActionsDll' DllEntry='DoMyElevatedStuffMethod'  Return='asyncNoWait'  Impersonate='no' Execute='deferred'/>

// Schedule your custom action
<InstallExecuteSequence>
     <Custom Action='ElevatedCA.SetCustomActionData' Before='ElevatedCA'/>
     <Custom Action='ElevatedCA' After='InstallFinalize'/>
</InstallExecuteSequence>
Related