Skip to content

Creating a standalone .exe on the pc

David Stirling edited this page Apr 28, 2021 · 6 revisions

NOTICE: This page contains build instructions for the CellProfiler-Analyst 2.0 series. For the 3.0 series, run Pyinstaller with the `.spec` files found in the /distribution folder.


  • First make sure you've fully updated CPA from GitHub.
  • Since CPA contains dependencies from CellProfiler, clone the CellProfiler repository and follow the instructions here for installing Java, Microsoft compilers, Python and the Python libraries.
    • Make sure that the JAVA_HOME environment variable is set
    • In addition to the dependenices listed above, you will also need the scikit-learn library.
  • Also make sure that you have installed InnoSetup and py2exe.

Build the .exe

  • Remove any old build/ or dist/ directories:
    del /F build dist
  • cd to the cpa folder in the CPA folder, and run the py2exe build script:
    python setup_py2exe.py py2exe
    • If it errors with message that a .DLL can't be found, often the missing DLL can be found on the web. For example, many DLL's can be found here
  • Run .\dist\cpa.exe and make sure it works. If it errors, a file 'cpa.exe.log' will appear that contains the error message.
  • Take special note of the revision # in the title bar (eg: in "CellProfiler Analyst 2.0 r8582" 8582 is the revision #). We'll need this later.

Create the Installer

  • From the CPA folder, open CellProfilerAnalyst.iss in Inno Setup and edit the OutputDir field to the desired location
  • Run the Setup builder by clicking the little green arrow in Inno Setup. This will create an .exe in the output folder specified above
  • Double-clicking this file will launch an installer which will have options for installation location, whether to create desktop icons, Start Menu folders, etc