See the Microsoft TechCommunity Windows Dev AppConsult blog post here for more information:
ScriptInPackage\CreateShortcuts.ps1
- First time run script that creates desktop icons for application.
CreateManifestAndConfigForPSF.ps1
- 'Prep script'. Creates a new AppxManifest file based on the existing manifest, config.json for Package Support Framework, and Icons extracted from the desktop application.
Sample-Manifest-Config
- Sample AppxManifestNew.xml
and config.json
files.
start
- HelloWorld.msix. An application you can test the following instructions against, before doing this with your own app.
complete
- Hello.MSIX.World_1.0.1.0_x64__5ncaqh95vjk2e.msix. For your reference. HelloWorld.MSIX with the changes necessary to create shortcuts.
You'll need the following:
CreateShortcuts.ps1
. Clone this repository: https://github.com/mjfusa/msix-create-desktop-shortcuts. The script is in theScriptInPackage
folder.- An icon embedded in your application's EXE. This will be used to create the shortcut icon.
- Package Support Framework binaries. Here are the steps to download:
# PowerShell - Download PsdBinaries 2.0 into the PsfBinaries folder
md PsfBinaires
cd PsfBinaires
wget https://github.com/microsoft/MSIX-PackageSupportFramework/releases/download/v2.0/PSFBinaries.zip -OutFile PSFBinaries.zip
Expand-Archive .\PSFBinaries.zip
- MSIX Packaging Tool. Install from the Microsoft Store here.
- An MSIX Packaged app.
You will need to start with an existing MSIX packaged app.
-
Extract the contents of your MSIX package to a temporary directory. You can use the
MSIX Packaging Tool
to do this. -
Change to the temporary directory where you unpackaged the application.
-
Run the script
CreateManifestAndConfigForPSF.ps1
in the same folder where you have saved the extracted the application. -
After running the script, the icon(s) are extracted, converted to ico files and saved to the created 'Icons' folder. Also
AppxmanifestNew.xml
andconfig.json
are created.config.json
is required by the Package Support Framework. You will replace the existing manifest with the contents ofAppxmanifestNew.xml
.
-
Open your MSIX package for editing in the MSIX Packaging tool (MPT)
-
In the 'Manifest file' section click on 'Open File'. The manifest will be opened into Notepad for editing.
-
Open
AppmanifestNew.xml
created in the section above in another editor and copy the entire contents to the clipboard. -
Go back Notepad. Delete all of the contents and paste in the contents you copied in the previous step.
-
Notepad should now have the contents of
AppmanifestNew.xml
. Save the file and close notepad. -
Verify in MPT that you have no errors in the 'Manifest file' section.
-
Click on 'Package files' in MPT
-
Right click on
Package
-
Click
Add File
and add theconfig.json
file that was created in the Create Icons, AppxmanifestNew.xml and config section above.
-
Click on 'Package files' in MPT
-
Right click on
Package
-
Click on
New folder
. TypeIcons
. Click Save -
Right click on
Icons
-
Click
Add File
and add the png files that were created in the section Create Icons, AppxmanifestNew.xml and config above.
Note: For this step you will need the PSF Binaries and the CreateShortcuts.ps1
script included in the GitHub repository. See Prerequisites.
-
Go back to MPT
-
Click on 'Package files' in MPT
-
Right click on
Package
-
Click 'Add File' and add the following files from the
PSFBinaries\bin
folder:
PsfLauncher32.exe
PsfLauncher64.exe
PsfRunDll32.exe
PsfRunDll64.exe
PsfRuntime32.dll
PsfRuntime64.dll
StartingScriptWrapper.ps1
The StartingScriptWrapper.ps1
is required to run PowerShell scripts from PSF.
- Go back to MPT
- Click on 'Package files' in MPT
- Right click on
Package
- Click 'Add File' and add the file
CreateShortcuts.ps1
You have added all of the necessary files and can now save and sign the MSIX.
- Go back to MPT
- Provide the code signing certificate.
- Click Save and click Yes to increment the version number.
- The MSIX is updated with create shortcut support, signed and ready for testing.