T O P I C R E V I E W |
jhaynesWTD |
Posted - Jul 18 2022 : 1:47:15 PM Hi, I'm trying to automate installing Visual Assist for Visual Studio 2022 as we use concurrent licenses with a license server. We have a scripted deployment of Visual Assist for Visual Studio 2017 and 2019 and these work absolutely fine. However I know we need to install the x64 .VSIX installer for Visual Studio 2022 Our current deployment which works, we make use of VSWhere.exe to scan the system for installs of Visual Studio
# Get installed IDE paths $content = & "$PSScriptRoot\vswhere.exe" -legacy -format json | ConvertFrom-Json $paths = $content | Select-Object -ExpandProperty installationPath $path2 = $paths | Where-object {$_ -like "C:\Program Files\Microsoft Visual Studio*"}
So the $Paths variable now holds the below output,
For example when running this on a machine locally where VSWhere.exe exists on the root of the E:\ drive PS E:\> $content = & "$PSScriptRoot" -legacy -prerelease -format json | ConvertFrom-Json $paths = $content | Select-Object -ExpandProperty installationPath write-output $paths C:\Program Files\Microsoft Visual Studio\2022\Professional C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional C:\Program Files (x86)\Microsoft Visual Studio 14.0 This grabs all the installs as you can see from the above output which is fine for the standard .VSIX install, however for x64 .VISX installer we only want to search for VS2022 / 64bit installs currently so, below is how I'm doing this where I made a new variable called Paths2 where it looks in the 64bit install path for all Visual Studio installs.
PS E:\> $content = & "$PSScriptRoot" -legacy -prerelease -format json | ConvertFrom-Json $paths = $content | Select-Object -ExpandProperty installationPath $path2 = $paths | Where-object {$_ -like "C:\Program Files\Microsoft Visual Studio\*"} write-output $path2 C:\Program Files\Microsoft Visual Studio\2022\Professional
Then I get the above output. So then I go to try and install VA for each IDE which in this case just Visual Studio 2022 So below is how I'm doing this which works for our current Visual assist deployment for Visual Studio 2017 and 2019.
# Install for each IDE $paths2 | ForEach-Object -Process { Start-Process "$_\Common7\IDE\VSIXInstaller.exe" -ArgumentList "/quiet $PSScriptRoot\VA_X_Setup2451_0_x64.vsix" -Wait }
Now I'm far from a powershell wizard so not expecting most people to understand the above, but for the life of me I can't figure out why this isn't working. It just doesn't install Visual Assist for Visual Studio 2022 silently.
If I run the VA_X_Setup2451_0_x64.vsix installer it will show the GUI and detect only Visual Studio Professional 2022 and let me install fine Or if I run VA_X_Setup2451_0.exe from command line this also works and shows the GUI and lets me install for Visual Studio Professional 2022, 2019 and 2017 no problem.
But If I run VA_X_Setup2451_0.exe /S from command line which is the silent install, it will then only proceed to install for 2017 and 2019 IDEs but not 2022. It's almost like 2022 doesn't like silent installs. However in our org we need to deploy our deployments silently where possible so I don't want to have to resort to forcing to prompt all our end users to GUI.
Any help would be appreciated here. Regards, James
|
3 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Jul 19 2022 : 11:35:49 AM I am glad this worked as expected on another machine, but if you do see any further problems please feel free to ask. My next suggestion would be to try tracking what is going on via Process Monitor:
https://docs.microsoft.com/en-us/sysinternals/downloads/procmon
very helpful, but it also logs a LOT, so careful use of filters to focus on what you are interested in is important. But if our installer is listing VS2022 as an IDE to install into then it should be installing VA in silent mode, so that is strange. |
jhaynesWTD |
Posted - Jul 19 2022 : 08:44:15 AM Thanks for this feline.
I was using my work PC as my test computer, however since your reply I've checked the %TEMP% folder and saw it wasn't producing any logs when I was trying to install Visual Assist using my Visual Studio 2022 deployment and when running VA_X_Setup2451_0.exe /S from command line I only saw in the logs it was detecting VS 2017 and 2019 which was interesting.
So I decided to go setup another test PC to rule out my work machine and behold it works fine on the new test machine when running VA_X_Setup2451_0.exe /S from command line and I've just tested my Visual Studio 2022 deployment of Visual Assist and this also works on the new test machine. I'm just going to roll this out to a few more machines now for testing but I think we can mark this one as resolved. Thanks for the reply and help feline! |
feline |
Posted - Jul 19 2022 : 07:14:37 AM I am not sure what is going wrong here. Testing under Windows 10, with VA 2451 exe installer, and using the /S command line, so manually running the command:
VA_X_Setup2451_0.exe /S
on the Windows command line, VA was installed for VS2017, VS2019 and VS2022 without any problems. All three IDE's are installed to C drive though, so it's possible this is a factor.
The /quiet command line switch is the correct switch for the VSIX installer, and again, running a command from the command prompt, the command:
"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VSIXInstaller.exe" /quiet "C:\Users\%USERNAME%\Downloads\VA_X_Setup2451_0_x64.vsix"
works correctly, silently installing VA for VS2022 only. I have just double checked this here.
If I am understanding what you are doing correctly, it looks like you are generating the same commands.
The fact that exe installer lists VS2022 when run normally, but doesn't install to it when run with the /S command is worrying, and is definitely not what I am seeing here. Assuming you have a test machine where you can re-run this, can you run the exe installer with the /S command and then please look in the %TEMP% directory for vsix*.log files. Hopefully one of these will reference trying to install for VS2022, and will explain why VA wasn't silently installed.
Assuming the installers are offering to install correctly I would try generating the install commands as whole strings, so they can both be written out to debug, and then executed, so that you can see exactly what command is being run. The only obvious thing I can think is that since vswhere produces several blocks of information, one per IDE, you are accidentally trying to use a VS2017 / VS2019, so 32bit vxisinstaller for the VS2022, 64bit, installer, which I can see failing. |
|
|