@@ -188,8 +188,9 @@ SpaceTexts "none"
188188
189189InstallDir "`$ {PICO_INSTALL_DIR}"
190190
191- ;Get installation folder from registry if available
192- InstallDirRegKey `$ {PICO_REG_ROOT} "`$ {PICO_REG_KEY}" "InstallPath"
191+ ; Get installation folder from registry if available
192+ ; We use a version-specific key here so that multiple versions can be installed side-by-side
193+ InstallDirRegKey `$ {PICO_REG_ROOT} "`$ {PICO_REG_KEY}\v$version " "InstallPath"
193194
194195!define MUI_ABORTWARNING
195196
@@ -201,7 +202,7 @@ InstallDirRegKey `${PICO_REG_ROOT} "`${PICO_REG_KEY}" "InstallPath"
201202!define MUI_FINISHPAGE_RUN
202203!define MUI_FINISHPAGE_RUN_FUNCTION RunBuild
203204
204- !define MUI_FINISHPAGE_SHOWREADME "`$ {PICO_REPOS_DIR} \ReadMe.txt"
205+ !define MUI_FINISHPAGE_SHOWREADME "`$ INSTDIR \ReadMe.txt"
205206!define MUI_FINISHPAGE_SHOWREADME_TEXT "Show ReadMe"
206207
207208!define MUI_FINISHPAGE_NOAUTOCLOSE
@@ -224,8 +225,8 @@ Section
224225 InitPluginsDir
225226 File /oname=`$ TEMP\RefreshEnv.cmd "packages\pico-setup-windows\RefreshEnv.cmd"
226227
227- WriteRegStr `$ {PICO_REG_ROOT} "`$ {PICO_REG_KEY}" "InstallPath" "`$ INSTDIR"
228228 WriteRegStr `$ {PICO_REG_ROOT} "`$ {PICO_REG_KEY}\v$version " "InstallPath" "`$ INSTDIR"
229+ WriteRegStr `$ {PICO_REG_ROOT} "`$ {PICO_REG_KEY}\v$version " "ReposPath" "`$ {PICO_REPOS_DIR}"
229230
230231 CreateDirectory "`$ {PICO_REPOS_DIR}"
231232 CreateDirectory "`$ {PICO_SHORTCUTS_DIR}"
@@ -328,7 +329,7 @@ Section "Pico environment" SecPico
328329 SetOutPath "`$ INSTDIR\picotool"
329330 File "build\picotool-install\mingw$bitness \*.*"
330331
331- SetOutPath "`$ {PICO_REPOS_DIR} "
332+ SetOutPath "`$ INSTDIR "
332333 File "version.txt"
333334 File "packages\pico-setup-windows\pico-code.ps1"
334335 File "packages\pico-setup-windows\pico-env.ps1"
@@ -338,17 +339,17 @@ Section "Pico environment" SecPico
338339
339340 CreateDirectory "`$ {PICO_SHORTCUTS_DIR}\Pico - Documentation"
340341
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
342+ CreateShortcut "`$ {PICO_SHORTCUTS_DIR}\Pico - Developer Command Prompt.lnk" "cmd.exe" '/k "`$ INSTDIR \pico-env.cmd"'
343+ CreateShortcut "`$ {PICO_SHORTCUTS_DIR}\Pico - Developer PowerShell.lnk" "powershell.exe" '-NoExit -ExecutionPolicy Bypass -File "`$ INSTDIR \pico-env.ps1"'
344+ CreateShortcut "`$ {PICO_SHORTCUTS_DIR}\Pico - Visual Studio Code.lnk" "powershell.exe" '-WindowStyle Hidden -ExecutionPolicy Bypass -File "`$ INSTDIR \pico-code.ps1"' "`$ INSTDIR\resources\vscode.ico" "" SW_SHOWMINIMIZED
344345
345346 WriteINIStr "`$ {PICO_SHORTCUTS_DIR}\Pico - Documentation\Pico Datasheet.url" "InternetShortcut" "URL" "https://datasheets.raspberrypi.com/pico/pico-datasheet.pdf"
346347 WriteINIStr "`$ {PICO_SHORTCUTS_DIR}\Pico - Documentation\Pico W Datasheet.url" "InternetShortcut" "URL" "https://datasheets.raspberrypi.com/picow/pico-w-datasheet.pdf"
347348 WriteINIStr "`$ {PICO_SHORTCUTS_DIR}\Pico - Documentation\Pico C C++ SDK.url" "InternetShortcut" "URL" "https://datasheets.raspberrypi.com/pico/raspberry-pi-pico-c-sdk.pdf"
348349 WriteINIStr "`$ {PICO_SHORTCUTS_DIR}\Pico - Documentation\Pico Python SDK.url" "InternetShortcut" "URL" "https://datasheets.raspberrypi.com/pico/raspberry-pi-pico-python-sdk.pdf"
349350
350351 ; Reset working dir for pico-setup.cmd launched from the finish page
351- SetOutPath "`$ {PICO_REPOS_DIR} "
352+ SetOutPath "`$ INSTDIR "
352353
353354SectionEnd
354355
@@ -357,7 +358,7 @@ LangString DESC_SecPico `${LANG_ENGLISH} "Scripts for cloning the Pico SDK and t
357358Function RunBuild
358359
359360 ReadEnvStr `$ 0 COMSPEC
360- Exec '"`$ 0" /k call "`$ TEMP\RefreshEnv.cmd" && del "`$ TEMP\RefreshEnv.cmd" && call "`$ {PICO_REPOS_DIR} \pico-setup.cmd" 1'
361+ Exec '"`$ 0" /k call "`$ TEMP\RefreshEnv.cmd" && del "`$ TEMP\RefreshEnv.cmd" && call "`$ INSTDIR \pico-setup.cmd" 1'
361362
362363FunctionEnd
363364
0 commit comments