Question on Modification Package to "store app"

%3CLINGO-SUB%20id%3D%22lingo-sub-326538%22%20slang%3D%22en-US%22%3EQuestion%20on%20Modification%20Package%20to%20%22store%20app%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-326538%22%20slang%3D%22en-US%22%3E%3CP%3ELet's%20go%20with%20a%20specific%20example%3A%20The%20Packaging%20Tool%20App.%26nbsp%3B%20And%20let's%20say%20I%20want%20to%20build%20a%20modification%20package%20for%20the%20settings%20file%20it%20stores.%20%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%20using%20the%20Windows%20Store%20for%20Business%20I%20obtain%20an%20%22offline%22%20copy%20of%20the%20AppXBundle%2C%20and%20then%20extract%20the%2064-bit%20.appx%20file%20from%20it%20(because%2C%2032-bit%20OSs%20are%20so%202010!)%2C%20and%20then%20rename%20the%20extension%20of%20that%20file%20to%20.msix.%20This%20allows%20me%20to%20use%20in%20in%20the%20Packaging%20Tool%20itself.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20now%20want%20to%20create%20a%20modification%20package%20with%20the%20settings%20file.%26nbsp%3B%20The%20settings%20file%20itself%20does%20not%20exist%20in%20the%20package%2C%20it%20seems%20to%20be%20dynamically%20generated%20when%20you%20first%20run%20the%20tool.%26nbsp%3B%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20%23ffffff%3B%20color%3A%20%23333333%3B%20cursor%3A%20text%3B%20font-family%3A%20inherit%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20line-height%3A%201.7142%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3EI%20know%20it%20is%20written%20to%20the%20%5B%7BLocal%20AppData%20%7D%5D%5CPackages%5C%5B%7BPkgname_hash%7D%5D%5CLocalState%20redirection%20area%20for%20the%20package%2C%20but%20I'm%20pretty%20sure%20that%20the%20app%20didn't%20try%20to%20write%20it%20somewhere%20else%20and%20have%20it%20redirected%20here%2C%20I%20believe%20it%20called%20an%20API%20that%20wrote%20it%20directly%20there.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%20I%20do%20the%20following%3A%3C%2FP%3E%0A%3CUL%20style%3D%22list-style-position%3A%20inside%3B%22%3E%0A%3CLI%3EStart%20the%20tool%20(which%20generates%20the%20initial%20version%20of%20the%20file%20on%20disk).%3C%2FLI%3E%0A%3CLI%3EThinking%20ahead%2C%20I%20change%20the%20default%20exclusion%20list%20to%20not%20exclude%26nbsp%3B%3CSPAN%20style%3D%22background-color%3A%20%23ffffff%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20cursor%3A%20text%3B%20display%3A%20inline%3B%20float%3A%20none%3B%20font-family%3A%20inherit%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20line-height%3A%201.7142%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3E%20%5B%7BLocal%20AppData%20%7D%5D%5CPackages.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3EStart%20the%20modification%20package%20wizard%20(using%201.2019.110%20so%20the%20manifest%20is%20right)%2C%20choose%20the%20.msix%20file%20%26amp%3B%20add%20my%20cert.%20%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3EBut%20now%20where%20to%20place%20the%20file%3F%26nbsp%3B%20The%20instructions%20say%20I%20should%20have%20the%20Win32%20version%20of%20the%20software%20installed.%26nbsp%3B%20This%20doesn't%20exist%20to%20me%20but%20I%20have%20the%20package%20installed%20and%20maybe%20that's%20good%20enough%3F%20(In%20which%20case%20the%20language%20on%20the%20modification%20UI%20should%20be%20updated).%3C%2FLI%3E%0A%3CLI%3EI%20just%20overwrite%20that%20file%20with%20the%20replacement.%3C%2FLI%3E%0A%3CLI%3EClean%20up%20in%20the%20editor%20so%20that%20I%20only%20have%20the%20one%20file%20and%20save%20off%20the%20package.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EUsing%20the%20Windows%20Insider%20Preview%20build%20(so%20I%20have%20the%20fixes%20for%20modification%20package%20layering)%20I%20now%20install%20stuff.%3C%2FP%3E%0A%3CUL%20style%3D%22list-style-position%3A%20inside%3B%22%3E%0A%3CLI%3EIf%20I%20install%20the%20main%20tool%20package%20plus%20the%20modification%20package%2C%20and%20then%20run%20the%20tool%2C%20I%20get%20the%20changed%20settings.%3C%2FLI%3E%0A%3CLI%3EIf%20I%20add%20the%20settings%20after%20running%20the%20tool%2C%26nbsp%3B%20the%20changes%20have%20no%20effect%2C%20because%20the%20local%20copy%20in%20the%20native%20AppData%5CLocal%5CPackages%20wins.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EThis%20makes%20such%20a%20modification%20package%20unacceptable%20to%20deploy%3B%20it%20will%20just%20confuse%20the%20heck%20out%20of%20everyone.%20(Reminder%3A%20the%20MPT%20is%20just%20an%20example%20app%20here).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIs%20this%20what%20is%20intended%2C%20and%2For%20is%20there%20a%20recommended%20approach%20to%20achieve%20the%20outcome%20desired%20--%20that%20is%20to%20deliver%20an%20addon%20that%20updates%20these%20settings%3F%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20am%20guessing%20this%20is%20%22by%20design%22%20and%20not%20likely%20to%20change%2C%20but%20would%20like%20that%20stated%20before%20we%20go%20looking%20at%20how%20to%20work%20around%20this%20scenario.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
MVP

Let's go with a specific example: The Packaging Tool App.  And let's say I want to build a modification package for the settings file it stores.  

 

So using the Windows Store for Business I obtain an "offline" copy of the AppXBundle, and then extract the 64-bit .appx file from it (because, 32-bit OSs are so 2010!), and then rename the extension of that file to .msix. This allows me to use in in the Packaging Tool itself.

 

I now want to create a modification package with the settings file.  The settings file itself does not exist in the package, it seems to be dynamically generated when you first run the tool. I know it is written to the [{Local AppData }]\Packages\[{Pkgname_hash}]\LocalState redirection area for the package, but I'm pretty sure that the app didn't try to write it somewhere else and have it redirected here, I believe it called an API that wrote it directly there.

 

So I do the following:

  • Start the tool (which generates the initial version of the file on disk).
  • Thinking ahead, I change the default exclusion list to not exclude  [{Local AppData }]\Packages.
  • Start the modification package wizard (using 1.2019.110 so the manifest is right), choose the .msix file & add my cert.  
  • But now where to place the file?  The instructions say I should have the Win32 version of the software installed.  This doesn't exist to me but I have the package installed and maybe that's good enough? (In which case the language on the modification UI should be updated).
  • I just overwrite that file with the replacement.
  • Clean up in the editor so that I only have the one file and save off the package.

 

Using the Windows Insider Preview build (so I have the fixes for modification package layering) I now install stuff.

  • If I install the main tool package plus the modification package, and then run the tool, I get the changed settings.
  • If I add the settings after running the tool,  the changes have no effect, because the local copy in the native AppData\Local\Packages wins.

This makes such a modification package unacceptable to deploy; it will just confuse the heck out of everyone. (Reminder: the MPT is just an example app here).

 

Is this what is intended, and/or is there a recommended approach to achieve the outcome desired -- that is to deliver an addon that updates these settings? 

 

I am guessing this is "by design" and not likely to change, but would like that stated before we go looking at how to work around this scenario.

 

 

0 Replies