App-V 5.1 misleading conversion warning (Scripts used during conversion included)

During my last project I had the chance to convert about a hundred sequences from App-V 4.6 to App-V 5.1. I started out with a script to test if the sequences could be converted by using the Powershell cmdlet Test-AppvLegacyPackage and export the data to xml and then onto an html file. The html file proved to be a great source for reporting purposes. I am sure that the Powershell code can be a lot cleaner, but it suited my needs for the moment.

Script used to test conversion readiness:


$Source = "[Input Folder]"
$Path = "[Temp Folder]"

If (!(Test-Path $Dest ))
{
New-Item -Path $Dest -type directory -Force
}
else
{
Write-Host "Output Folder already present"
}

Get-ChildItem -Path $Source | ForEach-Object {Test-AppvLegacyPackage $_.FullName} | Export-Clixml -Path $Path\Conversion.xml
pause
$a = "

"

Import-Clixml -Path $Path\Conversion.xml | sort @{expression="Errors";Descending=$true},@{expression="Warnings";descending=$true} | Select-Object Source, Errors, Warnings, Information | convertto-html -head $a -body "< h 3 >Test-AppvLegacyPackage< / h 3 >" | Out-File $Path\Conversion.html

* remove the spaces before, between and after h and 3 for the correct code.

When I ran this script it generated a warning for two of the sequences reporting:

The icon folder for this package is missing. This package will still convert successfully. However, there will be no icons associated with the applications.

I first checked to see if the icons were in fact missing, but that was not the case. It turned out that the two sequences in question had no valid shortcut entry in the osd file. The osd file just had this entry:

In App-V 4.6 when an osd file is present without a shortcut entry it is still possible to create an application publication in a user environment tool like RESOne Workspace Manager. In App-V 5.1 the same situation will not result in an application publication in RESOne Workspace Manager because no AppV.Shortcut entry is taken into the xml files. So the solution is quite easy. Just paste in a valid shortcut in the osd file for the warning to disappear and to create a valid AppV.Shortcut entry in App-V 5 xml files.

Example to create an Orca shortcut entry in the osd file:




After this change the sequences would no longer generate a warning while tested for conversion readiness and later on were successfully converted and technically tested. Below you will find the script I used to convert the sequences:


$Source = "[Input Folder]"
$Dest = "[Output Folder]"

Get-ChildItem -Path $Source | Test-AppvLegacyPackage | Where-Object {$_.Errors.Count -eq 0 } | Select-Object * , @{n='SourcePath';e={$_.source}} | ConvertFrom-AppvLegacyPackage -DestinationPath $Dest

$Packages = Get-ChildItem -Path $Dest -Filter "*.appv*"

foreach ($Package in $Packages) {
$Name = $Package.Name.substring(0,($Package.Name.length - 5))
$PackageItems = Get-ChildItem -Path $Dest -Filter "$Name*"
New-Item -Path $Dest\$Name -Type Directory
For ($n=0; $n -le $PackageItems.Count -1; $n++) {Move-Item $PackageItems[$n].FullName $Dest\$Name}
}

This basically is the script that Aaron Parker posted on his website a long time ago with the addition of information of another blog post that I found. The addition is needed because in the latest versions the Powershell cmdlet expects other output from the previous cmdlet (SourcePath instead of Source).

Leave a Reply

  

  

  

This site uses Akismet to reduce spam. Learn how your comment data is processed.