App-V 5 Recipe for SQL Server Management Studio 2016 or SSMS 17.x

The legal stuff first: Use these instructions at your own risk. I cannot guarantee that they will always function well and I accept no responsibility for any damages. However I would appreciate any feedback concerning problems in order to help others in the community.

You can find here the Recipe for 18.5: https://www.andreasnick.com///www.andreasnick.com/105-sql-server-management-studio-18-5-ssms-app-v-recipe.html

Notice: If you would like to support me and this blog, then purchase my App-V 5 book (written in German): https://www.amazon.de/Softwarevirtualisierung-mit-App-V-Ein-Praxisbuch/dp/1544717318

A few days ago I held a workshop on packaging for App-V together with one of our best Citrix specialists and coauthor of the Rheinwerk book for XenDesktop 7.x, Jan Hendrik, (Jan Hendrik's Blog excelent Citrix Blog) as well as with his colleague Tobias. Especially we talked about applications for which packaging had not functioned. This included, among others, the SQL Server Management Studio 2016 and SSMS 17. Even with the App-V recipe for SSMS 2014 it still did not allow packages to be made.
Upon attempting to sequence SQL Server Management Studio 17 and to save it, the following error occurs: HRESULT: 0x8007139F. Apparently the App-V 5 sequencer does not function with some of the components in the package (@Microsoft – this is a bug in the sequencer). Furthermore it is no longer possible to download Visual Studio Shell 2015 (Isolated) separately from Microsoft. In the Rorymon blog there is only a notice that Microsoft does not (any longer?) support Management Studio (SSMS 17) for App-V. I think that the lack of manufacturer's product support is the case for many applications. Therefore we simply tried it ourselves (it does represent quite a challenge).
When one takes a closer look at the problem with the Process monitor, one quickly sees which component it is that causes the HRESULT:

image001

alternately
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.Tools.Applications.Utilities.ProjectRetargetService.resources
This directory contains “only” language resource files, among others for a German version of Visual Studio. If these files are deleted, a DotNet WPF application switches automatically to English as standard.

image002

And thus one is able now to save without problems and the SQL management Studio even starts now as an App-V package.
Licensing causes further problems. If we remember, several years ago the Express Edition of Visual Studio was replaced by the Community Edition, which - just like the Professional Edition – requires a license. The licensing seems to depend on the SID of a system. App-V recipes for SQL Management Studio 2012 and 2014 therefor have the component “Visual Studio Shell 2010 (Isolated)” installed separately. Now, SSMS 17.x (SQL Server Management Studio 2016) installs a component “Visual Studio Shell 2015“. This component is unfortunately not available as a separate download. However when one goes looking there is a possibility to extract these components from an already existing installation :-)

But if the SQL Server Management Studio SSMS 17 is used in provisioned systems, this effort is not even necessary. In the event of a licensing problem you are shown the following dialogue: image003
We thus have two recipes (master image and standard installation). Sequencer 5.1 is used for the installation onto a windows 8.1 client.

SSMS 17 for Newly Installed Systems (the SID Changes)

# Extract all Visual Studio runtime (Visual Studio Shell 2015 (Isolated)) 
# elements from a SSMS Installation
# 2017' Andreas Nick


# fist: install SSMS 17.2!

if(-NOT (Test-path 'C:\ProgramData\Package Cache\FE948F0DAB52EB8CB5A740A77D8934B9E1A8E301\redist\vs_isoshell.exe'  )) {
    
    Write-Verbose "install SSMS 17.2!" -Verbose

} 

if( -not (test-path "$PSScriptRoot\SSMSRuntime")) {
    New-Item "$PSScriptRoot\SSMSRuntime" -ItemType directory | out-null

}

Write-Host "Extract all Visual Studio runtime (Visual Studio Shell 2015)" -ForegroundColor Cyan
Write-Host "Copy vs_isoshell.exe" -ForegroundColor Yellow
Copy-Item 'C:\ProgramData\Package Cache\FE948F0DAB52EB8CB5A740A77D8934B9E1A8E301\redist\vs_isoshell.exe' -Destination "$PSScriptRoot\SSMSRuntime\" -Force
Write-Host "Copy VS14-KB3095681.exe" -ForegroundColor Yellow
Copy-Item 'C:\ProgramData\Package Cache\02A26E554FBB4232ACD36E70D09F2C7893D399CD\redist\VS14-KB3095681.exe' -Destination "$PSScriptRoot\SSMSRuntime\" -Force
Write-Host "Copy vsta_setup.exe" -ForegroundColor Yellow
Copy-Item 'C:\ProgramData\Package Cache\5E6157D16EC044A823B2FD2C030ED6DECD2E997E\redist\vsta_setup.exe' -Destination "$PSScriptRoot\SSMSRuntime\" -Force
Write-Host "Copy vsta_ls.ex" -ForegroundColor Yellow
Copy-Item 'C:\ProgramData\Package Cache\4F812BBB2BE7E30CED293F8A229A5410D70DE6DB\redist\vsta_ls.exe' -Destination "$PSScriptRoot\SSMSRuntime\" -Force

Write-Host "Finish (wait 5 seconds)" -ForegroundColor Cyan

Start-Sleep -Seconds 5 

 

image004

 

# Install Visual Studio Shell 2015 (Isolated)) and components from SSMS 17.2
# 2017' Andreas Nick

Write-Host "Install Visual Studio runtime (Visual Studio Shell 2015)" -ForegroundColor Cyan

Write-Host "Install vs_isoshell.exe" -ForegroundColor Yellow


(Start-Process "$PSScriptRoot\SSMSRuntime\vs_isoshell" '/passive' -wait -Passthru).ExitCode


Write-Host "Install VS14-KB3095681.exe" -ForegroundColor Yellow
(Start-Process "$PSScriptRoot\SSMSRuntime\VS14-KB3095681.exe" '/passive' -wait -Passthru).ExitCode


Write-Host "Install vsta_setup.exe" -ForegroundColor Yellow
(Start-Process "$PSScriptRoot\SSMSRuntime\vsta_setup.exe" '/passive' -wait -Passthru).ExitCode


Write-Host "Install vsta_ls.ex" -ForegroundColor Yellow
(Start-Process "$PSScriptRoot\SSMSRuntime\vsta_ls.exe" '/passive' -wait -Passthru).ExitCode


Write-Host "Finish (wait 5 seconds) - the system need a reboot" -ForegroundColor Cyan


Start-Sleep -Seconds 5 

 

 

image005

Now save the package as an App-V package. In order for the package to function Visual Studio Shell 2015 (Isolated) must always have been installed prior. But for that you can use the script above.

SSMS for Master Image - Based Systems (PVS)

If the SSMS is used on a cloned system (master image and/or PVS) then the SID does not change and the licensing functions with VSShell 2015 still in the package.

image006

image007

image005

image002

Finally save the package and test.