SOLVED

MakeAppX and uap3:Verb attribute parameters incorrectly validating

%3CLINGO-SUB%20id%3D%22lingo-sub-2009550%22%20slang%3D%22en-US%22%3EMakeAppX%20and%20uap3%3AVerb%20attribute%20parameters%20incorrectly%20validating%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2009550%22%20slang%3D%22en-US%22%3E%3CP%3EThere%20appears%20to%20be%20some%20issues%20with%20how%20makeappx%20is%20parsing%20the%20parameters%20attribute.%26nbsp%3B%20The%20underlying%20type%20is%20t%3AST_Parameters%20which%20expects%20matching%20to%20the%20regex%20string%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B((%3F!%5C%25%5BIi%5D.*%5C%25%5BIi%5D).)*%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20following%20value%20fails%20in%20MakeAppx%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%3CVERB%20id%3D%22%26quot%3Bopen%26quot%3B%22%20parameters%3D%22%26quot%3B%22%3Eopen%3C%2FVERB%3E%3C%2FP%3E%0A%3CP%3Ebut%20removing%20the%20space%20at%20the%20beginning%20of%20the%20value%20for%20the%20Parameters%20attribute%20solves%20this.%26nbsp%3B%20I%20have%20also%20found%20it%20necessary%20to%20remove%20other%20spaces%20in%20Parameters%2C%20such%20that%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3BParameters%3D%22%2Fpatchfile%3A%20%22%251%22%22%26nbsp%3B%3C%2FP%3E%0A%3CP%3Ealso%20fails%20validation%20under%20MakeAppx.%26nbsp%3B%20All%20of%20these%20strings%20appear%20to%20be%20valid%20matches%20to%20the%20defined%20pattern.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20a%20workaround%20I%20am%20removing%20the%20spaces%20for%20this%20app%20as%20it%20works%20without%20them%2C%20but%20there%20will%20be%20apps%20for%20which%20space%20removal%20is%20not%20an%20option.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2010495%22%20slang%3D%22en-US%22%3ERe%3A%20MakeAppX%20and%20uap3%3AVerb%20attribute%20parameters%20incorrectly%20validating%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2010495%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F146612%22%20target%3D%22_blank%22%3E%40TIMOTHY%20MANGAN%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20have%20reported%20the%20issue%20to%20the%20appropriate%20teams.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20your%20feedback!%3CBR%20%2F%3EJames%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2013227%22%20slang%3D%22en-US%22%3ERe%3A%20MakeAppX%20and%20uap3%3AVerb%20attribute%20parameters%20incorrectly%20validating%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2013227%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F777384%22%20target%3D%22_blank%22%3E%40luiscalv%3C%2FA%3E%26nbsp%3BThanks.%26nbsp%3B%20I%20guess%20I%20missed%20that%20part%20of%20the%20validation.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20is%20a%20pita%20that%20the%20schemas%20are%20so%20stringent%20on%20syntaxes%20that%20have%20been%20acceptable%20in%20the%20past%20(Win32%2F.Net%20Framework).%26nbsp%3B%20This%20slows%20down%20the%20progress%20for%20moving%20to%20the%20new.%26nbsp%3B%20I%20don't%20have%20any%20expectations%20that%20will%20change%2C%20just%20registering%20frustrations.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
MVP

There appears to be some issues with how makeappx is parsing the parameters attribute.  The underlying type is t:ST_Parameters which expects matching to the regex string

    ((?!\%[Ii].*\%[Ii]).)*

 

The following value fails in MakeAppx

   <uap3:Verb Id="open" Parameters=" /patchfile:"%1"">open</uap3:Verb>

but removing the space at the beginning of the value for the Parameters attribute solves this.  I have also found it necessary to remove other spaces in Parameters, such that

   Parameters="/patchfile: "%1"" 

also fails validation under MakeAppx.  All of these strings appear to be valid matches to the defined pattern.

 

As a workaround I am removing the spaces for this app as it works without them, but there will be apps for which space removal is not an option.

4 Replies

Hi @TIMOTHY MANGAN,

 

I have reported the issue to the appropriate teams.

 

Thanks for your feedback!
James

best response confirmed by TIMOTHY MANGAN (MVP)
Solution

Hi @TIMOTHY MANGAN ,

 

ST_Parameters is based on ST_NonEmptyString. ST_NonEmptyString doesn't allow empty string at the beginning of the string.

AppxManifest parameter doesn't need leading space because the system injects the space between the executable and the arguments.

If you want to use quotes, you have the following options:

Parameters='/patchfile: "%1"'
Parameters="/patchfile: &quot;%1&quot;"

 

Thanks
-Josue

@luiscalv Thanks.  I guess I missed that part of the validation.

 

It is a pita that the schemas are so stringent on syntaxes that have been acceptable in the past (Win32/.Net Framework).  This slows down the progress for moving to the new.  I don't have any expectations that will change, just registering frustrations. 

@luiscalv By the way, the Microsoft MSIX packaging tool does produce valid MSIX packages with the syntax shown previously, but also the following syntax: <uap3:Protocol Name="powertoys" Parameters=""%1"">

 

So I'm not sure if we need to escape the inner quotation marks of if that is a packaging tool bug not caught in the validation.