From 31ed1b8a6ceed87e2c8f54afb1727404a13a0758 Mon Sep 17 00:00:00 2001 From: arekzaluski Date: Thu, 22 Feb 2018 07:59:30 +0000 Subject: [PATCH] Update to version 0.4.4 Update mbed-cli to version 1.4.0 Add support for uninstalling old version before installing new one --- README.md | 2 +- prerequisites/download-prerequisites.ps1 | 4 ++-- source/cliInstall.nsi | 29 +++++++++++++++++------- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c9e22e7..ed60afd 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ $ powershell -ExecutionPolicy ByPass -File download-prerequisites.ps1 ## Process -* Install the mbed CLI dependencies - Python, GCC, Mercurial, Git and the mbed Serial Driver - and then mbed CLI 1.2.2 from source. +* Install the mbed CLI dependencies - Python, GCC, Mercurial, Git and the mbed Serial Driver - and then mbed CLI 1.4.0 from source. * Contains two installer types: * Default: Installs all dependencies. * Advanced: Allows to select dependencies. diff --git a/prerequisites/download-prerequisites.ps1 b/prerequisites/download-prerequisites.ps1 index 3a3bcfa..d7648f9 100644 --- a/prerequisites/download-prerequisites.ps1 +++ b/prerequisites/download-prerequisites.ps1 @@ -25,6 +25,6 @@ $url = "https://developer.mbed.org/media/downloads/drivers/mbedWinSerial_16466.e $file = "$storageDir\mbedWinSerial_16466.exe" $webclient.DownloadFile($url,$file) #Download mbed-cli -$url = "https://github.com/ARMmbed/mbed-cli/archive/1.2.2.zip" -$file = "$storageDir\mbed-cli-1.2.2.zip" +$url = "https://github.com/ARMmbed/mbed-cli/archive/1.4.0.zip" +$file = "$storageDir\mbed-cli-1.4.0.zip" $webclient.DownloadFile($url,$file) diff --git a/source/cliInstall.nsi b/source/cliInstall.nsi index 5239558..6641643 100644 --- a/source/cliInstall.nsi +++ b/source/cliInstall.nsi @@ -45,9 +45,9 @@ ${StrTrimNewLines} ;-------------------------------- ;Config Section !define PRODUCT_NAME "Mbed CLI for Windows" - !define PRODUCT_VERSION "0.4.3" - !define MBED_CLI_ZIP "mbed-cli-1.2.2.zip" - !define MBED_CLI_VERSION "mbed-cli-1.2.2" + !define PRODUCT_VERSION "0.4.4" + !define MBED_CLI_ZIP "mbed-cli-1.4.0.zip" + !define MBED_CLI_VERSION "mbed-cli-1.4.0" !define PRODUCT_PUBLISHER "Arm Mbed" !define PYTHON_INSTALLER "python-2.7.13.msi" !define GCC_EXE "gcc-arm-none-eabi-6-2017-q2-update-win32.exe" @@ -217,11 +217,24 @@ SectionEnd ;-------------------------------- ;Init Function .onInit - ;Check Windows version. Windows 7 or above is required - ${IfNot} ${AtLeastWin7} - MessageBox MB_OK "Windows 7 and above is required" - Quit - ${EndIf} + ;Check Windows version. Windows 7 or above is required + ${IfNot} ${AtLeastWin7} + MessageBox MB_OK "Windows 7 and above is required" + Quit + ${EndIf} + ReadRegStr $R0 SHCTX "${UNINST_KEY}" "UninstallString" + StrCmp $R0 "" done + + MessageBox MB_YESNO|MB_ICONEXCLAMATION \ + "${PRODUCT_NAME} has been detected on this system. It will be removed during this installation process. Would you like to continue?" \ + IDYES uninst + Abort + + ;Run the uninstaller + uninst: + ClearErrors + Exec '$R0' ;Run uninstaller + done: functionEnd ;--------------------------------