0

So right now I'm making a program where I want to be able to run it from the commandline. I know how to add a programs path to an environment variable, but I can't figure out how to make it so within an installer. In a way I want it to be like Python you install it and can then run it everywhere.

I have tried reading docs and searched the internet, but I could only find answers to how to do it manually. The thing I want though is to automate this in the installer. So how do I add my installed applications path to environment variable via code?

Just to clarify I have a picture here of where I want to save the location of the file

Image of where I want to add a string

Thx in advance

Martin
  • 39,569
  • 20
  • 99
  • 130
Klv13
  • 1
  • 2
  • 3
    "make a program an environment variable" doesn't make any sense. Are you saying you want to append to the PATH windows environment variable (either User scope or Machine scope) with the directory where your exe is located at, so that a user simply needs to type the name of the exe rather than its absolute path? – gunr2171 Nov 17 '22 at 18:02

0 Answers0