platformio / platformio-core

Your Gateway to Embedded Software Development Excellence :alien:
https://platformio.org
Apache License 2.0
7.68k stars 780 forks source link

Platform IO Bundled Distribution for Windows #448

Open AutomationD opened 8 years ago

AutomationD commented 8 years ago

As some Windows user might not have any console tools installed I would like to see platformio distributed as some self-contained archive/exe file for Windows users. It should contain python distribution and some nice colorful command line + GUI (which is in the works). This should be done side-by-side to existing pip installation or even on top of it.

Please let me know what you think

alonewolfx2 commented 8 years ago

+1 thank you for suggestions. I hope someone can make it.

ZachMassia commented 8 years ago

I think Nuitka might be worth looking into for this.

From what I've read, it can't do cross-platform compilation, so someone with a Windows PC would have to give it a shot.

The following command from the PlatformIO root dir should produce a completely portable .exe which would work on a fresh Windows install, no external dependancies.

nuitka --recurse-all --standalone ./platformio

I've tried it on my Mac and can confirm that it does compile without errors. Don't mind the .exe, Nuitka appends it to the generated executable on all operating systems.

git clone https://github.com/platformio/platformio
cd platformio

nuitka --recurse-all --standalone ./platformio
[compile output not shown]

cd platformio.dist
./platformio.exe --version
PlatformIO, version 2.7.2.dev0
ivankravets commented 8 years ago

Thanks @ZachMassia. I didn't know about Nuitka.

  1. I see that users will have problems that need to add path of binary to ENV.PATH
  2. The upgrade process will be so difficult. The platformio upgrade looks more interesting.

Windows users don't like to play with console utilities. If user can download and install pre-compile platformio.exe, then it will not have problems to pip install platformio.

My propositions:

  1. If Windows user wants to use PlatformIO as CLI, then will install it in generic way (via pip or installer script http://docs.platformio.org/en/latest/installation.html#b-installer-script).
  2. We are working on the own solution (IDE, or plugins for IDE) where user will "DOWNLOAD & USE" and PlatformIO will be included in IDE/Plugin.
ivankravets commented 8 years ago

I've released beta version PlatformIO IDE for Atom today. It contains built-in PlatformIO CLI tool and Terminal. Also, users have ability to install this built-in PlatformIO CLI tool globally using Menu: PlatformIO > Install Shell Commands, then open system Terminal and platformio and pio should be available.

gepd commented 8 years ago

@ZachMassia I've tried what you described but I didn't get the same results.

First try:

  1. I cloned the platformio repository in the desktop
  2. ran nuitka --recurse-all --standalone ./platformio

When it start to compile shows me a lot of warnings like cannot find 'package_name' as relative or absolute import

When the compilation finished, I ran platformio.exe --version and the output is ImportError: No module named _socket

Second try:

  1. I compile from C:\Python27\Lib\site-packages\platformio

Same warning outputs

But when I run platformio.exe --version It shows me the version I've installed

when I move the platformio.dist folder to other location I get the error ImportError: No module named _socket again

I'm using Win10, Python 2.7.x - 3.5.x

You know what can I be doing wrong?

gepd commented 8 years ago

cx_Freeze (Download) Seems to be a better alternative because it doesn't "hide" the source files, so the upgrade option should work. (In theory) and it's cross-platform too

I've compile the code but I still have to know how to including all the platformio files (code). With the basic setup.py configuration, are available the commands lib, platforms, upgrade

When I run __main__ --version the output is: PlatformIO, version 2.8.3 (the name __main__ is easy to fix, only have to edit two files, but until now I'm trying to get work the whole code)

I think it's because the missing files, Is there someone with any experience using cx_Freeze?

Edit

Seems like doing some changes in the setup.py and in some files of platformio is possible to have a portable version, I'm still testing all the options of platformio, but it could work fine

gerritv commented 8 years ago

All Windows version in recent history have cmd.exe available very easily. Just Shift/Right click on a directory in Windows Explorer and click on Open Command Window Here.