Skip to content

Commit 1cf20fe

Browse files
authored
Merge pull request #12 from kdroidFilter/refactor/move-installationPath-macos-only
refactor(dsl): move installationPath to macOS-only
2 parents 72df9dd + 21a26b9 commit 1cf20fe

4 files changed

Lines changed: 23 additions & 4 deletions

File tree

.github/actions/build-macos-universal/build-universal.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ if [[ -n "$INSTALLER_IDENTITY" && -n "$UNIVERSAL_SANDBOXED_APP" ]]; then
509509
fi
510510

511511
productbuild \
512-
--component "$PKG_APP_COPY" "/Applications" \
512+
--component "$PKG_APP_COPY" "${INSTALL_LOCATION:-/Applications}" \
513513
--sign "$INSTALLER_IDENTITY" \
514514
"${PB_KC_ARGS[@]}" \
515515
"$OUTPUT_DIR/$PKG_NAME"

docs/targets/linux.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ No manual `desktopEntries` override is needed for MimeType.
250250
| `shortcut` | `Boolean` | `false` | Create `.desktop` file |
251251
| `packageName` | `String?` | `null` | Override package name |
252252
| `packageVersion` | `String?` | `null` | Override package version |
253-
| `installationPath` | `String?` | `null` | Installation directory |
254253
| `startupWMClass` | `String?` | `null` | `StartupWMClass` in `.desktop` |
255254
| `appRelease` | `String?` | `null` | Application release number |
256255
| `appCategory` | `String?` | `null` | Application category |

docs/targets/macos.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,26 @@ macOS {
179179
}
180180
```
181181

182+
## Installation Path
183+
184+
The `installationPath` property controls where the application is installed on disk. It defaults to `/Applications`.
185+
186+
- **PKG installers** — passed as the `installLocation` to electron-builder and to `productbuild` for App Store builds. When the user chooses the local system domain during installation, the app is placed in `installationPath` (e.g. `/Applications`). When a home directory installation is chosen, the app is placed in `$HOME/Applications` instead.
187+
- **DMG** — used as the symlink target in the native DMG builder, so the drag-and-drop arrow points to the correct directory.
188+
189+
```kotlin
190+
macOS {
191+
// Default — installs into /Applications
192+
installationPath = "/Applications"
193+
194+
// Custom — installs into /Applications/MyCompany
195+
installationPath = "/Applications/MyCompany"
196+
}
197+
```
198+
199+
!!! note
200+
This property is macOS-only. Windows and Linux installers do not use it.
201+
182202
## Full macOS DSL Reference
183203

184204
### `macOS { }`
@@ -204,7 +224,7 @@ macOS {
204224
| `runtimeEntitlementsFile` | `RegularFileProperty` || Runtime entitlements plist |
205225
| `provisioningProfile` | `RegularFileProperty` || Provisioning profile |
206226
| `runtimeProvisioningProfile` | `RegularFileProperty` || Runtime provisioning profile |
207-
| `installationPath` | `String?` | `null` | Installation directory |
227+
| `installationPath` | `String?` | `/Applications` | The install location used by PKG installers and as the DMG symlink target (see [below](#installation-path)) |
208228

209229
### `macOS { signing { } }`
210230

plugin-build/plugin/src/main/kotlin/io/github/kdroidfilter/nucleus/desktop/application/dsl/PlatformSettings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ abstract class AbstractPlatformSettings {
1818

1919
val iconFile: RegularFileProperty = objects.fileProperty()
2020
var packageVersion: String? = null
21-
var installationPath: String? = null
2221

2322
internal val fileAssociations: MutableSet<FileAssociation> = mutableSetOf()
2423

@@ -41,6 +40,7 @@ abstract class AbstractMacOSPlatformSettings : AbstractPlatformSettings() {
4140
var dmgPackageBuildVersion: String? = null
4241
var appCategory: String? = null
4342
var minimumSystemVersion: String? = null
43+
var installationPath: String? = null
4444
var layeredIconDir: DirectoryProperty = objects.directoryProperty()
4545

4646
/**

0 commit comments

Comments
 (0)