Environment Variable for running in Electron #357

Closed
opened 2026-01-29 16:37:25 +00:00 by claunia · 1 comment
Owner

Originally created by @robertmclaws on GitHub (Jul 7, 2019).

Originally assigned to: @GregorBiswanger on GitHub.

Is there currently a safe way to detect whether or not an app is running in Electron? If not, would it be possible for you folks to be able to compile in an environment variable (like "IS_ELECTRON") when a .NET app is running under Electron.NET? Right no I'm having to make my users add it manually, but it would be nice if I could detect it automatically.

Thanks!

Originally created by @robertmclaws on GitHub (Jul 7, 2019). Originally assigned to: @GregorBiswanger on GitHub. Is there currently a safe way to detect whether or not an app is running in Electron? If not, would it be possible for you folks to be able to compile in an environment variable (like "IS_ELECTRON") when a .NET app is running under Electron.NET? Right no I'm having to [make my users add it manually](https://github.com/CloudNimble/ElectronNET.Blazor#installation-instructions), but it would be nice if I could detect it automatically. Thanks!
claunia added the Feature label 2026-01-29 16:37:25 +00:00
Author
Owner

@GregorBiswanger commented on GitHub (Jul 8, 2019):

Hi @robertmclaws

we have the static property HybridSupport.IsElectronActive

is that what you want?

@GregorBiswanger commented on GitHub (Jul 8, 2019): Hi @robertmclaws we have the static property `HybridSupport.IsElectronActive` is that what you want?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#357