Dev Mode vs Production Build

📘 General go v1

Flowork OS alters its behavior based on whether it is running from source (Dev Mode) or a compiled binary (Production Build). Learn how the engine relies on executable path detection to switch profiles.

Environment Switching

Flowork consists of thousands of lines of code unified across three layers. Running the raw source code and running the final packaged executable are completely different operational states.

How The Engine Knows

The Go engine uses clever path-sniffing. When executing go run main.go, Golang actually compiles a temporary binary deep inside the user's AppData/Local/Temp/go-build folder and runs it.

The engine reads its own location using os.Executable(). If the string "temp" or "go-build" is present, it assumes it is a developer.

When Dev Mode is true:

  • The Auto-Updater is skipped entirely.
  • File writes read the local repository directory, rather than locking to the exe folder.
  • Additional diagnostic endpoints may be exposed.

How Electron Knows

Electron relies on the boolean app.isPackaged. When developers run npm start, this is false. When the build:portable script finishes packaging gui.exe, this becomes true.

When false:

  • The FloworkData folder is instantiated inside the repository source structure.
  • When true, it is instantiated parallel to the .exe location ensuring complete portability on user systems.