0

My end goal is to be able to run a Powershell install script in a VM and capture all the changes it makes into a MSIX package. I can do this manually without issue using the MSIX Packaging Tool wizard, but I have a lot of apps to package and some of them update frequently, so I would like to get something automated going.

I have tried using the batch conversion script with the following settings in entry.ps1:

$virtualMachines = @(
    @{ Name = "MSIX Packaging Tool Environment"; Credential = $credential }
)

$remoteMachines = @(
)

$conversionsParameters = @(
    @{
        InstallerPath = "Cricut Design Space.msi";
        PackageName = "CricutDesignSpace";
        PackageDisplayName = "Cricut Design Space";
        PublisherName = "CN=Cricut";
        PublisherDisplayName = "Cricut";
    }
)

Which just tells me all jobs have finished and produces no MSIX files.

I have also tried manually creating this template:

<MsixPackagingToolTemplate
  xmlns="http://schemas.microsoft.com/appx/msixpackagingtool/template/2018"
  xmlns:mptv2="http://schemas.microsoft.com/msix/msixpackagingtool/template/1904">
<Installer
  Path="L:\Work\scratch\batch-msix-builder\Cricut Design Space.msi"
  Arguments="" />
<VirtualMachine Name="MSIX Packaging Tool Environment" Username="user" />
<SaveLocation PackagePath="L:\Work\scratch\batch-msix-builder" />
<PackageInformation
  PackageName="CricutDesignSpace"
  PackageDisplayName="CricutDesignSpace"
  PublisherName="CN=Cricut"
  PublisherDisplayName="Cricut"
  Version="5.9.8.0" />
</PackageInformation>
</MsixPackagingToolTemplate>

and running it with

MsixPackagingTool.exe create-package --template "L:\Work\scratch\batch-msix-builder\template.xml" --virtualMachinePassword "REDACTED"

This causes a console window to open for a fraction of a second and immediately close. I have even tried this on a fresh install of windows to see if it was something with my computer.

9072997
  • 171
  • 1
  • 11

2 Answers2

1

I have been working on this for more than a day, and of course as soon as I post online I discovered what was going wrong.

The main issue was MsixPackagingTool.exe doesn't seem to work when I let it prompt for elevation as opposed to explicitly running it from an administrative PowerShell window. Additionally I had some malformed XML. Once I started running from an elevated command prompt I was able to actually see the errors output by MsixPackagingTool.exe.

9072997
  • 171
  • 1
  • 11
0

Not an answer (can't comment as I'm not that much a member here) but as a remark, this link might help interested parties e.g. at the template creation starts

How to generate a template file for command line conversions - MSIX | Microsoft Docs

(Somewhere along the quoted lines at the very end as suggested by @djdomi.)

For those assessing possible complications related to MSIX-ification, making the package a startup-capable task might be involving.


With the MSIX Packaging Tool, you can perform the conversion in two ways: through the interactive UI or through our command line option. When using the command line, you need to provide a template file so that the conversion works with your specific settings and needs. This article will help guide you through the process of generating a template file that works for you.

There are two ways that you can get a template file that works for you:

  • You can use the UI of the MSIX Packaging Tool. In the settings of the tool, you can specify that you want to generate a conversion template file with each MSIX package that you create.
  • You can take a sample template and manually enter the configurations that you need for each conversion.

Generate a conversion template file from the MSIX Packaging Tool

  1. Launch the MSIX Packaging Tool.
brezniczky
  • 101
  • 1
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/502130) – djdomi Nov 07 '21 at 11:32
  • I wouldn't like to publish my opinion about MSIX/Partner Center at the minute but believe me I have already invested more time on it than it deserves as far as I could see it. Anyway, your suggestion in general is realistic/good and as an appreciation I added some bits so that it can be more easily searched back etc. – brezniczky Nov 07 '21 at 12:36