ClimenteA/pyvan

Find a way to convert the .bat file to .exe and also possibility to set an icon

Closed this issue · 16 comments

For now pyvan just makes a link using a .bat file between the python.exe and the main.py file.
Must find a way to convert the .bat file to .exe and also set and icon for the .exe resulted.

Forget shortcuts, I opened #25 to properly deal with this problem.

Installed windows 10 on a vm to test it but unfortunately it didn't work:

pyvan exe error

@ClimenteA Ah those are the missing visual c++ redistributables on your system. Those can be installed separately from here (https://aka.ms/vs/16/release/VC_redist.x64.exe) or can potentially be embedded with the distribution (I.e. shipping the dlls).

It works with python main.py (windows has installed Python)

It works with python main.py (windows has installed Python)

Yeah the redistributables are only necessary for the executable

Additional instalation of c++ redistributables it's not ideal.. Not sure if using nim instead of C++ would make a dependency free .exe

Additional instalation of c++ redistributables it's not ideal.. Not sure if using nim instead of C++ would make a dependency free .exe

No, I agree, I already rebuild the .exe in a stand-alone executable in the gen-exe Python library that doesn't need the redistributable anymore, see: #25

main.exe worked after gen-exe update, but ignores the show_console argument..

console false ignored

Ok, great that the executable works now!

Strange that the show_console doesn't work for you. it works for me, see below:

image

Some questions:

  • Did you test this in a VM, which Windows version do you have installed?
  • Does the main.exe screen that I see in the screenshot popup after double-clicking the exe?
  • Do you see the output when you run it from the Windows command line?
  • What is show_console supposed to do exactly? Right now I only change if it invokes python or pythonw for the command generating the executable. And if show_console is False I prepend the code snippet that you created to the main.py.

It's a virtualbox from oracle with windows 10 (I'm on ubuntu).

show_console : true should show both the window app and the cmd window.

show_console: false should hide the black cmd window and show only the app window. In our case if show console is false we should see only the chrome window which contains Flask desktop application

In your screenshot that should appear for show_console true

So if I get it correct the dist build of the flaskapp with show_console=True, goes well. But the dist build of the flaskapp with show_console=False goes wrong. So in table form:

flaskapp dist build

show_console=True show_console=False
via command line run main.exe works works*
via double click main.exe works fails*

With show_console=False I get on my Windows 10 machine:

For execution of dist/main.exe via the command line, it appears to work like I would do it on the command line with show_console=True. So that seems fine?

For double click execution in windows explorer, I get a black console Window popup and the flask application doesn't launch?

image

Do you have similar issues?

With show_console=False we should see only the window with 127.0.0.1 (it's a chrome window). That black console window popup shouldn't appear for show_console=False.

My reasoning when I made show_console option was to have 2 options for an app.

  • show_console=False was for gui applications
  • show_console=True for simple command line apps that just have simple inputs and you just need to see what's going on with the process.

With the batch version it works.

  • with show_console=False when you double click on the batch file it will show the batch file for less then a second and then open the gui app.
  • with show_console=True when you double click on the batch file it will show the batch file output and the gui app (like you had in the previous screenshot).

Ok, #27 should properly fix this issue now. It now fully works using the executables under my Windows distribution.

Works perfectly!

I think pyvan it's now a viable option among pyinstaller, cx-freeze, py2exe which in addition ships with a modifiable source code.