How to create a App-V package that fits different environments and location based configurations? Well there are several ways to achieve that.
- Scripting inside the OSD file by adding registry keys and values as well as environment variables. (but what about file editing / replacement?)
- Creating a dedicated OSD file for each location / adaption of the package (but what about the package project not recognizing manual changes?)
- Create a dedicated package for each use case / location (well if you have a boreout, that could save your live but not the customer’s money)
The best solution IMHO is to outsource the logic to a script which interprets a simple XML file. So here’s the way to get there.
Within the OSD file you just add a script (of course a Powershell one, what else?) to be called at the PRE-LAUNCH state of an App-V application launch. The script reads out an XML file and executes:
- Registry mods
- Find / Replace within text based files (INI etc.)
- Copy files / folders