File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff 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
152166if (-not (Test-Path $shortcutPath )) { Fail " Failed to create shortcut at $shortcutPath ." }
You can’t perform that action at this time.
0 commit comments