This project provides tools, libraries, documentation and samples for creating app-compat fixups to enable classic Win32 applications to be distributed and executed as packaged apps.
## Documentation
Check out our [step by step guide](https://docs.microsoft.com/en-us/windows/uwp/porting/package-support-framework), it will walk you through the main PSF workflows and provides the key documentation.
See also:
* [Package Support Framework package layout](layout.md)
* [Package Support Framework Nuget package install](https://www.nuget.org/packages/Microsoft.PackageSupportFramework)
* [Instructions for authoring your own shim dll](Authoring.md)
Code licensed under the [MIT License](https://github.com/Microsoft/MSIX-PackageSupportFramework/blob/master/LICENSE).
## Branch structure
Package Support Framework adopts a development and master branching style.
### Master
This branch represents the source in the most recent nuget package. The code in this branch is the most stable. Please do not fork off this branch for development.
### Develop
This branch has the latest code. Keep in mind that there might be features in this branch that is not yet in master. Please make a private fork off this branch to make any contributions to Package Support Framework.
## Contribute
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
PSF allows one PowerShell script to be run before an exe runs, and one PowerShell script to be ran after the exe runs.
Each exe defined in the application manifest can have their own scripts.
### Prerequisite to allow scripts to run
In order to allow scripts to run you need to set the execution policy to unrestricted or RemoteSigned. The execution policy needs to be set for both the 64-bit powershell executable and the 32-bit powershell executable.
[More information about PowerShell Execution Policy](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-6)
In order to specify what scripts will run for each packaged exe you will need to modify the config.json file. To tell PSF to run a script before the execution of the packaged exe add a configuration item called "startScript". To tell PSF to run a script after the packaged exe finishes add a configuration item called "endScript".
The following are the configuration items available for the scripts. The ending script ignores the following configuration items: waitForScriptToFinish, and stopOnScriptError.
1. scriptPath: The path to the script including the name and extension. The Path starts from the root directory of the application.
2. scriptArguments: Space delimited argument list. The format is the same for a PowerShell script call. This string gets appended to scriptPath to make a valid PowerShell.exe call.
3. runInVirtualEnvironment: If the script should run in the same virtual environment that the packaged exe runs in.
4. timeout: How long the script will be allowed to execute. If elapsed the script will be stopped.
5. runOnce: If the script should run once per user, per version.
6. showWindow: If the powershell window is shown.
7. waitForScriptToFinish: If the packaged exe should wait for the starting script to finish before starting.
#### Enabling the app to exit if the starting script encounters an error.
The scripting change allows users to tell PSF to exit the application if the starting script fails. To do this, add the pair "stopOnScriptError": true to the application configuration (not the script configuration).
#### stopOnScriptError can not be true while waitForScriptToFinish is false
This is an illegal configuration combination and PSF will throw the error ERROR_BAD_CONFIGURATION.
4. Create a pull request into 'fork:Microsoft/MSIX-PackageSupportFramework' 'base:develop'
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
Here is how you can contribute to the Package Support Framework:
* [Submit bugs](https://github.com/Microsoft/MSIX-PackageSupportFramework/issues) and help us verify fixes
* [Submit pull requests](https://github.com/Microsoft/MSIX-PackageSupportFramework/pulls) for bug fixes and features and discuss existing proposals
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
Telemetry datapoint has been hooked to collect usage data and sends it to Microsoft to help improve our products and services. Read Microsoft's [privacy statement to learn more](https://privacy.microsoft.com/en-US/privacystatement). However, data will be collected only when the PSF binaries are used from [Nuget package](https://www.nuget.org/packages?q=packagesupportframework)
on Windows 10 devices and only if users have enabled collection of data. The Nuget package has binaries signed and will collect usage data from machine. When the binaries are built locally by cloning the repo or downloading the bits, then telemetry is not collected.