Forum Discussion
Florin Vică
Nov 09, 2022Copper Contributor
Error using MSIX windows.shortcut extension
After using the MSIX windows.shortcut extension, I am getting the following error on installation:
"App installation failed with error message: AppxManifest.xml(2,2): error 0x800700A1: Cannot register the Shortcut.Sample package because the following error was encountered while parsing the windows.shortcut extension: The specified path is invalid."
Here is snippet of the manifest:
<Dependencies>
<TargetDeviceFamily MaxVersionTested="10.0.22621.0" MinVersion="10.0.22621.0" Name="Windows.Desktop"/>
</Dependencies>
<Capabilities>
<rescap:Capability Name="runFullTrust"/>
</Capabilities>
<Applications>
<Application EntryPoint="Windows.FullTrustApplication" Executable="VFS\Desktop\sample.exe" Id="sample">
<Extensions>
<desktop7:Extension Category="windows.shortcut">
<desktop7:Shortcut ExcludeFromShowInNewInstall="false" File="VFS\Desktop\sample.exe" Icon="VFS\Desktop\sample.exe" PinToStartMenu="true"/>
</desktop7:Extension>
</Extensions>
</Application>
</Applications>
Why is this happening?
How can I overcome this?
Is there any sample using windows.shortcut extension?
I Just looked at examples from my tooling. Here is what seems to be wrong to get the package to install. The issue is the format of the file and icon references in the desktop7:Shortcut element, which appear very odd relative references.
Rules for these values as implemented from documentation (desktop7:Shortcut - Windows UWP applications | Microsoft Learn) look like any other package relative string, but MakeAppX (to create the package) seems to impose one set of rules, while the AppXInstaller is imposing a different set. And what actually works may be even different.
To satisfy what MakeAppX wants and get AppInstaller to accept it, I have been adding [{Package}] in front of VFS on those should always install (as in [{Package}]\VFS\Desktop\Sample.exe). Replacing VFS\xxx with a variable also possible, although Desktop might be [{ThisPCDesktopFolder}].
Microsoft could help here to clarify what is needed Dian Hartono
7 Replies
Sort By
- Did you add desktop7 to the namespaces list at the top of the manifest?
- Florin VicăCopper ContributorTIMOTHY_MANGAN desktop7 is in the namespaces list in my sample.
I Just looked at examples from my tooling. Here is what seems to be wrong to get the package to install. The issue is the format of the file and icon references in the desktop7:Shortcut element, which appear very odd relative references.
Rules for these values as implemented from documentation (desktop7:Shortcut - Windows UWP applications | Microsoft Learn) look like any other package relative string, but MakeAppX (to create the package) seems to impose one set of rules, while the AppXInstaller is imposing a different set. And what actually works may be even different.
To satisfy what MakeAppX wants and get AppInstaller to accept it, I have been adding [{Package}] in front of VFS on those should always install (as in [{Package}]\VFS\Desktop\Sample.exe). Replacing VFS\xxx with a variable also possible, although Desktop might be [{ThisPCDesktopFolder}].
Microsoft could help here to clarify what is needed Dian Hartono