ben lindley-start
ben lindley-start

Reputation: 1

Can you add windows environment variables into a .exe?

I generated .exe that works fine on my computer where I have added the environmental variable but wont run on computers where I have not added it. Any help would be amazing. Its specifically SSL certification in order to request the twitter API.

Upvotes: 0

Views: 25

Answers (1)

Wikiti
Wikiti

Reputation: 1636

If you're using Ruby, you may want to use default values for your environmental variables. For example, at the beginning of your program:

foo = ENV['MY_ENV_VAR'] || "my alternative and portable value"

The level of abstraction you want to apply to this is up to you.

If you're using keys or other secret values, you may want to use external and embedded text files, with a gem like app_configuration.

Upvotes: 1

Related Questions