Forum Discussion
Single MSIX Package for Different Environments
Yes, this can be done in MSIX, just differently.
I assume from the example that you used 4 different shortcuts calling the script with the different cmd line arguments.
This directly maps in MSIX, however Microsoft tooling will not do it right and you must do a bit of manual editing, especially if you want to future-proof the package name. TMEditX would probably fix that for you automatically. Similarly, since you also tagged Bogdan, AdvancedInstaller can probably help you too.
We also often do something similar using a single shortcut to the program. But use PsfLauncher to run a single script, with arguments for the package root folder ( offset to get the source file) and WritablepackageRoot folder (offset to get destination). Probably need the MfrFixup of the PSF too. Your script can still be on a network share, but needs to be Powershell. The PS script needs to dynamically decide what environment the user is in, replacing your if on the shortcut argument value.
- Abhi211Copper ContributorThank you for your response. Will try and let you know if it works for us.
- Ferry_van_GelderenCopper ContributorIf you are looking for another approach to find a solution for this problem, please take a look at the MSIX Helper.
https://github.com/FvGelderen/AutoHotKey/tree/MSIX-Helper/MSIX%20Helper%201.2
I just released version 1.2 and this will also support if/else statements for the script sections. The documentation (pdf) can be found in the bin folder with the MSIX Helper executables (32 and 64-bit).
Any feedback is appreciated.
- Abhi211Copper Contributor
Can you please provide the steps to apply the mfr fixup?
Abhi211 The request sounds more complicated than can be explained here, but I can provide an overview of your options.
One way is to use the free PsfTooling during the packaging process. While in the installation phase of the Microsoft MSIX Packaging Tool you would install the program and copy down any scripts, and then launch PsfTooling. The GUI provides the ability to define the script to be run, including any arguments. Check PSFLauncher documentationHome ยท TimMangan/MSIX-PackageSupportFramework Wiki (github.com) for variables to use in the arguments that evaluate to the Package Folder and Redirected Package Folder that you'll probably need. In the GUI you'd just click the checkbox to add in the MfrFixup while there. There is some text that will be displayed when you add the MfrFixup in ILV-aware more that must be copied to your clipboard. After you close PsfTooling and return to the Microsoft packager, you complete the packaging process short of saving the package. You must then export and edit the AppXManifest file to copy that text into the manifest as shown in the XML comments that you copied.
Alternatively, TMEditX (a licensed tool) can be used to perform these actions on a post-packaging editing session. The GUIs for the two are very similar for defining the script and enabling MFrFixup, but TMEditX will fix up the AppXManifest for you automatically.