Skip to content

Commit 5758221

Browse files
Update windows installer to use icon-
1 parent 2cda158 commit 5758221

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

installers/install_nichart_docker_windows.ps1

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,20 @@ switch ($LASTEXITCODE) {
125125

126126
# Create a Windows shortcut on the Desktop that launches the WSL script
127127
$desktop = [Environment]::GetFolderPath('Desktop')
128+
129+
$iconUrl = "https://raw.githubusercontent.com/CBICA/NiChart_Project/refs/heads/main/resources/images/nichart1.ico"
130+
$iconPath = Join-Path $env:LOCALAPPDATA "NiChart/nichart.ico"
131+
132+
133+
New-Item -ItemType Directory -Path (Split-Path $iconPath) -Force | Out-Null
134+
135+
try {
136+
Invoke-WebRequest -Uri $iconUrl -OutFile $iconPath -UseBasicParsing
137+
} catch {
138+
Write-Warning "Could not download icon from $iconUrl. Shortcut will use default WSL icon."
139+
$iconPath = "$env:SystemRoot\System32\wsl.exe" # fallback
140+
}
141+
128142
$shortcutName = "NiChart.lnk"
129143
$shortcutPath = Join-Path $desktop $shortcutName
130144

@@ -146,7 +160,7 @@ $shortcut.Arguments = ($argList -join ' ')
146160
$shortcut.WorkingDirectory = $desktop
147161
$shortcut.WindowStyle = 1
148162
$shortcut.Description = "Launch NiChart inside $selectedDistro"
149-
$shortcut.IconLocation = "$env:SystemRoot\System32\wsl.exe,0"
163+
$shortcut.IconLocation = "$iconPath"
150164
$shortcut.Save()
151165

152166
if (-not (Test-Path $shortcutPath)) { Fail "Failed to create shortcut at $shortcutPath." }

0 commit comments

Comments
 (0)