0

In our environment, we have Windows 8.1 Enterprise domain joined computers that are typically never on a company network. We use Microsoft Intune to remotely manage the laptops. We also use Intune to push new programs to the laptops. This work perfect when the programs can be installed via an MSI installer.

However, we created an in-house Windows 8.1 app which creates an APPX package. Pushing / deploying the APPX package as a sideload app has proven to be extremely difficult. In fact, according to feedback of the Intune team (here) it is in fact NOT possible to do it...

Robbie
  • 163
  • 5

1 Answers1

0

As a workaround, we've work on a solution inspired by this blog to sideload the appx package using an MSI installer using WIX toolset.

We want to shared the WIX code to generate an MSI installer. This MSI installer can be used to deploy the appx on the desired target machine, e.g., using Intune.

The MSI will first copy the appx and dependencies to a ProgramFilesFolder subfolder and next execute the dism.exe /online /Add-ProvisionedAppxPackage command to sideload the app. Note: the target machine must be able to sideload apps (this is a good starting point for more details).

The code can be further improved to handle x64 dependencies and clean up of the appx during uninstall.

The WIX XML

<?xml version="1.0" encoding="UTF-8"?>
<!-- Versioning -->
<?define InstallerProductVersion = "1.0.0.0" ?>

<!-- Product info -->
<?define AppxPackageName = "YOURAPPNAME.appx" ?>
<?define ProductName = "Title of the app" ?>
<?define ProductManufacturer = "YOUR COMPANY NAME" ?>
<?define UpdateCode = "A GUID" ?> <!-- keep this for version updates -->

<!-- Install settings-->
<?define InstallFolderName = "Folder for installation files" ?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="$(var.ProductName)" Language="1033" Version="$(var.InstallerProductVersion)" 
        Manufacturer="$(var.ProductManufacturer)" ="$(var.UpdateCode)">
<Package InstallerVersion="500" Compressed="yes" Comments="your comment" Manufacturer="$(var.ProductManufacturer)"
         Description="Installer for $(var.ProductName)" Languages="1033" SummaryCodepage="1252" />

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />

<!-- the icon -->
<Icon Id="icon.ico" SourceFile=".\yourIco.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<Property Id='ARPCONTACT'>info@yourcompany.com</Property>
<Property Id='ARPHELPLINK'>www.yourcompany.com</Property>

<!-- the media -->  
<MediaTemplate EmbedCab="yes" />

<Feature Id="ProductFeature" Title="SideloadWithWiXSetup" Level="1">
  <ComponentGroupRef Id="ComponentGroup.App" />
  <ComponentGroupRef Id="ComponentGroup.Dependencies" />
</Feature>
<UIRef Id="WixUI_Minimal" />
<WixVariable Id="WixUILicenseRtf" Value="end user licence agreement.rtf" />

<CustomAction Id="DISMInstallAppx" Directory="INSTALLFOLDER" Execute="commit" Impersonate="no" ExeCommand="dism.exe /online /Add-ProvisionedAppxPackage /PackagePath:&quot;$(var.AppxPackageName)&quot; /SkipLicense" Return="check" />

<InstallExecuteSequence>
  <Custom Action="DISMInstallAppx" After="InstallFiles" >(NOT Installed) OR WIX_UPGRADE_DETECTED OR REPAIR</Custom>
</InstallExecuteSequence>
</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="INSTALLFOLDER" Name="$(var.InstallFolderName)">
        <Directory Id="DEPENDENCIES" Name="Dependencies">
            <Directory Id="DEPENDENCIESx86" Name="x86" />
        </Directory>
    </Directory>
  </Directory>
</Directory>
</Fragment>

<Fragment>
<!-- ComponentGroup.App  -->
<ComponentGroup Id="ComponentGroup.App" Directory="INSTALLFOLDER">
  <!-- Program components -->
  <Component Id="Component.AppxPackage" >
    <File Id="File.AppxPackage" Source="$(var.AppxPackageName)" KeyPath="yes" Checksum="yes" />
  </Component>
</ComponentGroup>
<ComponentGroup Id="ComponentGroup.Dependencies" Directory="DEPENDENCIESx86">
    <Component Id="Dependencies.VCLib">
        <File Id="File.VCLib" Source="Dependencies\x86\Microsoft.VCLibs.x86.12.00.appx" KeyPath="yes" Checksum="yes" />
    </Component>
</ComponentGroup>
</Fragment>
</Wix>
Robbie
  • 163
  • 5