microsoft / MSIX-PackageSupportFramework

The Package Support Framework (PSF) is a kit for applying compatibility fixes to packaged desktop applications.
MIT License
115 stars 57 forks source link

Scripting and PackageRoot folder #125

Closed TimMangan closed 4 years ago

TimMangan commented 4 years ago

Many of the more interesting Start Scripts that I want to write require the script to know what the root folder of the package is so that files can be located. For example, a first run script might involve looking for configuration files under the package VFS/AppData or LocalAppData folder(s), then checking to see if native equivalent files exist (from an older non-MSIX install), and copying from the non-MSIX or package source as appropriate into the package redirection folder.

So I would like to see the "arguments" field of the script definition in the json to be able to specify a pseudo-variable, such as %PackageRoot% and have the Psf Script processing replace that with the value of g_PackageRootPath.

This would allow a generic script for that purpose, which uses arguments for the root folder and relative specific file paths. This script could then be used for any package, no matter how it is built.

TimMangan commented 4 years ago

Addressed in PR#132

TimMangan commented 4 years ago

Addressed in replacement PR#137.

Two new Pseudo-variables are introduced for processing by PsfLauncher for scripting. %MsixPackageRoot% and %MsixWritablePackageRoot% will be replaced if present in the command line/arguments for the scripts.