Skip to content

Installing & Upgrading CTk Theme Builder

Clive Bostock edited this page May 4, 2024 · 58 revisions

Disclaimer

These instructions are provided for informational purposes only. While I have made every effort to ensure their accuracy, I cannot guarantee that they will work flawlessly in all environments.

Requirements

You must have Python installed. Tested versions include:

  • Python 3.10;
  • Python 3.11;
  • Python 3.12.

Python 3.8 and 3.9 will possibly be OK, but limited help can be provided for any isses.

The application has been tested on:

  • Linux Mint 21.1;
  • Linux Mint 21.3;
  • Windows 10;
  • Windows 11;
  • MacOS Sonoma (Apple Mac Mini - Intel).

You will require around 160MB of disk space.

Ubuntu Based Linux Distributions

For Ubuntu based distros (e.g. Linux Mint, Elementary OS, Zorin OS...), please ensure that you have ensurepip installed. This can be installed via the command:

apt install python3.10-venv

Installation

The theme_builder_setup.py Utility

Installations and upgrades are performed using the theme_builder_setup.py utility. In situ patching can be performed using theme_builder_setup.py, but it can also install/upgrade from a package in the form of a ZIP file. This latter method, using a ZIP package, is the recommended way to install or update the application.

The theme_builder_setup.py utility expects a parent directory to be supplied. For new installations, using a ZIP package, it will create a sub-directory, ctk_theme_builder, in which the application is installed.

To obtain a list of options, run the command:

python theme_builder_setup.py -h

Note that with some Python installations, you may need to run the above command with python3, instead of python.

ZIP Packages

To obtain a ZIP package, look at the available releases of CTk Theme Builder, on the GitHub project page. The installable archives start with "ctk_theme_builder-", followed by the version, and ending with .zip. For example: ctk_theme_builder-3.1.0.zip`

Install using the following steps:

  1. From the zip file, extract the theme_builder_setup.py file.
  2. Run the install command using both the -i and -p flags.

You need a command window to run the setup utility. On windows, you should be able to right click a folder in Windows Explorer, and select CMD Prompt Here. Another option is to click the Windows search (bottom left) and where it says Type search here, enter the commend CMD and press Enter. There is also a further option, simply enter the text CMD, into the navigation field at the top of Windows Explorer and press Enter.

For Linux, you can open a Terminal. This is often available as a menu option, but if not, you may need to Google the subject for your specific Linux distribution.

In the examples here, we assume we are installing CTk Theme Builder 3.1.0.

NOTE: If you have an old version of the theme_builder_setup.py file sitting on your hard drive, it is important that you discard it and extract the latest version.

Windows Example

Here we assume that the "apps" and "temp" directories don't already exist, and that we have opened a terminal window. We then enter the commands:

c:
mkdir apps
mkdir temp

If either or both of these already exists, then ignore the respective mkdir command.

Next we download the installation package to the C:\temp folder, and extract the theme_builder_setup.py file from the ZIP file, into the C:\temp folder. Once done, we then open a command window and type:

py c:\temp\theme_builder_setup.py -p c:\temp\ctk_theme_builder-3.1.0.zip -i c:\apps

Once successfully completed, you should find a ctk_theme_builder folder has been created inside the c:\apps folder. In addition, for version 2.5 of CTk Theme Builder, and later, you should find a log of the installation, within the ctk_theme_builder directory.

NOTE: If you get a "file not found error", please ensure that you are using a full path-name to the file. However, this should no longer be required on releases later than 3.1.0.

Linux Example

Here we are in a Linux environment, and we assume that we already have a /home/clive/utilities folder and that the install package is downloaded to /tmp. As with windows, you need to open a terminal window, to get a command prompt.

Having extracted the theme_builder_setup.py file from the ZIP file, into the /tmp folder, we type:

python /tmp/theme_builder_setup.py -i /home/clive/utilities -p /tmp/ctk_theme_builder-3.1.0.zip

NOTE: If you get a "file not found error", please ensure that you are using a full path-name to the file.However, this should no longer be required on releases later than 3.1.0.

If one doesn't already exist, this will cause a ctk_theme_builder directory to be created, below the utilities folder. The ZIP file will be unpacked to the folder and the application will be set up into an executable state.

If there is already an installation of ctk_theme_builder, below the specified installation location, theme_builder_setup.py will attempt an upgrade.

If the installation is already at the same version as that contained in the ZIP archive, the theme_builder_setup.py will run in a "fix" mode. For example if you have accidentally removed your venv folder, it will fix it.

MacOS Example

For MacOS users, the process is similar, except you should omit the -i flag. This will result in CTk Theme Builder being installed under your home directory.

Assuming you have clicked the link and downloaded the file, then it should appear in your current login user's downloads directory. That being the case, and assuming for example, that the downloaded file name is of the form ctk_theme_builder-x.y.z.zip, where the x.y.z represents the downloaded version, we would open a Terminal window and enter the commands:

cd $HOME/Downloads

unzip -j ctk_theme_builder-x.y.z.zip ctk_theme_builder/theme_builder_setup.py

python3 theme_builder_setup.py  -p $HOME/Downloads/ctk_theme_builder-x.y.z.zip

This should result in CTk Theme Builder being installed in your home directory, where you can launch it using the command:

$HOME/ctk_theme_builder/ctk_theme_builder.sh

If you need to install Python, the simplest way is to use Homebrew. Here is an example:

brew install python
brew install python-tk

Note that the above commands will install the latest version of Python available via Homebrew. If you want to install an earlier version, then you can list the versions using the brew search python command. You can install a specific version using brew install [email protected]. For example: brew install [email protected].

Launching CTk Theme Builder

There are a number of options, for launching CTk Theme Builder, and these vary slightly depending on the operating system. One common method for them all is to launch using the ctk_theme_builder command. The most basic way is to open a CMD/Terminal window and type in a command.

For example, if you had installed CTk Theme Builder in a ``/u01/utilities/ctk_theme_builder`folder, then you could launch, using the following:-

Linux example:

/u01/utilities/ctk_theme_builder/ctk_theme_builder

MacOS example:

~/ctk_theme_builder/ctk_theme_builder

Alternatively:

$HOME/ctk_theme_builder/ctk_theme_builder

This assumes that CTk Theme Builder is installed to you home directory. You could install to /Applications, however, this won't result in the application being visible via launchpad.

Windows example:

C:\utilities\ctk_theme_builder\ctk_theme_builder

On Windows, the above should cause the ctk_theme_builder.bat file, located in the CTk Theme builder application home directory to be executed.

On Linux and MacOS, the ctk_theme_builder is a hard link to ctk_theme_builder.sh.

The upshot is that you can also invoke a launch of CTk Theme Builder with ctk_theme_builder.bat or ctk_theme_builder.sh, depending on your operating system.

If you open the CMD/Terminal window inside the ctk_theme_builder folder, then instead of typing the full pathname, you could simply type:

./ctk_theme_builder (Linux / MacOS)

OR

.\ctk_theme_builder (Windows)

PATH Variable

You need to change your operating system PATH variable, to include the Python installation directory. You may need to Google how to do this, based on whichever operating system you are using.

On Windows there is an option when you install Python, which allows you to add Python to your PATH. Look out for a checkbox of similar which facilitates this, during the installation dialogue.

Desktop Launchers

Most operating systems, with a Graphical User Interface, tend to provide a launcher mechanism which can be set up on the desktop.

For example, you can create a desktop shortcut on Windows, in order to launch the ctk_theme_builder script described earlier. Linux ports tend to have similar(ish) facilities.

You'll need to Google how to set up a shortcut / launcher for your specific operating system.