Search code examples
wixwindows-installerheatintune

WiX/MSI: could not deploy files harvested by heat tool when using MS Intune


I've got a 32b MSI installer developed on 64b machine using WiX toolset (3.10). It has been tested on both 32b and 64b platforms with different Windows (7, 8.1, 10) and it works without any issues.

The problem starts when I've tried to install my MSI via Microsoft Intune. (It works well with other tools for mass deployment) While performing the fresh install, user is prompted to insert MSI file (after it is selected, the installation goes smoothly but that is not the purpose of mass deployment).

I've observed that the problem is not occurring when I remove from MSI files that are harvested using heat tool. The command is (passed via Visual Studio):

"$(WIX)\bin\heat.exe" dir "C:\SOURCE_PATH" -ke -scom -frag -srd -ag 
  -var var.Resources -cg ResourcesGroupId -dr INSTALLDIR_RES 
  -out "$(ProjectDir)Source\Fragments\HarvestedResources.wxs"

This component group is added to main Feature containing all other components.

The destination directory is created as:

<DirectoryRef Id='INSTALLDIR_RES'>
  <Component Id='cmp_ResDiR' Guid='{SOME_GUID}'>
    <CreateFolder />
    <RemoveFolder Id='INSTALLDIR_RES' On='uninstall' />
  </Component>
</DirectoryRef>

INSTALLDIR_RES is a sibling path located under INSTALLDIR. Logs are showing that ComponentRegistry is done with exit code 1 (success).

Install scope is per-machine, elevated installation is enabled. All properties used during install are marked as:

secure="yes" admin="yes"

And visible under AdminProperties and SecureCustomProperties (checked via Orca). I don't use any CustomAction to deploy this resources, though.

How can Intune affect my MSI? What am I missing?


Solution

  • The problem was only partially related to MS Intune and absolutely not related to heat.exe and harvesting files. It turned out that there were two issues:

    1. MSI was deployed using MS Intune but without providing the original MSI to the users. During installation the MSI has been copied to the temp directory and removed after app has been installed. It would be ok, although access to original MSI is helpful in case of self-repair, which leads to second issue:
    2. On some machines, during initial run, the MSI was launching the self-repair procedure. As the original MSI wasn't available on hard disk, the user was prompted for selecting the MSI manually as described in first post. Thanks to the great description of self-healing issues in MSI by Stein Åsmul I was able to detect the root cause (advertised shortcut to main executable with regEntry in user specific path) and fix it.

    As a summary: MS Intune doesn't affect deploying files harvested by heat.exe.