8000 Convert bCNC to exe Setup File without any library · Issue #437 · vlachoudis/bCNC · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Convert bCNC to exe Setup File without any library #437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? 8000 Sign in to your account

Closed
MohamadAlsadi opened this issue Sep 23, 2016 · 30 comments
Closed

Convert bCNC to exe Setup File without any library #437

MohamadAlsadi opened this issue Sep 23, 2016 · 30 comments
Labels
enhancement OS Windows release engineering how bCNC gets from developers to users (and back)
Milestone

Comments

@MohamadAlsadi
Copy link
MohamadAlsadi commented Sep 23, 2016

No description provided.

@HomineLudens
Copy link
Contributor

Hi @MohamadAlsadi ,

try this:
in the bCNC.py change this line

PRGPATH=os.path.abspath(os.path.dirname(__file__))

with this

if getattr(sys, 'frozen', False):
    # frozen
    PRGPATH=os.path.abspath(os.path.dirname(sys.executable))
else:
    # unfrozen
    PRGPATH=os.path.abspath(os.path.dirname(__file__))

In this way I can build a really nice exe that seems to works, and could be added to the distribution.

Here my setup.py

import sys
from cx_Freeze import setup, Executable

# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["os"]}

# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
    base = "Win32GUI"

setup(  name = "bCNC",
        version = "0.1",
        description = "Grbl sender and more",
        options = {"build_exe": build_exe_options},
        executables = [Executable("bCNC.py", base=base)])

and the I run python setup.py build
Copy everything from the dist folder to the main folder to access graphical resources etc.

Keep us posted about your test.

@HomineLudens
Copy link
Contributor
HomineLudens commented Sep 23, 2016

Here it is @MohamadAlsadi ,
just unzip and run bCNC.exe
Tested on Win10 (with python and other stuff) and WinXp (clean machine).
With tested I mean that it start... can't try with the machine right now.

bCNC4Win.zip

@MohamadAlsadi
Copy link
Author

ok thank you @effer
it is work

@HomineLudens
Copy link
Contributor

Wow, never hope this could work at first shot. A ready exe without dependency to install will be a nice addition for windows users

@vlachoudis
Copy link
Owner

@effer Does it require python to be installed?

@MohamadAlsadi
Copy link
Author

No
it not required paython
I try it on windows 10 without paython

On Sep 23, 2016 10:27 PM, "Vasilis Vlachoudis" notifications@github.com
wrote:

@effer https://github.com/Effer Does it require python to be installed?


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#437 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AUOy794MZawGnbfdMUTDM_uPt9V3ALa6ks5qtCgEgaJpZM4KEpj5
.

@HomineLudens
Copy link
Contributor

Tested with a clean PC (Win10) from USB key.
Even the camera stuff work (opencv, PIL) but still some of plugin is not loaded. It seems like it can't recognise "from fractions import gcd" that I left on some of the plugin even if not used.

Anyway really a cool feature. @vlachoudis what you think about add a branch with the exe for windows?
I could keep it in sync with the release if you dont' have access to a win machine.

@vlachoudis
Copy link
Owner

@effer is a good idea. How big is the executable?

@HomineLudens
Copy link
Contributor

Executable itself 721 Kb. With all necessary library generated (dll,pyd etc) and bCNC stuff (icon, etc) we rise up to about 35Mb.
It seems like it can't output a single big exe with everything inside. Only external dependency will be Microsoft Visual C++ Redistributable that is quite common to find already installed in windows.

@Terminator88
Copy link

Thank advanced to Effer 👍 . I search very much website to solve my issue, but unknow that I just copy everything from build folder to the main folder. Ha ha ha :)

@HomineLudens
Copy link
Contributor

@Terminator88 you're welcome.

@Terminator88
Copy link

@effer I have new issue, I unknow why, file .exe still run in process manager when I exit software. Do you have any solve for this ?
anh

@HomineLudens
Copy link
Contributor
HomineLudens commented Apr 15, 2017 8000

@Terminator88 never see that. Are you using cx_freeze or py2exe?

@Terminator88
Copy link

I use cx_freeze like you, I don't know why your software can complete shutdown, but my software is still run underground.

@hznupeter
Copy link

@effer your exe is worked on my loptop.
I hope the exe could be put into release

@hznupeter
Copy link

the exe has a small bug,it can't be closed by close button or exit button

