Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add Windows-specific notes to documentation #181

Merged
merged 6 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions docs/source/defining-shortcuts.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,84 @@ You can add a dependency on `__osx>=10.14.4` on your conda package if you wish t
]
}
```

## Notes on Windows shortcuts

### Directories do not appear under All apps in the Start Menu

Directories defined by `menu_name` may not always appear in the Start Menu.
On Windows 11, directories are only shown if they contain more than one shortcut.
Otherwise, the shortcut will appear directly under "All apps".
This behavior is normal for Windows 11 - `menuinst` still creates the directories correctly.

### Migrating pywscript and pyscript to menuinst v2

`menuinst v1` contained `pywscript` and `pyscript` fields that allowed python scripts inside
a `conda` environment to be called.

```json
{
"menu_name": "App",
"menu_items": [
{
"name": "Launch App",
"pywscript": "${PYTHON_SCRIPTS}/app-launcher.py"
}
]
}
```

However, these wrappers just adjusted `PATH` and did not activate the `conda` environment
so that environment variables were unavailable.

These fields have been removed with `menuinst v2`. Instead, the environment should be activated
and the script executed directly.

```json
{
"$schema": "https://json-schema.org/draft-07/schema",
"$id": "https://schemas.conda.io/menuinst-1.schema.json",
"name": "App",
"menu_items": [
"name": "Launch App"
"description": "Launch App",
"activate": true,
"command": [
"{{ PREFIX }}/pythonw.exe",
"{{ SCRIPTS_DIR }}/app-launcher.py"
],
"platforms": {
"win": {
}
}
]
}
```

This will briefly open a terminal Window to launch the python instance.
If this flashing is not desired, `menuinst v1` behavior can be restored
by explicitly calling the wrapper:

```json
{
"$schema": "https://json-schema.org/draft-07/schema",
"$id": "https://schemas.conda.io/menuinst-1.schema.json",
"name": "App",
"menu_items": [
"name": "Launch App"
"description": "Launch App",
"activate": true,
"command": [
"{{ BASE_PYTHONW }}",
"{{ BASE_PREFIX }}/cwp.py",
"{{ PREFIX }}",
"{{ PYTHONW }}",
"{{ SCRIPTS_DIR }}/app-launcher.py"
],
"platforms": {
"win": {
}
}
]
}
```
19 changes: 19 additions & 0 deletions news/181-windows-shortcut-notes
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* <news item>

### Deprecations

* <news item>

### Docs

* Add notes on "missing" Start Menu directories on Windows and on how to migrate `pywscript` and `pyscript` to menuinst v2 (#181)

### Other

* <news item>
Loading