Skip to content

Toggle Release

Stable

Toggling a release switches its active state in DCS World: if the release is currently disabled, toggling it enables it; if it is currently enabled, toggling it disables it.

PropertyValue
Applies toDaemon
TriggerUser requests a state change on a release without specifying the target state
PreconditionsThe release has been added and all download and extract jobs have completed

Inputs

releaseId : String, required. The identifier of the release to toggle.

Assertions

AssertionStatus
The release must exist in the Daemon's local storeImplemented
If enabling: the release must be ready — all download and extract jobs must have completedImplemented
If enabling: the mods directory must be configured and exist on diskImplemented
If enabling: the DCS path must be configured for each symlink destination root referenced by the releaseImplemented

Outputs

Result<void, ReleaseToggleError> : On success, returns void. On failure, returns one of the following error types:

ReleaseNotFound : The release does not exist in the Daemon's local store.

ReleaseNotReady : The release has incomplete download or extract jobs. Only returned when toggling from disabled to enabled.

DropzoneModsDirNotConfigured : The mods directory has not been configured or does not exist on disk. Only returned when toggling from disabled to enabled.

DcsPathNotConfigured : The DCS path required to resolve symlink destinations has not been configured. Returned when toggling in either direction if the DCS path is needed to rebuild mission scripting files.

SymlinkCreationFailed : A symlink could not be created on disk. Only returned when toggling from disabled to enabled.

Effects

The effects depend on the direction of the toggle.

When enabling (disabled → enabled):

EffectStatus
Symlinks are created on disk in the DCS World directoriesImplemented
The installed path of each created symlink is recorded in the Daemon's local storeImplemented
The release is marked as enabled in the Daemon's local storeImplemented
Scripts/DropzoneMissionScriptsBeforeSanitize.lua is rebuilt to include before-sanitize mission scripts from this releaseImplemented
Scripts/DropzoneMissionScriptsAfterSanitize.lua is rebuilt to include after-sanitize mission scripts from this releaseImplemented
removeSymlinks.bat is rebuilt to include the newly created symlinksImplemented
On failure during symlink creation, all symlinks created so far are rolled back by the Linker. If symlink creation succeeds but a later step (e.g. mission script rebuild) fails, symlinks and stored paths remain in place.Implemented

When disabling (enabled → disabled):

EffectStatus
Symlinks are removed from disk using the installed paths stored in the Daemon's local storeImplemented
The installed path of each successfully removed symlink is cleared from the Daemon's local storeImplemented
If a symlink cannot be removed, a warning is logged and the installed path is left in placeImplemented
The release is marked as disabled in the Daemon's local storeImplemented
Scripts/DropzoneMissionScriptsBeforeSanitize.lua is rebuilt to exclude before-sanitize mission scripts from this releaseImplemented
Scripts/DropzoneMissionScriptsAfterSanitize.lua is rebuilt to exclude after-sanitize mission scripts from this releaseImplemented
removeSymlinks.bat is rebuilt to exclude the removed symlinksImplemented

Behavior

mermaid
flowchart TD
    Start([toggleRelease releaseId]) --> Lookup[Look up release by ID]

    Lookup --> State{release.enabled<br/>is true?}

    State -- Yes --> Disable[Delegate to disable releaseId]
    State -- "No (disabled or not found)" --> Enable[Delegate to enable releaseId]

    Disable --> DisableOk{Disable succeeded?}
    DisableOk -- Yes --> Done([Release reaches DISABLED state])
    DisableOk -- No --> DisableErr([Reject: ReleaseToggleError])

    Enable --> EnableOk{Enable succeeded?}
    EnableOk -- Yes --> Done2([Release reaches ENABLED state])
    EnableOk -- No --> EnableErr([Reject: ReleaseToggleError])

    style DisableErr fill:#f87171,color:#fff
    style EnableErr fill:#f87171,color:#fff
    style Done fill:#4ade80,color:#000
    style Done2 fill:#4ade80,color:#000

Note: The toggle operation does not perform its own existence check. If the release does not exist, enabled is falsy, so the enable path is taken. The enable delegate then returns ReleaseNotFound.

See Also

  • Enable Release — Spec page for the enable path that toggle invokes when the release is disabled.
  • Disable Release — Spec page for the disable path that toggle invokes when the release is enabled.
  • Add Release — Spec page for downloading a release before it can be toggled.
  • Remove Release — Spec page for fully removing a release from the Daemon.
  • How the Daemon works — Guide covering the symlink mechanism and mission scripting files.