In MSIX Hero 0.3.0.0 a new feature has been added. For any MSIX package, it is now possible to create a VHD image and scripts for staging, registering, unregistering and unstaging. This is a foundation for a new cool concept, named MSIX app attach (casing sic!).
MSIX is just a modern Windows app package format. MSIX app attach on the other hand takes the packages in this new format, and dynamically attaches them to Windows Virtual Desktop Session. Since the attached packages are expanded on read-only virtual disks, attaching and using an app is really fast and unnoticable to the user. And yet it still provides all benefits of maintaining minimal number of images, which are dynamically enhanced by the apps the user needs and can access. This all is possible without installing anything, with just only a minimal registration step that takes place. MSIX app attach is still in preview and will be available in upcoming version of Windows 10.
Now back to MSIX Hero. The new version has an ability to create attachable VHD disks + necessary scripts to test app attach out. This just eliminates a few manual steps that the user otherwise must do before getting any app attached. The automation built into the tool closely follows the steps from the following website:
https://docs.microsoft.com/en-us/azure/virtual-desktop/app-attach
Here is a UI for it. The dialog can be found in the GENERATE section > Generate VHD for app attach… accessible from the main ribbon.
Update: In version 0.3.4.0 the ribbon has been changed. The button is now in the EDIT > MSIX app attach VHD generator
The options are really minimalistic and self-explaning, but one or two things are interesting enough that they require a few extra words and comments.
Prerequisites
To use this function, you must start or self-elevate MSIX Hero as administrator. Additionally, currently the function to create VHD has a dependency on PowerShell HyperV module, so you must also have Hyper-V feature installed (to verify check the result of Get-Command New-VHD
in your PowerShell session).
Selecting the maximum VHD size
There are two options. If you let MSIX Hero select a size for you, it will automatically check how big the uncompressed files are, add an extra buffer for safety (currently double the original size) and round it to next 10MB. So for the package of 15MB size (compressed) and 27 MB after extraction, MSIX Hero will use a dynamic container with maximum limit of 60MB. Since a dynamic container is used, the actual size will be lower.
If you select the maximum size on your own, the value will be used as-is. In this case make sure that the whole uncompressed package content fits into this new size, otherwise the following may be shown:
Generating the scripts
This page https://docs.microsoft.com/en-us/azure/virtual-desktop/app-attach contains four PowerShell scripts with placeholders to replace. The scripts can be used to test attaching of apps. MSIX Hero uses these scripts in unchanged form, and upon creation of VHD reads necessary details (like disk identifier, folder names etc.) and puts them in the right place. The only thing to be adjusted is a UNC path informing the target OS where the actual image is stored. This must be changed manually in a folder with the same name as your VHD + suffix “.Scripts”:
If you disable the checkbox, the scripts will not be created, and it is completely up to you how you stage and register the app. Once app attach is officially available, there will be most-likely a better way of managing this, right now it is still for an early testing and preview.
After the VHD and scripts are created, you can follow the instructions from MSDN (see links a few paragraphs lower) which explain when and how to call them to get app attach up and running.
Permissions
In order to create VHD and expand MSIX package to it, you must be a local administrator. MSIX Hero will self elevate if not started as administrator. There is also a small visual change in version 0.3.0.0 – the buttons in dialogs like app attach generator have a shield icon, to signal that the function will be executed with administrative privilleges:
MSIX Hero can be downloaded from a dedicated place: https://msixhero.net. This app is still in an early phase of development, but why not to give it a try :)?
More information about MSIX app attach: