Skip to content

Add Processing to the PATH on Windows for easy CLI access #1097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Mathew-D opened this issue May 15, 2025 · 13 comments
Open

Add Processing to the PATH on Windows for easy CLI access #1097

Mathew-D opened this issue May 15, 2025 · 13 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed pde Processing Development Environment windows

Comments

@Mathew-D
Copy link

Mathew-D commented May 15, 2025

Most appropriate sub-area of Processing 4?

Utilities, Core/Environment/Rendering

Processing version

4.4.3

Operating system

Windows

Steps to reproduce this

processing cli --sketch=c:\test\shapes --run

snippet

void setup() {
size(500,500)
}

void draw() {

}

Additional context

The cli command works great in Linux but doesn't exist in windows.

Would you like to work on the issue?

no

@Mathew-D Mathew-D added the bug Something isn't working label May 15, 2025
@Stefterv
Copy link
Collaborator

Stefterv commented May 15, 2025

Hi @Mathew-D yes we are not yet adding the Processing cli to the command line directly. You can use it by using the full Processing path:

 & "C:\Program Files\Processing\Processing.exe" cli --sketch=... 

We'll research later how to add it directly to the console

& "C:\Program Files\Processing\Processing.exe" --help 2>&1 | Out-String 

To see the cli output

@Stefterv Stefterv added enhancement New feature or request help wanted Extra attention is needed windows pde Processing Development Environment and removed bug Something isn't working labels May 15, 2025
@Stefterv Stefterv changed the title Windows processing cli Add Processing to the PATH on Windows for easy CLI access May 15, 2025
@Stefterv
Copy link
Collaborator

To add more info if someone wants to pick up this issue, we would need a method added to WindowsPlatform that will add C:\Program Files\Processing\ to the PATH environment variable or similar to how it works on macOS with a custom script in a directory that is included in PATH by default.

@Stefterv
Copy link
Collaborator

Would also be worthwhile to look if adding to the PATH can be added to the Wix Toolset installer.

@Mathew-D
Copy link
Author

When I try: C:\processing\processing cli --sketch="c:\Users\mathew\Downloads\test" --run
I get Failed JVM with the portable version put into the "C:\processing" folder
With the Windows installed version running the command:
"C:\Program Files\Processing\Processing.exe" cli --sketch="C:\Users\mathew\Downloads\test" --run

The IDE opens with a blank file.

@Stefterv
Copy link
Collaborator

For the second one starting with the & is important because the path has a space in it

@Stefterv
Copy link
Collaborator

Also important to check if both versions are 4.4.3 as that's where the CLI was introduced

@Mathew-D
Copy link
Author

The portable was 4.4.3. I mistaken got the installed version from the site so it was only 4.4.1 but I just uninstalled and installed the prerelease from github and the mistake I had was missing a ; on the one line and that was giving me Failed to Launch JVM without any errors being passed back.

@jdebou
Copy link

jdebou commented May 22, 2025

Hi, I think this can be done through the wix installer by adding a quiet execution custom action. Maybe this can be an optional choice in the installer? I would be happy to work on this.

@Stefterv
Copy link
Collaborator

Hi @jdebou Thank you for jumping on this! Whilst you are modifying the Wix Toolset Installer, and happen to see a way to fix #1042 alongside the work on this, please do!

@jdebou
Copy link

jdebou commented May 23, 2025

I've been looking into that other issue, and if we want to make it possible to install without admin privilege it should also be possible to add processing to PATH without such privilege. This pushes us towards editing the $profile files so that processing gets added to the path when the user starts a new powershell session.

This can be done without administrator privilege during the installation, using the [INSTALLFOLDER] provided by wix.

I am making some progress building and packaging on my local environment, and going forward I'd like to make sure that what I am doing gets as close as possible to the CI environment. Am I right to assume that the github actions runner is using powershell for all windows workflows ?

@Stefterv
Copy link
Collaborator

Thank you for the update!

Adding to PATH when installing without admin privileges is not necessary if it requires us to have two different solutions for both cases. So in this case let's stick to adding to PATH only even though it makes it limited to admin install.

Whilst thinking about this I also came across this: https://docs.firegiant.com/wix3/xsd/wix/environment/ its a way for WIX to modify the environment variables and seems like it would be a more direct approach than the quiet execution.

To test the CI system you can enable the actions on your own fork of Processing and it will create unsigned builds on push to any branch.

@jdebou
Copy link

jdebou commented May 24, 2025 via email

@jdebou
Copy link

jdebou commented Jun 6, 2025

Hi, I found some time to get this somewhere. I can build the msi on my fork, which correctly edits env:Path to append the path to processing installation folder. This allows using the processing cli right away.

To get it to work with actions on a fork I had to edit the release_gradle.yml file, which should not be included in the PR. Should I clean it up before opening a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed pde Processing Development Environment windows
Projects
None yet
Development

No branches or pull requests

3 participants