As stated in DOC-63186, since Windows 8 (eg. Windows 8, 8.1 and 10) the Start Menu displays only 1 shortcut for each executable. In an IWC configuration there are a lot of application objects that contains an identical “Command line” but perform a different action by altering the “Parameters” configuration.
Examples of these commonly used applications are:
- iexplore.exe <url>
- mstsc.exe <path to .rdp file>
- explorer.exe<path>
This, default behavior, is contolled by AppUserModeliD.
IWC can control / adjust the AppUserModeliD by placing a “CustomAppUserModeliDs.xml” in the root of the custom resources.
The layout of and the use of this file is explained in DOC-63186.
To ease the creation of this XML file, I created a Powershell Script. The script will take an Application Building Block (single file export of only the application node) as the input and will generate a CustomAppUserModeliDs.xml” . By adjusting a variable $strExe in the script a “CustomAppUserModeliDs.xml” can be generated for those application objects with this .exe in the command line.
In the first part of the script, an object is created ($obApps), containing the properties needed for the output ().
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
ForEach($sBBFile in $objBBFiles) { [xml]$xmlBB = Get-Content $sBBFile.FullName $xmlApps = $xmlBB.respowerfuse.buildingblock.application ForEach($xmlApp in ($xmlApps | Where-Object {($_.required -ne "yes") -and ($_.settings.enabled -eq "yes")})) #Filter out dependent and disbaled applications { Write-Host $xmlApp.configuration.title if ($xmlApp.configuration.commandline -match $strExe) { $objItem = New-Object PSCustomObject $objItem | Add-Member -membertype Noteproperty -Name Application -Value $xmlApp.configuration.title $objItem | Add-Member -membertype Noteproperty -Name AppId -Value $xmlApp.AppId $objItem | Add-Member -membertype Noteproperty -Name CommandLine -Value $xmlApp.configuration.commandline $objItem | Add-Member -membertype Noteproperty -Name CommandLineParameter -Value $xmlApp.configuration.parameters $objApps.Add($objItem)|Out-Null } } } |
In the second part of the script the object $objApps is formated and writen as a xml file ($sPathToXML).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
$xmlWriter = New-Object System.Xml.XmlTextWriter($sPathToXML, $null) $xmlWriter.Formatting = 'Indented' $xmlWriter.Indentation = 1 $XmlWriter.IndentChar = "`t" $xmlWriter.WriteStartDocument() $xmlWriter.WriteStartElement('applist') ForEach($objApp in $objApps){ Write-Host $objApp.Application $xmlWriter.WriteStartElement('App') $XmlWriter.WriteComment($objApp.Application) $XmlWriter.WriteElementString('id',$objApp.AppId) $XmlWriter.WriteElementString('appusermodelid','Workspacemanager.'+$objApp.AppId) $xmlWriter.WriteEndElement() } $xmlWriter.WriteEndElement() $xmlWriter.WriteEndDocument() $xmlWriter.Flush() $xmlWriter.Close() Write-Host "Finished..." |
With running the script for multiple exe’s and combining the xml results, a complete “CustomAppUserModeliDs.xml” can be created for use within IWC.
The complete Powershell script can be download here:
[wpfilebase tag=file id=2 tpl=download-button /]