Nov 09 2022 07:45 AM
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?
Dec 14 2022 05:56 AM
Jan 06 2023 02:47 AM
Jan 06 2023 06:55 AM
Solution
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
Jan 06 2023 08:12 AM
Also tagging @Naveen_Nooka on this.
Feb 17 2023 02:11 AM
Mar 06 2023 10:20 AM
Mar 06 2023 01:13 PM
Jan 06 2023 06:55 AM
Solution
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