Skip to content

Commit 04d51f2

Browse files
committed
win deployment
1 parent e0a0a1e commit 04d51f2

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

tools/deploy_gui_shortcut.ps1

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)