@@ -107,7 +107,7 @@ $repositories | ForEach-Object {
107107}
108108
109109$sdkVersion  =  (.\build\cmake\bin\cmake.exe  - P .\packages\pico- setup- windows\pico- sdk- version.cmake - N |  Select-String  - Pattern ' PICO_SDK_VERSION_STRING=(.*)$' 1 ].Value
110- $product  =  " Raspberry Pi Pico SDK $sdkVersion " 
110+ $product  =  " Raspberry Pi Pico SDK v $sdkVersion " 
111111
112112Write-Host  " SDK version: $sdkVersion " 
113113Write-Host  " Installer version: $version " 
@@ -164,8 +164,10 @@ if (-not (Test-Path ".\build\picotool-install\mingw$bitness")) {
164164; CMake generates build defs with long hashes in the paths. Both CMake and 
165165; Ninja currently have problems working with long paths on Windows. 
166166; !define PICO_REPOS_DIR "`$ LOCALAPPDATA\Programs\$product " 
167- !define PICO_REPOS_DIR "`$ DOCUMENTS\Pico" 
168- !define PICO_SHORTCUTS_DIR "`$ SMPROGRAMS\$product " 
167+ !define PICO_REPOS_DIR "`$ DOCUMENTS\Pico-v$sdkVersion " 
168+ !define PICO_SHORTCUTS_DIR "`$ SMPROGRAMS\Raspberry Pi\Pico SDK v$sdkVersion " 
169+ !define PICO_REG_ROOT HKCU 
170+ !define PICO_REG_KEY "Software\Raspberry Pi\$basename " 
169171
170172Name "`$ {TITLE}" 
171173Caption "`$ {TITLE}" 
@@ -187,7 +189,7 @@ SpaceTexts "none"
187189InstallDir "`$ {PICO_INSTALL_DIR}" 
188190
189191;Get installation folder from registry if available 
190- InstallDirRegKey HKCU "Software\ $basename " "InstallPath" 
192+ InstallDirRegKey `$ {PICO_REG_ROOT} " `$ {PICO_REG_KEY} " "InstallPath" 
191193
192194!define MUI_ABORTWARNING 
193195
@@ -222,8 +224,8 @@ Section
222224  InitPluginsDir 
223225  File /oname=`$ TEMP\RefreshEnv.cmd "packages\pico-setup-windows\RefreshEnv.cmd" 
224226
225-   WriteRegStr HKCU "Software\ $basename " "InstallPath" "`$ INSTDIR" 
226-   WriteRegStr HKCU "Software\ $basename \v$version " "InstallPath" "`$ INSTDIR" 
227+   WriteRegStr `$ {PICO_REG_ROOT} " `$ {PICO_REG_KEY} " "InstallPath" "`$ INSTDIR" 
228+   WriteRegStr `$ {PICO_REG_ROOT} " `$ {PICO_REG_KEY} \v$version " "InstallPath" "`$ INSTDIR" 
227229
228230  CreateDirectory "`$ {PICO_REPOS_DIR}" 
229231  CreateDirectory "`$ {PICO_SHORTCUTS_DIR}" 
@@ -290,6 +292,8 @@ Section "VS Code Extensions" SecCodeExts
290292  Pop `$ 1 
291293  nsExec::ExecToLog '"`$ 0" /c call "`$ TEMP\RefreshEnv.cmd" && code --install-extension ms-vscode.cpptools-extension-pack' 
292294  Pop `$ 1 
295+   nsExec::ExecToLog '"`$ 0" /c call "`$ TEMP\RefreshEnv.cmd" && code --install-extension ms-vscode.vscode-serial-monitor' 
296+   Pop `$ 1 
293297
294298SectionEnd 
295299
@@ -319,32 +323,29 @@ Section "Pico environment" SecPico
319323
320324  SetOutPath "`$ INSTDIR\pico-sdk-tools" 
321325  File "build\pico-sdk-tools\mingw$bitness \*.*" 
322-   WriteRegStr HKCU  "Software\Kitware\CMake\Packages\pico-sdk-tools" "v$version " "`$ INSTDIR\pico-sdk-tools" 
326+   WriteRegStr `$ {PICO_REG_ROOT}  "Software\Kitware\CMake\Packages\pico-sdk-tools" "v$version " "`$ INSTDIR\pico-sdk-tools" 
323327
324328  SetOutPath "`$ INSTDIR\picotool" 
325329  File "build\picotool-install\mingw$bitness \*.*" 
326330
327331  SetOutPath "`$ {PICO_REPOS_DIR}" 
328332  File "version.txt" 
333+   File "packages\pico-setup-windows\pico-code.ps1" 
334+   File "packages\pico-setup-windows\pico-env.ps1" 
329335  File "packages\pico-setup-windows\pico-env.cmd" 
330336  File "packages\pico-setup-windows\pico-setup.cmd" 
331337  File "packages\pico-setup-windows\ReadMe.txt" 
332338
333-   CreateShortcut "`$ {PICO_SHORTCUTS_DIR}\Developer Command Prompt for Pico.lnk" "cmd.exe" '/k "`$ {PICO_REPOS_DIR}\pico-env.cmd"' 
334- 
335-   CreateShortcut "`$ {PICO_SHORTCUTS_DIR}\Open pico-examples in Visual Studio Code.lnk" "cmd.exe" '/c (call "`$ {PICO_REPOS_DIR}\pico-env.cmd" && code --disable-workspace-trust "`$ {PICO_REPOS_DIR}\pico-examples") || pause' "`$ INSTDIR\resources\vscode.ico" 
336- 
337-   WriteINIStr "`$ {PICO_SHORTCUTS_DIR}\Raspberry Pi microcontrollers documentation.url" "InternetShortcut" "URL" "https://www.raspberrypi.com/documentation/microcontrollers/" 
339+   CreateDirectory "`$ {PICO_SHORTCUTS_DIR}\Pico - Documentation" 
338340
339-   WriteINIStr "`$ {PICO_SHORTCUTS_DIR}\Raspberry Pi Pico C-C++ SDK documentation.url" "InternetShortcut" "URL" "https://www.raspberrypi.com/documentation/microcontrollers/c_sdk.html" 
341+   CreateShortcut "`$ {PICO_SHORTCUTS_DIR}\Pico - Developer Command Prompt.lnk" "cmd.exe" '/k "`$ {PICO_REPOS_DIR}\pico-env.cmd"' 
342+   CreateShortcut "`$ {PICO_SHORTCUTS_DIR}\Pico - Developer PowerShell.lnk" "powershell.exe" '-NoExit -ExecutionPolicy Bypass -File "`$ {PICO_REPOS_DIR}\pico-env.ps1"' 
343+   CreateShortcut "`$ {PICO_SHORTCUTS_DIR}\Pico - Visual Studio Code.lnk" "powershell.exe" 'powershell -WindowStyle Hidden -ExecutionPolicy Bypass -File "`$ {PICO_REPOS_DIR}\pico-code.ps1"' "`$ INSTDIR\resources\vscode.ico" "" SW_SHOWMINIMIZED 
340344
341-   ; Unconditionally create a shortcut for VS Code -- in case the user had it 
342-   ; installed already, or if they install it later 
343-   CreateShortcut "`$ {PICO_SHORTCUTS_DIR}\Visual Studio Code for Pico.lnk" "cmd.exe" '/c (call "`$ {PICO_REPOS_DIR}\pico-env.cmd" && code) || pause' "`$ INSTDIR\resources\vscode.ico" 
344- 
345-   ; SetOutPath is needed here to set the working directory for the shortcut 
346-   SetOutPath "`$ INSTDIR\pico-project-generator" 
347-   CreateShortcut "`$ {PICO_SHORTCUTS_DIR}\Pico Project Generator.lnk" "cmd.exe" '/c (call "`$ {PICO_REPOS_DIR}\pico-env.cmd" && python "`$ {PICO_REPOS_DIR}\pico-project-generator\pico_project.py" --gui) || pause' 
345+   WriteINIStr "`$ {PICO_SHORTCUTS_DIR}\Pico - Documentation\Pico Datasheet.url" "InternetShortcut" "URL" "https://datasheets.raspberrypi.com/pico/pico-datasheet.pdf" 
346+   WriteINIStr "`$ {PICO_SHORTCUTS_DIR}\Pico - Documentation\Pico W Datasheet.url" "InternetShortcut" "URL" "https://datasheets.raspberrypi.com/picow/pico-w-datasheet.pdf" 
347+   WriteINIStr "`$ {PICO_SHORTCUTS_DIR}\Pico - Documentation\Pico C C++ SDK.url" "InternetShortcut" "URL" "https://datasheets.raspberrypi.com/pico/raspberry-pi-pico-c-sdk.pdf" 
348+   WriteINIStr "`$ {PICO_SHORTCUTS_DIR}\Pico - Documentation\Pico Python SDK.url" "InternetShortcut" "URL" "https://datasheets.raspberrypi.com/pico/raspberry-pi-pico-python-sdk.pdf" 
348349
349350  ; Reset working dir for pico-setup.cmd launched from the finish page 
350351  SetOutPath "`$ {PICO_REPOS_DIR}" 
@@ -353,28 +354,17 @@ SectionEnd
353354
354355LangString DESC_SecPico `$ {LANG_ENGLISH} "Scripts for cloning the Pico SDK and tools repos, and for setting up your Pico development environment." 
355356
356- Section "Download documents and files" SecDocs 
357- 
358-   SetOutPath "`$ {PICO_REPOS_DIR}" 
359-   File "common.ps1" 
360-   File "packages\pico-setup-windows\pico-docs.ps1" 
361- 
362- SectionEnd 
363- 
364357Function RunBuild 
365358
366359  ReadEnvStr `$ 0 COMSPEC 
367360  Exec '"`$ 0" /k call "`$ TEMP\RefreshEnv.cmd" && del "`$ TEMP\RefreshEnv.cmd" && call "`$ {PICO_REPOS_DIR}\pico-setup.cmd" 1' 
368361
369362FunctionEnd 
370363
371- LangString DESC_SecDocs `$ {LANG_ENGLISH} "Adds a script to download the latest Pico documents, design files, and UF2 files." 
372- 
373364!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN 
374365  !insertmacro MUI_DESCRIPTION_TEXT `$ {SecCodeExts} `$ (DESC_SecCodeExts) 
375366  !insertmacro MUI_DESCRIPTION_TEXT `$ {SecOpenOCD} `$ (DESC_SecOpenOCD) 
376367  !insertmacro MUI_DESCRIPTION_TEXT `$ {SecPico} `$ (DESC_SecPico) 
377-   !insertmacro MUI_DESCRIPTION_TEXT `$ {SecDocs} `$ (DESC_SecDocs) 
378368$ ( $downloads  |  ForEach-Object  {
379369  "   !insertmacro MUI_DESCRIPTION_TEXT `$ {Sec$ ( $_.shortName  ) } `$ (DESC_Sec$ ( $_.shortName  ) )`n "  
380370})  
0 commit comments