@justinclift
Copy link
Contributor

As a data point, since it sounds like there's a working .exe + a few support files pretty much ready to go, it probably wouldn't be very difficult to use something like NSIS to package it into a reasonable Windows .exe. That'd give people a simple install/uninstall process with sane defaults (eg install location).

@FatNarval
Copy link

Hi folks, it would be nice to see bcnc4win with new updated features!
Any progress so far?

@FatNarval FatNarval mentioned this issue Oct 30, 2018
@Harvie Harvie added the release engineering how bCNC gets from developers to users (and back) label Oct 30, 2018
@Harvie
Copy link
Collaborator
Harvie commented Oct 30, 2018

Also there's some project called PyInstaller, It looks quite promissing.
Only problem is that it cannot build cross platform, so we need some Windows users to do this for us. I run Linux. It would be nice if we can find someone willing to do this on regular basis. Best case would be if we find somebody, able to automatize this build and publish nightly packages on some website.

https://medium.com/dreamcatcher-its-blog/making-an-stand-alone-executable-from-a-python-script-using-pyinstaller-d1df9170e263

@FatNarval
Copy link

Thanks, I'll try my luck with this one!

@Harvie
Copy link
Collaborator
Harvie commented Oct 30, 2018

@FatNarval thanks. but note that you first have to get bCNC working on your machine, because these packagers will most likely get the needed libraries from your computer.

@Harvie Harvie added this to the 0.9.15 milestone Nov 13, 2018
@Harvie
Copy link
Collaborator
Harvie commented Nov 13, 2018

I want to have exe for 0.9.15 release. is there somebody to prepare the build process?

@FatNarval
Copy link

I can not do it, anyone else?

@Harvie
Copy link
Collaborator
Harvie commented Nov 20, 2018

There is now much easier way of installing bCNC on Windows:
#964 (comment)

Harvie added a commit that referenced this issue Nov 21, 2018
@Harvie
Copy link
Collaborator
Harvie commented Nov 21, 2018

I've managed to build the .exe, you can try beta here:

https://github.com/vlachoudis/bCNC/releases/download/0.9.14.29.beta.exe/bCNC-0.9.14.30-beta-git-exe.zip

Build process seems to work well. You can expect similar build to be part of 0.9.15 release.
I am closing this for now. Please let me know if something is wrong. But note that this .exe is built on top of development bCNC version, which might have some problems unrelated to .exe build itself. So please first check that reported problem happens only in .exe version, but not when running in python directly.

@Harvie Harvie closed this as completed Nov 21, 2018
Harvie added a commit that referenced this issue Nov 21, 2018
Harvie added a commit that referenced this issue Nov 21, 2018
@FatNarval
Copy link

Camera feature seems not to work at all .

@FatNarval
Copy link

In Windows 7, when bCNC gui window is minimized to taskbar, while active dialog box/window of bcnc is active, bCNC keeps minimizing itself, effectively preventing itself from using again, until restarting it.

@Harvie
Copy link
Collaborator
Harvie commented Dec 2, 2018

@FatNarval Can you try to rebuild the .exe yourself? If you get non-exe bCNC working, it should be pretty easy to build using make-exe.bat file. Given that you have python and pip in your PATH.
I've been building this on Windows XP. That might be a problem.

@Harvie
Copy link
Collaborator
Harvie commented Dec 25, 2018

Travis now supports running on windows. Currently they don't have python support. But i guess they will add it in following months. That means we will be able to use travis cloud to automaticaly build and upload .exe of each release for us (since it will be possible to run make-exe.bat using travis)

@Harvie
Copy link
Collaborator
Harvie commented Jan 9, 2019

I've just realized that we might not need windows builds at all. We can just compile some kind of loader to that .exe and load the .py files using it... So there will be no need to rebuild the loader as long as there will be no changes to loader itself or the requirements.

Some of the .py files are not compiled to .exe anyway (eg. plugins). So i think it would make sens to not compile any at all.

rar8000 pushed a commit to rar8000/bCNC that referenced this issue Jul 21, 2023
rar8000 pushed a commit to rar8000/bCNC that referenced this issue Jul 21, 2023
rar8000 pushed a commit to rar8000/bCNC that referenced this issue Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement OS Windows release engineering how bCNC gets from developers to users (and back)
Projects
None yet
Development

No branches or pull requests

8 participants
0