In this article we describe working in the Windows environment. Working in the Linux environment is described in the article "How to run PVS-Studio on Linux".
As for most of other software setting up PVS-Studio requires administrative privileges.
Unattended setup is performed by specifying command line parameters, for example:
PVS-Studio_Setup.exe /verysilent /suppressmsgboxes /norestart /nocloseapplications
PVS-Studio may require a reboot if, for example, files that require update are locked. To install PVS-Studio without reboot, use the 'NORESTART' flag. Please also note that if PVS-Studio installer is started in a silent mode without this flag, the computer may be rebooted without any warnings or dialogs.
By default, all available PVS-Studio components will be installed. In case this is undesirable, the required components can be selected by the 'COMPONENTS' switch (following is a list of all possible components):
PVS-Studio_setup.exe /verysilent /suppressmsgboxes /nocloseapplications /norestart /components= Core, Standalone,MSVS,MSVS\2010,MSVS\2012,MSVS\2013,MSVS\2015,MSVS\2017, MSVS\2019,IDEA,JavaCore,Rider
Brief description of components:
During installation of PVS-Studio all instances of Visual Studio / IntelliJ IDEA / Rider should be shut down, however to prevent user's data loss PVS-Studio does not shut down Visual Studio / IntelliJ IDEA / Rider.
The installer will exit with '100' if it is unable to install the extension (*.vsix) for any of the selected versions of Visual Studio.
The PVS-Studio-Updater.exe can perform check for analyzer updates, and, if an update is available, it can download it and perform an installation on a local system. To start the updater tool "silently", the same arguments can be utilized:
PVS-Studio-Updater.exe /VERYSILENT /SUPPRESSMSGBOXES
If there are no updates on the server, the updater will exit with the code '0'. As PVS-Studio-Updater.exe performs a local deployment of PVS-Studio, devenv.exe should not be running at the time of the update as well.
If you connect to Internet via a proxy with authentication, PVS-Studio-Updater.exe will prompt you for proxy credentials. If the proxy credentials are correct, PVS-Studio-Updater.exe will save them in the Windows Credential Manager and will use these credentials to check for updates in future. If you want to use the utility with proxy without authorization you can do it using proxy flag (/proxy=ip:port).
Another possible installation option is to use the Chocolatey package manager. When using this installation option, the package manager itself has to already be installed.
The installation command of the latest available PVS-Studio package version:
choco install pvs-studio
The installation command of a specific PVS-Studio package version:
choco install pvs-studio --version=7.05.35617.2075
When installing the package, you can also set the list of installed components in a similar way to those listed in the section "Unattended deployment" of this document. To specify components, use the flag '--package-parameters'. The components are equivalent to those described above and differ only in the syntax of some parameters:
Only the 'Core' component is installed by default. When listing the installation components, there is no need to specify 'Core'.
Here's the example of the command which the analyzer will install with the components 'Core' and 'Standalone':
choco install pvs-studio --package-parameters="'/Standalone'"
Different ways to enter the license when using various environments are covered in the documentation section "How to enter the PVS-Studio License and what's the next move".
If you want deploy PVS-Studio for many computers then you can install license without manual entering. It should place valid 'Settings.xml' file into folder under user's profile.
If many users share one desktop each one should have its own license.
Default settings location is the following:
It is user-editable xml file, but it also could be edited by through PVS-Studio IDE plugin on a target machine. Please note that all settings that should be kept as default values could be omitted from 'Setting.xml' file.