Visual Studio 2019 - Anyone find a good deployment method?

CSCC-JS
Contributor II

Has anyone found a good way to deploy Microsoft Visual Studio 2019?

Microsoft currently does not have a full macOS package of Visual Studio 2019.
Trying to get the full package via Unity still gives the previous version (as of 2019.1.8f1).

The only think I've thought of is trying composer snap shot, then referencing the uninstall scripts to make sure I don't prune anything - https://docs.microsoft.com/en-us/visualstudio/mac/uninstall?view=vsmac-2019

I was also thinking, install the previous version, and see if there's a way to automate the upgrade?

8 REPLIES 8

hdsreid
Contributor III

Are you trying to cache everything to one location on your network for an install to conserve bandwidth, or are you just looking for an easy way to deploy? Microsoft at the moment says there is no way to make an offline installer like they have for Windows: https://visualstudio.microsoft.com/vs/support/mac/install-visual-studio-mac-offline/

if bandwidth isn't much of a concern, you could upload the dmg and run a script to start the installation running as your management account

CSCC-JS
Contributor II

Easy way to deploy, have unlimited bandwidth resources.
I could not find a complete dmg file, just the installer that downloaded the rest, and could not find a way to automate it via script.

While working on Facebook React Native CLI deployment, which in part uses Homebrew (https://brew.sh/) and noticed in the formulas (https://formulae.brew.sh/cask/) saw visual studio recipe, running it reveled FULL dmg file which I can deploy.

Download Links

MonoFrameWork
https://www.mono-project.com/download/stable/

.Net Core for VS
https://docs.microsoft.com/en-us/visualstudio/mac/net-core-support?view=vsmac-2019

Visual Studio 2019 Core App
https://dl.xamarin.com/VsMac/VisualStudioForMac-8.1.3.19.dmg (553mb)

Since it appears the core app is drag to application folder, a lot of the decencies may be mono / Xamarin related.

Xamarin Profiler
https://docs.microsoft.com/en-us/xamarin/tools/profiler/?tabs=macos

Xamarin Inspector & Workbook
https://docs.microsoft.com/en-us/xamarin/tools/inspector/release-notes/1.5

I don't need the Xamarin additional software, still trying to track down following related packages
com.xamarin.android.pkg
com.xamarin.monotouch.pkg
com.xamarin.xamarin-ios-build-host.pkg

KyleEricson
Valued Contributor II

@CSCC-JS  Thanks for the links this is what I came up with in Composer.


2022-01-20_11-03-58.png

#!/bin/zsh
# Created by Kyle Ericson
# Visual Studio 2019

if [[ $(arch) != "i386" ]]; then
        echo "M1"
        /usr/sbin/installer -pkg "/tmp/VS/dotnet-sdk-6.0.101-osx-arm64.pkg"  -target /
	

    else
        echo "Intel"
        /usr/sbin/installer -pkg "/tmp/VS/dotnet-sdk-6.0.101-osx-x64.pkg"  -target /
    fi
  
/usr/sbin/installer -pkg "/tmp/VS/MonoFramework-MDK-6.12.0.122.macos10.xamarin.universal.pkg" -target /
/usr/sbin/installer -pkg "/tmp/VS/profiler-mac-1.6.13-11.pkg" -target /
/usr/sbin/installer -pkg "/tmp/VS/XamarinInteractive-1.5.0.pkg" -target /

exit 0

 

Read My Blog: https://www.ericsontech.com

Thanks for capturing this Kyle it has been super helpful. One of our Developers mentioned that when using the Web API, Web Application, Web Application (Model-View-Controller) template nothing happens and the New Project window just hangs. Have you experienced this? 

Turns out the issue was .Net 6. Seems visual studio only likes 3 and 5: https://docs.microsoft.com/en-us/visualstudio/mac/uninstall-net-2019?view=vsmac-2019

johntgeck
Contributor

Hi there, did creating a Composer package work for you? I'm trying to get the Visual Studio (Preview) v17.5.0.1766 working on a lab running MacOS Ventura 13.0 and my policy is failing to install. Built the package using a New & Modified Snapshot. After the first failure I rebuilt the package with all permissions set to 777 (owner: root, group: wheel) just in case, reuploaded to Jamf Admin, rebuilt the policy with the new package, redeployed and got the same message. No further info in the install log or jamf logs on the device.

Copied from policy results:

 

Installing Visual Studio for Mac 17.5.0.110.pkg...
Installation failed. The installer reported: installer: Package name is Visual Studio for Mac 17.5.0.110
installer: Installing at base path /
installer: The install failed. (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance. An unexpected error occurred while moving files to the final destination.)

 

 

jimmy-swings
Contributor II

A manifest which contains the components available for installation can be found in the install.log.

[2023-06-06 12:27:13.977] [inf] Retrieving remote installation manifest from URL: https://aka.ms/vsmac/manifest/17-stable

You can use this manifest to download the latest artefacts and pull these into your own package for general distribution.

rstasel
Valued Contributor

For those hitting this in 2023 and Microsoft still hasn't given us a deployable package... 

Grab the downloader/installer from MS. Run it and pick the pieces you want to install. When you get to the prompt asking for a password to install mono, pause. 

Open up ~/Library/Caches/VisualStudioInstaller/downloads and grab all the packages from there, as well as the DMG of the actual app. 

Throw all the packages into a folder, and make a disk image of it. 

Open up your packaging tool, and have it "install" the dmg for those resource files, and the actual app into like /var/tmp or the like. 

Make a postinstall script that does something like

#!/bin/bash

#Mount DMGs
/usr/bin/hdiutil attach "/private/tmp/Visual Studio 2022 Resources.dmg" -noautoopen -nobrowse
/usr/bin/hdiutil attach "/private/tmp/visualstudioformac-17.6.3.421-x64.dmg" -noautoopen -nobrowse
/bin/sleep 8

#Loop through pkgs
cd "/Volumes/Visual Studio 2022 Resources"
for i in $(ls *.pkg); do
	#echo $i
	/usr/sbin/installer -pkg $i -target /
done

#Copy Visual Studio to applications
cp -Rp "/Volumes/Visual Studio/Visual Studio.app" "/Applications/Visual Studio.app"

/usr/bin/hdiutil detach "/Volumes/Visual Studio 2022 Resources"
/usr/bin/hdiutil detach "/Volumes/Visual Studio"
/bin/sleep 3
/bin/rm "/private/tmp/Visual Studio 2022 Resources.dmg"
/bin/rm "/private/tmp/visualstudioformac-17.6.3.421-x64.dmg"

Build the package and profit. 

Would be cool to utilize the json manifest posted above to just dynamically build or download the necessary files, but this seems to work just fine.