Font size: +
7 minutes reading time (1320 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.

You can find here the Recipe for 18.5: https://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)

  • 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.

 

×
Stay Informed

When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.

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

Related Posts

 

Comments 10

Guest - Vamsi Krishna Alla on Wednesday, January 29, 2020 14:19

Hello Andreas,

I am having an issue in sequencing SQL Server Management Studio 2018 version.
While testing the Sequenced package on launching the "Microsoft SQL Server Management Studio 18" shortcut i am getting an error message stating that"A problem occurred when loading the Microsoft SQL Server Management Studio menu. To fix this problem, run 'Ssms.exe /resetsettings• from the command prompt. Note: this command resets your environment settings".

Could you please help me on this?

Hello Andreas, I am having an issue in sequencing SQL Server Management Studio 2018 version. While testing the Sequenced package on launching the "Microsoft SQL Server Management Studio 18" shortcut i am getting an error message stating that"A problem occurred when loading the Microsoft SQL Server Management Studio menu. To fix this problem, run 'Ssms.exe /resetsettings• from the command prompt. Note: this command resets your environment settings". Could you please help me on this?
Andreas Nick on Wednesday, January 29, 2020 15:07

I'm afraid I haven't heard that one before. But in the last versions we were not able to avoid the licensing problem. DDConfigCA.exe for a licensing reset did not help either. I would have to invest another two days in the product for a solution and I don't have that much time at the moment. Probably this will stay until a customer needs it again.

I'm afraid I haven't heard that one before. But in the last versions we were not able to avoid the licensing problem. DDConfigCA.exe for a licensing reset did not help either. I would have to invest another two days in the product for a solution and I don't have that much time at the moment. Probably this will stay until a customer needs it again.
Guest - Dan Gough on Wednesday, June 17, 2020 23:49

Hi, a user based PublishPackage script to run DDConfigCA.exe works but you first have to create and apply a ForceAdminAccess shim for the exe via an AddPackage script. The exe needs to be fooled into thinking it is running as admin otherwise it won’t work!

Hi, a user based PublishPackage script to run DDConfigCA.exe works but you first have to create and apply a ForceAdminAccess shim for the exe via an AddPackage script. The exe needs to be fooled into thinking it is running as admin otherwise it won’t work!
Andreas Nick on Thursday, June 18, 2020 06:49

Hi, we tested that back then too. In 17.x you could re-license the components this way. Only in January it was no problem with the DConfigCA.exe. Version 18.5 only had to be packaged differently and it became much easier. The recipe for SSMS18.5: https://www.andreasnick.com/105-sql-server-management-studio-18-5-ssms-app-v-recipe.html

Hi, we tested that back then too. In 17.x you could re-license the components this way. Only in January it was no problem with the DConfigCA.exe. Version 18.5 only had to be packaged differently and it became much easier. The recipe for SSMS18.5: https://www.andreasnick.com/105-sql-server-management-studio-18-5-ssms-app-v-recipe.html
Guest - Dan Gough on Thursday, June 18, 2020 08:39

Thanks, I’m going to be attempting the latest SSMS today. Previous versions we could sequence OK and publish on a client via Powershell, but the App-V Management Console refused to import the app due to an invalid manifest. It must use a different schema to the client/sequencer! Ever encountered that one and know if your recipe solves it? I’m wondering if all these success stories are using SCCM or App-V Scheduler!

0
Thanks, I’m going to be attempting the latest SSMS today. Previous versions we could sequence OK and publish on a client via Powershell, but the App-V Management Console refused to import the app due to an invalid manifest. It must use a different schema to the client/sequencer! Ever encountered that one and know if your recipe solves it? I’m wondering if all these success stories are using SCCM or App-V Scheduler!
Guest - Vamsi Krishna Alla on Friday, January 31, 2020 09:00

Hello Andreas,

Thanks alot for a quick reply on this, please do let us know if you have any solutions for this issue.

Thanks once again

Hello Andreas, Thanks alot for a quick reply on this, please do let us know if you have any solutions for this issue. Thanks once again:)
Guest - Ruben Koesoemowidjojo on Wednesday, February 05, 2020 21:11

Hi,

I am having the exact same issue:

While testing the Sequenced package on launching the "Microsoft SQL Server Management Studio 18" shortcut i am getting an error message stating that"A problem occurred when loading the Microsoft SQL Server Management Studio menu. To fix this problem, run 'Ssms.exe /resetsettings' from the command prompt. Note: this command resets your environment settings"

If there are any updaes, dont hesitate to share

Hi, I am having the exact same issue: While testing the Sequenced package on launching the "Microsoft SQL Server Management Studio 18" shortcut i am getting an error message stating that"A problem occurred when loading the Microsoft SQL Server Management Studio menu. To fix this problem, run 'Ssms.exe /resetsettings' from the command prompt. Note: this command resets your environment settings" If there are any updaes, dont hesitate to share :)
Guest - LCBakkie on Friday, April 10, 2020 22:38

I've packaged SSMS 18.5 today, and the need of licenses looks totally disapeard!
I had to modify the install path to C:\Program Files (x86)\SSMS18, otherwise i'm getting an error the VS Editor cannot start because of a long file path (max. 260). And still you have to remove de resources folder from the GAC_MSIL.
First tests looks good for now. So maybe this will help you.

0
I've packaged SSMS 18.5 today, and the need of licenses looks totally disapeard! I had to modify the install path to C:\Program Files (x86)\SSMS18, otherwise i'm getting an error the VS Editor cannot start because of a long file path (max. 260). And still you have to remove de resources folder from the GAC_MSIL. First tests looks good for now. So maybe this will help you.
Andreas Nick on Thursday, April 12, 2018 19:00

test

Guest - LCBakkie on Tuesday, October 10, 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
Thursday, April 25, 2024

Captcha Image

@nickinformation Tweets

My german Blog: 

http://www.software-virtualisierung.de

in 

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.