I was playing around with Requirement Types for the application model the other day and thought it was worth blogging my solutions as I couldn’t really find any decent documentation on this. I’m sure there is some out there, somewhere in the ether of the Internet but here’s my version.
Let me start by painting the scenario. I’m currently involved in pushing out an Office 365 deployment across the globe in multiple languages, approx. 25 in total. To put all the languages into one Office 365 gives us a resultant application that is over 6GB in size, not great in some of the locations with slow links. To great around this we are creating EMEA, APAC, NORAM and LATAM packages.
To break this down further, since we only want languages that are relevant to the country we are installing for, we are going to create separate deployment types for each country, so for example, we have an Office config file for Greece only in the EMEA application and this runs the command line setup.exe /configure el-GRconfiguration.xml. To ensure that this runs only on a device being built for Greece we have a requirement set in the deployment type.
As part of the OSD, the ‘OfficeLocale’ is a variable that is captured from our UDI wizard, and that particular variable is tattooed into the registry early on in the build process. Therefore we decided that the OfficeLocale registry key would be ideal to use as the requirement type that would determine that the deployment type would be executed.
To achieve this we simply create a global condition ConfigMgr that points to the location of the registry key we are tattooing during the build process.
Then when we create our deployment type for the application, we can add in a requirement that this registry key should equal our desired reg key value, in this case el-GR for Greece,
The trickier version of this was to accommodate the registry key being of two or more values, for example, if I want to install the German language for Office 365, then my OfficeLocale value could be en-DE (English-German) or en-AT (English-Austrian). So how exactly is this achieved.
If you take a look at the Operator drop down in the Edit Requirement Type box you can see an option for One of. Perfect! However, if you look around on the Internet there’s nothing really out there that tells me how to populate the values for this operator.
Here’s how you can achieve it.
After asking on Twitter, Ari Saastamoinen (@AriSaastamoinen) came up with the suggestion of entering the values on separate lines like so:
This method worked perfectly.
You’ll notice that when you OK this window the requirement type appears in the console with the values comma separated. Note if you enter the values in the Requirement Type window with commas it doesn’t work, you must use the method above.
The second way to achieve this is a little more convoluted but works.
We need to create another global condition, this time it will be a Condition Type Expression. We then need to click the Add Clause button.
We can then use our existing global condition to state the exact value of the registry key, in this instance the en-AT value and we can repeat this process to add the clause for en-DE, our second possible registry key value.
Finally, we add the connector type to our boolean arguement. From the Connector drop down we can select OR.
Now, when adding the requirement type to the our deployment it’s a simple case of choosing this global condition and setting its value to True.