How to create a URL Shortcut to open a specific website in MSIX

Written by Horatiu Vladasel · April 3rd, 2024 · 3min read

Whether it's in-house applications, custom-made software, or applications from third-party vendors, there are times when we need to package them with a URL shortcut.

If you're working with MSIX, you know that targeting non-exe files and files outside the MSIX container isn't natively supported. So, how do we tackle this challenge? Let's delve into it.

MSIX Packaging Tool: Creating URL Shortcuts in MSIX

To create a URL shortcut, you’ll want to bring in the Packager Support Framework (PSF). Here’s the plan:

  1. Set the msedge.exe as the target for your shortcut.
  2. Set the URL as the argument for your shortcut.

Sounds simple, right? Here’s a step-by-step guide:

1. Start by creating a new config.json, adding this code template:

{
  "applications": [
	{
      "id": "",
      "executable": "",
      "arguments": "",
      "workingDirectory": ""
    }
  ]
}

2. Define the “executable” to the path of your web browser, and set the “argument” to your desired URL:

{
   "applications": [
	{
      "id": "",
      "executable": "VFS\\ProgramFilesX86\\Microsoft\\Edge\\Application\\msedge.exe",
      "arguments": "\"https://www.advancedinstaller.com/user-guide/introduction.html\"",
      "workingDirectory": "
    }
  ]
}

3. Open your MSIX package in the MSIX Packaging Tool’s Package Editor;

4. Dive into the AppxManifest.xml file and copy the value from the “Id” field. Paste this into the Application “id” field in your config.json;

AppxManifest.xml file

5. Finally, save your config.json and integrate it into the MSIX package.

{
   "applications": [
    {
      "id": "ShortcutToURL",
      "executable": "VFS\\ProgramFilesX86\\Microsoft\\Edge\\Application\\msedge.exe",
      "arguments": "\"https://www.advancedinstaller.com/user-guide/introduction.html\"",
      "workingDirectory": "
    }
  ]
}

Next, ensure your MSIX package includes the appropriate PSF file based on your app's architecture, such as:

  • PsfLauncher32.exe/PsfLauncher64.exe
  • PsfRunDll32.exe/PsfRunDll64.exe
  • PsfRuntime32.dll/PsfRuntime64.dll

Advanced Installer: Creating URL Shortcuts in MSIX

Advanced installer comes with its in-build support for creating a shortcut to open a specific URL.

If you’ve dabbled with it before, you know most tasks are a breeze using Advanced Installer’s GUI, with no manual editing of the AppXManifest file or manual PSF injections.

Are you new to Advanced Installer?

Unlock the power of MSIX shortcuts – try Advanced Installer's 30-day free trial today!

Here's how you can do it:

The first method is to add the shortcut as “New URL”. This will open the URL using the default browser set on the device. To do that, you need to:

  1. Go to the “Shortcuts” page.
  2. Click on the “URL” toolbar button or right-click and then select “New URL Shortcut”.
  3. Configure your URL as per your requirements.
Configure URL shortcut in MSIX

The second method is to add the shortcut as “External File”. To do that, you need to:

  1. Go to the “Application Details” Page.
  2. Right-click and then select “New External Application”.
  3. Configure your shortcut to the external file as per your requirements. “Shortcut target” must be set to the executable path of the Internet browser you want to be used to open the URL.
Adding URL Shortcut as External File in MSIX

Whichever method you embrace, these shortcuts find their way into the Start Menu, ready to direct you to the specified URL.

Video

Conclusion

While MSIX packaging offers powerful capabilities, it comes with its set of challenges. However, with the right tools like the Package Support Framework and Advanced Installer, these hurdles can be easily overcome.

And if you’re leveraging Advanced Installer, well, its GUI has got your back, automating many of the trickier steps.

Happy packaging!

Written by
See author's page
Horatiu Vladasel

Horatiu is a Software Packager/Sequencer with over 10 years experience, who has worked as a Software Packager at IBM and is currently offering software packaging services to companies such as BT or Nationwide.

Comments: