Is there a good way to convert an application that relies on a PowerShell script to install and perform pre- and post-installation tasks into an MSiX package?
I'm trying to get this working, and I'm pulling my hair out.
Any documentation or suggested methods on how this works? I've obtained a license for Flexera due to the power it has in packaging, but I've yet to get a stable MSiX package to work.
I've tried creating an MSI, but it keeps erroring out with FILE NOT FOUND errors during the build when I thought I put in a custom action to run the PowerShell script at the right moment in the execution.
I've tried building the package straight off of the PS1 file, but that was a can of errors and nothing more.
There's got to be an easier way to move from PowerShell to MSiX with fully-automated installation complete with pre-/post-installation tasks.
As you can tell I'm not a packaging expert, but trying to learn as I go. Any insight from professionals would be helpful.
May 24, 2021 09:23 PM
Hi @MoSpartan -
There is not a direct installer-using-PowerShell to MSIX conversion process. Whatever the installation technology used, you need to first capture the end result of what that application's installer is doing to the machine. From here, you can create a new MSIX package that can replicate that end result.
As Microsoft details in their overview for MSIX , applications packaged in MSIX run in app containers, which separate it's file system, registry, etc. off from other applications. As a result, the configuration of an application as an MSIX container will be different than traditionally installed software.
AdminStudio can first capture the existing installer, watching and logging where all the files, registry keys, INI file changes, shortcuts, etc. are added to the capture machine using the Repackager. You can review this capture, exclude anything that you no longer need (e.g. the legacy installer's uninstaller), and build that into an MSI package. You can then convert that directly into an MSIX package if you don't need further customizations and changes, or first make those changes in the included InstallShield Editor. You can also make changes to the MSIX package itself after its created using the included MSIX Editor.
Custom actions are not supported in MSIX itself and causes issue with the direct conversion from MSI to MSIX because the converter doesn't execute those actions. In this case, don't include the PowerShell script as a custom action in the MSI itself and then attempt to convert that MSI to MSIX. Rather, the PowerShell script should be run as part of the initial installer and captured as part of the overall installation using the Repackager initial capture time. The result of that capture, encapsulating what the PowerShell script's output actions along with the rest of that installer, is then included and built into a "pure" MSI without custom actions, allowing you to then converted it directly into MSIX. This applies to (many) vendor MSIs that utilize custom actions over performing work using the standard actions that MSI supports directly; repackage these first into a pure MSI before converting to MSIX.
Hope this guidance helps!
(Note: all links to product documentation point to the current release at the time of this posting)
May 25, 2021 02:30 PM
Thanks for the help!!
This did help me out a lot in understanding. However, what if no entry points are found after installation?
Another frequent problem I run into is an issue with the package completing, but then when I click on it to "install" it the Windows App Installer window gives me an error saying "Error parsing package" rather than displaying a description of the package.
Does Flexera provide any good training material on how to put together MSiX packages? I am admittedly "flying a bit blind" here as I'm learning as I go. I've packaged Win32 apps onto Intune and SCCM quite frequently, but MSiX is new to me and I've had to dive in head-first.
Jun 01, 2021 09:08 AM