Windows: Use Graphviz without Installation

Graphviz is open source graph visualization software that is incredibly popular. In this post, we see how to run it on Windows without installing the software package.

As I am setting up my PC again, I am trying to reduce the number of things that require to be installed, i.e,, increase the number of things that can be used on Windows without needing to run the installer and letting it change things on the computer. I would very much prefer to unzip the package some place and then be able to use it, albeit with some adjustment to the path or such.

Fortunately, Graphviz is really simple. Just follow the steps below.

1. Download the zip archive from https://graphviz.org/download/ – I grabbed Graphviz-12.2.1-win64.zip for my use.

2. Unzip the package to a location on your PC. I use d:\apps as the folder path and unzipped Graphviz there. I prefer to rename the root folder to just Graphviz and put in a file with the version name in the folder, so it’s called Graphviz-12.2.1-win64.txt in my case. This is what the directory looks like.

 Directory of d:\apps\Graphviz

2024-12-27  05:44 PM    <DIR>          .
2024-12-27  05:44 PM    <DIR>          ..
2024-12-27  05:44 PM    <DIR>          bin
2024-12-27  05:44 PM                 0 Graphviz-12.2.1-win64.txt
2024-12-27  05:44 PM    <DIR>          include
2024-12-27  05:44 PM    <DIR>          lib
2024-12-27  05:44 PM    <DIR>          share
               1 File(s)              0 bytes

3. WIth that done, we are ready to use it. All the executables and DLL files are in the bin folder, so you just add it to the PATH so that it’s available on the path for other applications to use it.

4. To try it out first, let’s just add it to the PATH from the command line to see how it behaves.

$ PATH=d:\apps\graphviz\bin;%PATH%

$ REM Now, let's try to run dot

$ dot -?
Usage: dot [-Vv?] [-(GNE)name=val] [-(KTlso)<val>] <dot files>
(additional options for neato)    [-x] [-n<v>]
(additional options for fdp)      [-L(gO)] [-L(nUCT)<val>]
(additional options for config)  [-cv]

 -V          - Print version and exit
 -v          - Enable verbose mode
 -Gname=val  - Set graph attribute 'name' to 'val'
...

This looks fine!

I created a simple sample.txt with this description in it: digraph { a -> b } and then did this:

$ dot -Tpng sample.txt > sample.png

The created sample.png is as below.

5. Since all looks good, we have a few choices:

  • Add it to the PATH only when we want to use it
  • Add it permanently to the PATH for all users
  • Add it permanently to the PATH for the current user

The first option is the same as what we did right now. Add Graphviz to the PATH whenever you want to use it.

For the other 2 options, i.e., if you want to make this permanent, just add it to your Environment Variables – see this post on how to change the PATH or add a system environment variable for the current user or for all users in Windows.

Hope this helps.