7 minutes reading time (1312 words)

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

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

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.

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)

  • Patch the sequencer to the latest version (otherwise SSMS cannot be installed)
  • Take a sequencer snapshot
  • Reset the sequencer snapshot
  • Installation with the sequencer for SSMS 17 (SSMS-Setup-ENU.exe or SSMS-Setup-DEU.exe for the German version) https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms
  • Extract the Visual Studio Shell 2015 components with the following PowerShell (Get-VSISOShell.ps1). The script creates a folder SSMSRuntime in the script directory:
# 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 

 

  • Save the SSMSRUNTIME directory with the following contents

image004

  • Reset the sequencer snapshot
    Now install first the DotNet Framework 4.6.1 and then the SSMSRUNTIME components onto the sequencer. To do so the following script can be used (as the administrator):

 

# 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 

 

 

  • Now start the sequencer and install SSMS 17.x
  • Select “Create New Virtual Application”
  • "Create Package (default)” Next>
  • "Standard Application (default)” Next>
  • "Select Installer“ SSMS-Setup-ENU.exe (for the English version) or SSMS-Setup-DEU.exe (for the German version)
  • Begin the sequencer recording and install SSMS 17
  • The installation will now run through.
  • Continue to work on the package and adjust the shortcuts and FTAs as needed
  • On the “Advanced” tab Allow “Com” and “Full write permission” in the package

image005

  • Optional: Remove the folder VFS\Windows\Installer and VFS\Common AppData\Package Cache (ca. 1GB) from the package. Thereafter the package has a size of ca. 500 MB
  • Optional: Do not include the Visual C++ Runtime in the package, "the necessary hook must be removed“ – now VFS\Windows\winsxs can also be deleted.

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.

  • Install the DotNet Framework 4.6.1
  • Patch the sequencer, since the SSMS cannot be installed onto older, unpatched systems
  • Take a sequencer snapshot
  • Start the App-V 5 sequencer
  • Select “Create New Virtual Application”
  • “Create Package (default)“ Next>
  • “Standard Application (default)“ Next>
  • “Select Installer“ SSMS-Setup-ENU.exe (for the English version) or SSMS-Setup-DEU.exe (for the German version)
  • Start the sequencer recording and install SSMS 17

image006

image007

  •  Restart the sequencer and let the sequencer boot. The system continues afterwards
  • Select "I am finished installing“ and Next>

  •  

    Next>
  • Now do start the SQL Management Studio. Upon start-up of the SQL Management Studio just select Next>

  •  

    Select Customize and Next>
  • If you don’t need a feature block 1 select "Next>“ on "Run each program…“ 

  •  

    "Allow this package to run on any operating system“ and Next>
  • "Continue to modify“ and Next> thereafter press Close

  •  

    Edit the shortcuts and FTAs (remove unwanted ones)
  • On the "Advanced“ tab allow COM and full write permissions in the package

image005

  • Now delete the following folder in VFS: VFS\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.Tools.Applications.Utilities.ProjectRetargetService.resources
    This folder contains only the resource files for other languages for a certain component. Visual Studio should however function without them. This small component appears thereafter in English. Whoever does not want that can use the first set of installation instructions for his system! Alternately one could also insert these files via a script into the App-V package. I don't consider this necessary. If it is not done, the following error occurs when attempting to save the package: HRESULT: 0x8007139F.

image002

  • Optional: Delete the folder VFS\Windows\Installer and VFS\Common AppData\Package Cache (ca. 1GB) from the package. The package has thereafter a size of ca. 500 MB
  • Optional: Do not include the Visual C++ Runtime in the package, "the necessary hook must be removed“ – now VFS\Windows\winsxs can also be deleted.

Finally save the package and test.

 

When Local Applications Are Started By App-V
Archives and File Groups in the App-V Scripts Fold...
 

Comments 3

Guest - mohi uddin on Monday, 24 September 2018 14:32

Hi, Thanks for the post. it works perfectly.

I have sequenced the sql studio 2016 which works without any issues. the only message that appears initially when launching the studio is "vssettings cannot be found". once you ok the message it never appears again.


any ideas on how I can remove the message?

Hi, Thanks for the post. it works perfectly. I have sequenced the sql studio 2016 which works without any issues. the only message that appears initially when launching the studio is "vssettings cannot be found". once you ok the message it never appears again. any ideas on how I can remove the message?
Andreas Nick on Thursday, 12 April 2018 19:00

test

Guest - LCBakkie on Tuesday, 10 October 2017 06:33

Great post!
For the license problem, you may also delete HKLM\Classes\Licenses and before starting SSMS you have to run C:\Program Files (X86)\Microsoft Visual Studio 14.0\Common7\IDE\DDConfigCA.exe with Res WM or from the deploymentconfig.
After DDConfigCA is started, an new license will be created for that specific machine.

Great post! For the license problem, you may also delete HKLM\Classes\Licenses and before starting SSMS you have to run C:\Program Files (X86)\Microsoft Visual Studio 14.0\Common7\IDE\DDConfigCA.exe with Res WM or from the deploymentconfig. After DDConfigCA is started, an new license will be created for that specific machine.
Already Registered? Login Here
Guest
Tuesday, 16 July 2019

Captcha Image

@nickinformation Tweets

My german Blog: 

http://www.software-virtualisierung.de

in 

Cookies make it easier for us to provide you with our services. With the usage of our services you permit us to use cookies.
More information