DEV Community

loading...

How to add a path to environment variable?

Kray-G
Although I used to be a C++/Boost lover, I was back to C with the spirit of Zen, or the spirit of "simple is the best". Also returning to rock and roll from metal, I'm really into Rolling Stones.
Updated on ・2 min read

Hello, everyone.

Introduction

How do you add/delete the path to/from Path environment variable in your installer?

In fact, I released the version 0.17.0 of Kinx and I implemented an installer.

Installer

But the path will NOT be added to the environment variable.

After wrote this article, I released v0.17.1 which automatically adds the path to the Path environment variable. I did also write a test code for addpath.exe, but I will be glad for you to review the source code anyway. Thanks in advance.

I researched how to do it on the web, but I didn't find it as I want. I was searching it with...

  • Simple Source Code
  • Easy to Use
  • Useful License

I wanted to use it in the NSIS script, but there seems to be some problems in NSIS.

Conclusion

I created a simple program. Look at this.

This is...

  • Simple Source Code ... Just one file there!
  • Easy to Use ... Simple command line interface to use.
  • Useful License ... That is MIT! ...did set it by me, although.

But...

This program will modify the system environment, so I feel a little scared. Therefore I want a lot of people to check the source code and I want to fix a problem if there is a problem.

If you are interested in it or you have time, I will be very happy for you to look at the source code.

And also, please let me know if you have any better solution for this problem.

See you!

P.S.
If you feel good to this, please push a star!

Discussion (0)