File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -137,12 +137,22 @@ path explicitly:
137137$ExePath = Join-Path $CondaEnvPath " Scripts\picasso-workflow-gui.exe"
138138
139139# ---------------------------------------------------------------------------
140- # 3. Locate the icon installed with the package
140+ # 3. Locate the icon — ask Python so editable installs work too
141141# ---------------------------------------------------------------------------
142- $IconPath = Join-Path $CondaEnvPath " Lib\site-packages\picasso_workflow\picasso-workflow.ico"
143-
144- if (-not (Test-Path $IconPath )) {
145- Write-Warning " Icon not found at $IconPath - shortcut will use the default Python icon."
142+ $python = Join-Path $CondaEnvPath " python.exe"
143+ $IconPath = & $python - c @"
144+ import importlib.resources, sys
145+ try:
146+ p = importlib.resources.files('picasso_workflow').joinpath('picasso-workflow.ico')
147+ # resolve to a real filesystem path
148+ import pathlib
149+ print(str(pathlib.Path(str(p)).resolve()))
150+ except Exception:
151+ sys.exit(1)
152+ "@ 2> $null
153+
154+ if (-not $IconPath -or -not (Test-Path $IconPath )) {
155+ Write-Warning " Icon not found - shortcut will use the default Python icon."
146156 $IconPath = $ExePath
147157}
148158
You can’t perform that action at this time.
0 commit comments