@@ -107,7 +107,7 @@ $repositories | ForEach-Object {
107
107
}
108
108
109
109
$sdkVersion = (.\build\cmake\bin\cmake.exe - P .\packages\pico- setup- windows\pico- sdk- version.cmake - N | Select-String - Pattern ' PICO_SDK_VERSION_STRING=(.*)$' ).Matches.Groups[1 ].Value
110
- $product = " Raspberry Pi Pico SDK $sdkVersion "
110
+ $product = " Raspberry Pi Pico SDK v $sdkVersion "
111
111
112
112
Write-Host " SDK version: $sdkVersion "
113
113
Write-Host " Installer version: $version "
@@ -164,8 +164,10 @@ if (-not (Test-Path ".\build\picotool-install\mingw$bitness")) {
164
164
; CMake generates build defs with long hashes in the paths. Both CMake and
165
165
; Ninja currently have problems working with long paths on Windows.
166
166
; !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 "
169
171
170
172
Name "`$ {TITLE}"
171
173
Caption "`$ {TITLE}"
@@ -187,7 +189,7 @@ SpaceTexts "none"
187
189
InstallDir "`$ {PICO_INSTALL_DIR}"
188
190
189
191
;Get installation folder from registry if available
190
- InstallDirRegKey HKCU "Software\ $basename " "InstallPath"
192
+ InstallDirRegKey `$ {PICO_REG_ROOT} " `$ {PICO_REG_KEY} " "InstallPath"
191
193
192
194
!define MUI_ABORTWARNING
193
195
@@ -222,8 +224,8 @@ Section
222
224
InitPluginsDir
223
225
File /oname=`$ TEMP\RefreshEnv.cmd "packages\pico-setup-windows\RefreshEnv.cmd"
224
226
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"
227
229
228
230
CreateDirectory "`$ {PICO_REPOS_DIR}"
229
231
CreateDirectory "`$ {PICO_SHORTCUTS_DIR}"
@@ -290,6 +292,8 @@ Section "VS Code Extensions" SecCodeExts
290
292
Pop `$ 1
291
293
nsExec::ExecToLog '"`$ 0" /c call "`$ TEMP\RefreshEnv.cmd" && code --install-extension ms-vscode.cpptools-extension-pack'
292
294
Pop `$ 1
295
+ nsExec::ExecToLog '"`$ 0" /c call "`$ TEMP\RefreshEnv.cmd" && code --install-extension ms-vscode.vscode-serial-monitor'
296
+ Pop `$ 1
293
297
294
298
SectionEnd
295
299
@@ -319,32 +323,29 @@ Section "Pico environment" SecPico
319
323
320
324
SetOutPath "`$ INSTDIR\pico-sdk-tools"
321
325
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"
323
327
324
328
SetOutPath "`$ INSTDIR\picotool"
325
329
File "build\picotool-install\mingw$bitness \*.*"
326
330
327
331
SetOutPath "`$ {PICO_REPOS_DIR}"
328
332
File "version.txt"
333
+ File "packages\pico-setup-windows\pico-code.ps1"
334
+ File "packages\pico-setup-windows\pico-env.ps1"
329
335
File "packages\pico-setup-windows\pico-env.cmd"
330
336
File "packages\pico-setup-windows\pico-setup.cmd"
331
337
File "packages\pico-setup-windows\ReadMe.txt"
332
338
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"
338
340
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
340
344
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"
348
349
349
350
; Reset working dir for pico-setup.cmd launched from the finish page
350
351
SetOutPath "`$ {PICO_REPOS_DIR}"
@@ -353,28 +354,17 @@ SectionEnd
353
354
354
355
LangString DESC_SecPico `$ {LANG_ENGLISH} "Scripts for cloning the Pico SDK and tools repos, and for setting up your Pico development environment."
355
356
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
-
364
357
Function RunBuild
365
358
366
359
ReadEnvStr `$ 0 COMSPEC
367
360
Exec '"`$ 0" /k call "`$ TEMP\RefreshEnv.cmd" && del "`$ TEMP\RefreshEnv.cmd" && call "`$ {PICO_REPOS_DIR}\pico-setup.cmd" 1'
368
361
369
362
FunctionEnd
370
363
371
- LangString DESC_SecDocs `$ {LANG_ENGLISH} "Adds a script to download the latest Pico documents, design files, and UF2 files."
372
-
373
364
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
374
365
!insertmacro MUI_DESCRIPTION_TEXT `$ {SecCodeExts} `$ (DESC_SecCodeExts)
375
366
!insertmacro MUI_DESCRIPTION_TEXT `$ {SecOpenOCD} `$ (DESC_SecOpenOCD)
376
367
!insertmacro MUI_DESCRIPTION_TEXT `$ {SecPico} `$ (DESC_SecPico)
377
- !insertmacro MUI_DESCRIPTION_TEXT `$ {SecDocs} `$ (DESC_SecDocs)
378
368
$ ( $downloads | ForEach-Object {
379
369
" !insertmacro MUI_DESCRIPTION_TEXT `$ {Sec$ ( $_.shortName ) } `$ (DESC_Sec$ ( $_.shortName ) )`n "
380
370
})
0 commit comments