Skip to content

Windows DSL inconsistency: align MSI and NSIS install-scope APIs #225

@kdroidFilter

Description

@kdroidFilter

Problem

After #224, MSI install scope is controlled by windows.perUserInstall while NSIS uses windows.nsis.perMachine. This creates three asymmetries inside the same windows { … } block:

NSIS MSI
Flag name `perMachine` `perUserInstall` (inverted)
DSL location `nsis { … }` sub-block top-level `windows { … }`
What `false` means per-user (`%LOCALAPPDATA%`) per-machine (`Program Files`)

A user moving an app from NSIS to MSI (or vice versa) has to change the flag name, move it to a different scope, and invert the boolean — easy to misconfigure silently.

Proposed fix

Introduce a dedicated `msi { … }` sub-block mirroring `nsis { … }`:

```kotlin
windows {
msi {
perMachine = true // mirrors nsis.perMachine
// future: oneClick, warningsAsErrors, additionalWixArgs, ...
}
}
```

  • Map `msi.perMachine` → electron-builder `msi.perMachine` (1:1, no inversion).
  • Deprecate `windows.perUserInstall` with `@Deprecated(replaceWith = ReplaceWith("msi.perMachine = !value"))`. Keep it functional during a deprecation cycle so existing builds don't break.
  • Update `docs/targets/windows.md`.

Why this is worth doing

  • Removes the cognitive trap on cross-target migrations.
  • Provides a natural home for the rest of `MsiOptions` (`oneClick`, `warningsAsErrors`, `additionalWixArgs`, `additionalLightArgs`) currently not exposed.
  • No breaking change if done with deprecation.

Follow-up to #222 / #224.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions