Giter VIP home page Giter VIP logo

mbed-cli-windows-installer's Introduction

mbed CLI Windows Installer

This repository contains the source files to build the mbed CLI Windows installer. See the releases page for downloads.

Supported platforms

  • Windows 7 and above

Setup

  1. Install NSIS, which can be found at nsis.sourceforge.net.
  2. Download this repository.
  3. Download prerequisites manually or run following powershell script.
$ cd prerequisites
$ powershell -ExecutionPolicy ByPass -File download-prerequisites.ps1
  1. Run makensis on the source/install.nsi with an output file.
$ makensis "/XOutFile Mbed_installer.exe" source/install.nsi
  1. Test the installer that was just generated

Sign installer using Arm license server

  1. Set sign credentials, get url ID to upload installer
$ curl -H "Content-Type: application/json" -X POST -d "{\"username\": \"arkzal01\",\"vendor-url\":\"www.mbed.com\",\"description\":\"Mbed CLI Windows Installer\",\"cross-sign\":true,\"digest-algorithm\":\"sha2\"}" http://authenticode.euhpc.arm.com:8087/signed-items
  1. Use url ID to upload installer exe and receive signed installer. This operation may take few minutes. Replace {url_id} in the following with the guid output by the above command.l ID to upload installer
$ curl -H "Content-Type: application/octet-stream" http://authenticode.euhpc.arm.com:8087/signed-items/{url_id}/sign --upload-file Mbed_installer_v0.0.1.exe > Mbed_installer_signed_v0.0.1.exe

Release

  1. Login on www.mbed.com as an admin.
  2. Navigate to django administration console: https://www.mbed.com/admin
  3. Go into django filer->Folders->mbed-cli->Windows
  4. Upload installer
  5. Get direct url to the installer

The same release should also be created on github in releases.

Process

  • 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.

Silent Install

$ cd source
$ mbed_installer_{version}.exe /S

Using mbed_install_vX.x.x

  1. Download the latest release of the mbed CLI Windows installer.
  2. Run mbed_installer_vX.X.X.exe - and click through the wizard.
  3. Open windows command prompt.
  4. Use mbed import mbed-os-example-blinky to import an example program.

Manual installation: You can install mbed CLI also by hand. See the mbed CLI repository.

Updating pre-requisites

When needed, you can update the gcc, cmake, or other dependencies by updating the executables in /prerequisites/* and then the equivalent lines in the Config Section of /source/mbedInstall.nsi .

License

mbed CLI Windows Installer is licensed under Apache-2.0

mbed-cli-windows-installer's People

Contributors

arekzaluski avatar blackstoneengineering avatar j3hill avatar theotherjimmy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mbed-cli-windows-installer's Issues

This installer is almost outdated.

I installed v0.4.10, and tried to update mbed-cli to latest by running pip install -U mbed-cli.

I had a bad feeling when installing v0.4.10 because it installer Python 2.7, and as a result pip install -U mbed-cli couldn't finish successfully.

Successfully installed PrettyTable-0.7.2 appdirs-1.4.4 backports.functools-lru-cache-1.6.1 beautifulsoup4-4.9.1 certifi-2020.6.20 chardet-3.0.4 colorama-0.4.3 fasteners-0.15 future-0.18.2 idna-2.10 intelhex-2.2.1 junit-xml-1.9 lockfile-0.12.2 mbed-cli-1.10.4 mbed-os-tools-0.0.14 monotonic-1.5 pyserial-3.4 requests-2.24.0 six-1.15.0 soupsieve-1.9.6 urllib3-1.25.9
Traceback (most recent call last):
  File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\pip.exe\__main__.py", line 9, in <module>
  File "c:\python27\lib\site-packages\pip\__init__.py", line 233, in main
    return command.main(cmd_args)
  File "c:\python27\lib\site-packages\pip\basecommand.py", line 252, in main
    pip_version_check(session)
  File "c:\python27\lib\site-packages\pip\utils\outdated.py", line 102, in pip_version_check
    installed_version = get_installed_version("pip")
  File "c:\python27\lib\site-packages\pip\utils\__init__.py", line 838, in get_installed_version
    working_set = pkg_resources.WorkingSet()
  File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 644, in __init__
    self.add_entry(entry)
  File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 700, in add_entry
    for dist in find_distributions(entry, True):
  File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1949, in find_eggs_in_zip
    if metadata.has_metadata('PKG-INFO'):
  File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1463, in has_metadata
    return self.egg_info and self._has(self._fn(self.egg_info, name))
  File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1823, in _has
    return zip_path in self.zipinfo or zip_path in self._index()
  File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1703, in zipinfo
    return self._zip_manifests.load(self.loader.archive)
  File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1643, in load
    mtime = os.stat(path).st_mtime
WindowsError: [Error 2] 指定されたファイルが見つかりません。: 'c:\\python27\\lib\\site-packages\\mbed_cli-1.8.3-py2.7.egg'

ARM File

When we install the mbed-cli using the installer, ARM file is not created within the folder. Should we install it separately?

Windows Serial driver install blocks installer with ST boards

problem

If using an ST board then the installer doesnt recognize it during the 'windows serial driver' install process.

Solution

Either install the ST driver and then the windows serial driver, or have a fallback on failure for windows serial driver install that says 'no board connected, cannot install serial driver, please install serial driver when you have a board' or give the ability to skip the install of the serial driver phase

Installer installs old mbed-cli version

Problem

When I run the installer it instals mbed-cli v1.2.2, current is 1.7.x . The installer should not be installing old versions.

Solution

install latest mbed-cli when running the installer

Included packages in mbed CLI installer

At the moment internet connection is required for installing mbed CLI with this installer. Other dependencies are embedded in installer and internet connection is not required for them.

This is confusing. We should either have:

  1. Everything is downloaded online during install and no dependencies are embedded in the installer. E.g. SkypeDownloader, AdobeFlashDownloader and call it that; OR
  2. Everything is embedded in the installer and have support for non-internet install. E.g. installer contains everything. This also means that we can embed python and run python setup.py install in the local copy of mbed CLI; OR
  3. Have everything embedded and offer the user an option to download the latest version of things (CLI and python/gcc/git patch version) and install these instead. This could be a checkbox during install "[x] Update mbed CLI and dependencies to the latest version. NOTE: Internet connection is required"

@arekzaluski @sg- @theotherjimmy @BlackstoneEngineering

Latest installer release based on old Mbed CLI and GCC versions

On the Mbed website, all new users get directed towards this page to install Mbed CLI.
https://os.mbed.com/docs/mbed-os/v5.14/quick-start/offline-with-mbed-cli.html
For Windows users, this links to the release page on this repo. At the time of this ticket, the latest release is based on Mbed CLI and GCC that were in use in December of 2018 (a full year ago).

If cloning the latest Mbed OS version, this results in the following concerning warning.

[Warning] @,: Compiler version mismatch: Have 6.3.1; expected version >= 9.0.0 and < 10.0.0

Please create a new installer release with latest updates to the version of Mbed CLI and GCC associated with the latest Mbed OS release. Currently 5.14. Soon to be 5.15.

Note this is the same issue that was highlighted in #28, which was closed without explanation.

Temporary workaround for users that find this issue -

  1. Update mbed cli with the following command
pip install -U mbed-cli --user
  1. Update GCC
    Download and install latest v9 at
    https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads

Wrong version of gcc installed

mbed Windows installer: mbed CLI v0.3.6-alpha

It is installing this ARM GCC version:
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.4.1 20160919 (release)

It should be 4.9.3.

Also, from mbed OS 5.5, we are going to upgrade to GCC 6, so we should start testing this asap.

@arekzaluski

Could not find exec

The latest release (Dec 2018) contains the issue describe in
ARMmbed/mbed-cli#875

leading to error on windows:
"Could not find executable for ARMC6."

I think a new delivery of the windows installer should fix the issue since it was merge on mbed-cli repo.

Uninstalling mbed CLI leaves apps and env variables

mbed Windows installer: mbed CLI v0.3.6-alpha

First I installed mbed CLI without any of the required apps (python, git, hg, gcc)

Later I uninstalled mbed CLI. It only removes mbed-cli and gcc.

Other apps continue to exist (and work) with the corresponding environmental variables: python, git, hg

We could add an option to the uninstaller to remove the apps: python, git, hg, gcc

@arekzaluski

Traceback when upgrading mbed-cli independent of the whole installer package

I've installed mbed CLI using mbed-cli-windows installer.

I got an email that mbed CLI version 1.1.1 was available so I ran pip install -U mbed-cli and I got:

C:\dev\mbed-os>pip install -U mbed-cli
Collecting mbed-cli
  Downloading mbed-cli-1.1.1.zip (50kB)
    100% |################################| 51kB 18kB/s
Installing collected packages: mbed-cli
  Found existing installation: mbed-cli 1.0.0
    Uninstalling mbed-cli-1.0.0:
      Successfully uninstalled mbed-cli-1.0.0
  Running setup.py install for mbed-cli ... done
Exception:
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\python27\lib\site-packages\pip\commands\install.py", line 350, in run
    isolated=options.isolated_mode,
  File "c:\python27\lib\site-packages\pip\commands\install.py", line 436, in get_lib_location_guesses
    scheme = distutils_scheme('', *args, **kwargs)
  File "c:\python27\lib\site-packages\pip\locations.py", line 140, in distutils_scheme
    d = Distribution(dist_args)
  File "c:\python27\lib\site-packages\setuptools\dist.py", line 316, in __init__
    for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
  File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 730, in iter_entry_points
    entries = dist.get_entry_map(group)
  File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 2639, in get_entry_map
    self._get_metadata('entry_points.txt'), self
  File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 2369, in parse_map
    for group, lines in data:
  File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 2967, in split_sections
    for line in yield_lines(s):
  File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 2235, in yield_lines
    for ss in strs:
 File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 2564, in _get_metadata
    if self.has_metadata(name):
  File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 1462, in has_metadata
    return self.egg_info and self._has(self._fn(self.egg_info, name))
  File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 1822, in _has
    return zip_path in self.zipinfo or zip_path in self._index()
  File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 1702, in zipinfo
    return self._zip_manifests.load(self.loader.archive)
  File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 1642, in load
    mtime = os.stat(path).st_mtime
WindowsError: [Error 2] The system cannot find the file specified: 'c:\\python27\\lib\\site-packages\\mbed_cli-1.0.0-py2.7.egg
'

This seems to be caused by the installer using https://github.com/ARMmbed/mbed-cli-windows-installer/blob/master/source/cliInstall.nsi#L150 which is not the same as the site-package in my installed python directory where pip expects the package to have previously been downloaded to.

Use exe instead of python VE

Problem

distributing the environment as a python VE is highly variable and subject to periodically going spastic.

Solution

Distribute the mbed-cli environment as a .exe, use a tool like Py2Exe or similar to take the minimal scrips and wrap them up into a .exe and distribute that instead to allow for tighter version control.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.