Skip to content

Windows default launch procedure loses current environment #8578

@Nebur99

Description

@Nebur99

When starting Ghidra with the original batch files, environment variables are 'reset' due to the use of the 'start' command with the option '/I'.
Documentation of '/I' (from ss64.com):

/I         Ignore any changes to the current environment, typically made with [SET](https://ss64.com/nt/set.html).
           Use the original environment passed to cmd.exe

It would be great if we could get rid of '/I' so the environment the user might have created specifically to run Ghidra isn't silently ditched.

Different from the current situation, things like running Ghidra with a python venv would work out-of-the-box then.
This is required for example to run the debugger with dbgeng w/o 'contaminating' the host system with the very specific python packages the debugger setup needs.

Launching ghidra in 'foreground' mode (passing argument 'fg' instead of 'bg') also keeps the current environment, so things would just work the same for fg and bg modes, which seems like a plus to me .

This is the relevant file / line I'm referring to:

start "%APPNAME%" /I /B "!JAVA_CMD!" %CMD_ARGS%

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions