General

Installing or Upgrading CodeSonar

This is the main section for CodeSonar installation instructions.



Where To Install

Install CodeSonar:

Note in particular that you do not need to install CodeSonar on machines that will only be browsing analysis results through the CodeSonar Web GUI.

Kubernetes Note

As an alternative to installing CodeSonar directly, you can use the CodeSonar 64-bit Linux installer to install and run CodeSonar on a Kubernetes cluster. You can run both your hub and your analyses on the cluster, or run your hub on the cluster and perform analyses elsewhere.

If you wish to deploy CodeSonar on Kubernetes, follow the instructions in section Install CodeSonar on a Kubernetes Cluster.

If You Are Upgrading

If you are upgrading an existing CodeSonar installation, follow these steps. $CSONAR refers to the CodeSonar installation directory.
If you are not upgrading, go on to Installing/Upgrading CodeSonar

  1. Are you using CodeSonar SaaS?
  2. Are you responsible for a CodeSonar license server? (Note that in most cases you will not be running a license server.)
  3. Do you want to also keep your previous CodeSonar installation on this machine?

    CodeSonar SaaS Note: if you are only using SaaS analyzers managed by CodeSecure, there is no need to keep your previous installation. If you have performed some or all of your analyses locally (that is, without using SaaS analyzers), you may wish to keep the previous installation for convenience as described below.

    If you keep your previous CodeSonar installation, you will retain the ability to view information (in particular, source file listings) that is stored in the analysis directories for analyses performed on this machine with the previous installation. If you do not keep your previous CodeSonar installation, you will only be able to view this information once you have re-analyzed the project with the upgraded installation. Note that this applies only to information stored in the analysis directory. Most information, including warning reports, is stored on the hub and will remain available regardless of whether or not you keep the previous installation.

  4. If you have edited your configuration template file, $CSONAR/codesonar/template.conf, save a copy of it somewhere outside $CSONAR.
  5. If you want to use the same CodeSonar installation directory as previously, you will need to uninstall. Run the uninstaller: %CSONAR%/Uninstall.exe (you can also run the uninstaller by selecting All Programs / CodeSonar / Uninstall from the Windows Start menu).
  6. Install CodeSonar as described below.
  7. Follow the instructions in Upgrading Configuration Files to merge your old configuration files with the newly installed ones.
  8. Are you using CodeSonar SaaS?

Installing/Upgrading CodeSonar

You will receive email from CodeSecure with download instructions that include the following.

If you haven't already done so, download the installation file now:

  1. Open the download site in your web browser. If you cannot locate the email with the URL, use https://links.codesonar.com/support/login/.
  2. Authenticate using the download credentials provided in the email from CodeSecure. If you don't recall your password, click the Please remind me link at the bottom of the page and follow the password recovery instructions provided.
  3. Download the installation file for your operating system.
  4. [Optional] You can use the link provided to create a customized CodeSonar setup guide and follow that rather than working through the remainder of these instructions.

Your downloaded file will be a Windows installer whose name is codesonar-9.0p0.20250314-x86_64-pc-win64.exe (the date stamp part of the name may vary).

The installer must be run by a user with Windows Administrator privileges. If necessary, consult your system administrator to arrange installation.

Run the installer, following the on-screen instructions.

If you are running Windows Vista or later with User Account Control enabled, your system will pop up a dialog asking for permission to continue running the installer.

Click Continue to proceed with installation.

Screenshot: Installer,
          initial screen Click Next to start working through the setup wizard.
Screenshot: Installer,
          license screen Read and accept the CodeSonar license.
Screenshot: Installer,
          statistics upload opt in/out screen Specify whether or not you wish CodeSonar to upload anonymous usage statistics to CodeSecure. You can enable or disable uploading at any time.
Screenshot:
           Installer, component selection screen If you want to use CodeSonar on CodeWarrior projects, select CodeWarrior Support on the Choose Components screen. For more information see CodeSonar with CodeWarrior.

Leave Set Firewall to Allow Connections selected to have the installer automatically add Windows firewall rules permitting communications with any CodeSonar hubs you start. Deselect it if you will not be starting any hubs, or if you prefer to add firewall rules manually.

Screenshot:
            installation folder selection screen Specify an installation folder for CodeSonar.
Screenshot:
            start folder selection screen Select a Start menu folder for CodeSonar shortcuts.
Screenshot:
             Installer, installing CodeSonar will be installed on your machine.
Screenshot:
             Installer, last screen Once installation has finished, the final screen is displayed.

Silent Installation

You can run the CodeSonar installer silently from the command line. This is most likely to be useful for organizations where IT staff will be performing installation for users.

codesonar-9.0p0.20250314-x86_64-pc-win64.exe /S <other_options>

Additional Options for Silent Installation

/D=path CodeSonar will be installed at path. (The default installation location is C:\Program Files\CodeSecure\CodeSonar.)
/NOREG={yes,no} Default: no
no The installer will make some modifications to the registry and global system state.
yes The installer will not modify the registry or any global system state. In particular:
  • The CodeSonar build driver will not be installed. Instead, CodeSonar will install it the first time you perform a build/analysis, either silently or—if required by your User Account Control settings—after you have given permission.
  • The CodeSonar uninstaller will not be registered.
  • Firewall settings will not be registered.
/NOCRT={yes,no} Default: no
no The VC++ CRT will be installed.
yes The VC++ CRT will not be installed. Specify /NOCRT=yes if you know the VC++ CRT has already been installed want the installer to skip attempting to reinstall it.
/SM=path/to/shortcutdir The installer will place a CodeSonar shortcut in the directory specified by path/to/shortcutdir. There are two likely use cases.
  • You have multiple CodeSonar installations and want both to have shortcuts on the Start menu.
    In this case, you will need to specify a subfolder of the Start Menu folder that does not currently contain a CodeSonar shortcut (otherwise the newly-installed shortcut will overwrite the existing shortcut). One option is to create a subfolder CodeSonarver for each CodeSonar version ver you have installed
    For example, on Windows 10 with default Start Menu folder location: C:\ProgramData\Microsoft\Windows\Start Menu\CodeSonar9.0p0
  • You don't want the shortcuts to appear in your Start menu.
    Specify a path to an alternative location for the shortcuts. For example, you might choose to locate them in the Task menu, or to place them in the folder of your choice and then navigate to that folder with the Windows file explorer when you want to start CodeSonar.

If not specified, the installer will place the shortcut in the Start Menu folder, and it will appear in the Start menu.

Silent Uninstallation

You can also uninstall CodeSonar silently:

Uninstall.exe /S

Now go on to Setting Up The Hub.