Re: [pygame] Distributing games for Windows - Pynsist
On 25 October 2016 at 23:52, Jorge Maldonado Ventura < jorgesu...@freakspot.net> wrote: > I tried the installer I created, but it didn't work. Apparently it > installs correctly, but it doesn't launch the game. I'm using a Windows 8 > virtual machine. I tried to debug, but I have no idea in Windows. I > observed that the program in the Windows menu links to a file called > pythonw when installed, how can I get the error message that helps me > understand and solve the problem. > It should log errors to a file in %APPDATA% - details here: http://pynsist.readthedocs.io/en/latest/installers.html#uncaught-exceptions You can also launch it from the command line to see uncaught exceptions. More info in the same link above. > Is there a way to test or debug the installer in GNU/Linux? > I don't think so, though you could try installing it under Wine. I try to put as much of the complexity as possible in the build process, which can be tested more easily, so that the installer can be as simple as possible. > Here is the installer.cfg file I used to build the executable: > That all looks good to me :-) Thomas
Re: [pygame] Distributing games for Windows - Pynsist
On 2016-10-25 11:40, Thomas Kluyver wrote: > Hi Jorge, > > On 25 October 2016 at 00:00, Jorge Maldonado Ventura > wrote: > >> Here is what I got, but I want to distribute just one executable file; can I >> do that with your program? >> >> ~/Code/Repos/bullet_dodger_stable/build/nsis $ ls -l >> total 49272 >> drwxr-xr-x 2 jorge jorge 4096 Oct 24 18:57 assets >> -rw-r--r-- 1 jorge jorge 2344 Oct 24 19:05 Bullet_dodger_1.6.10.exe >> -rw-r--r-- 1 jorge jorge 1293 Oct 24 19:05 Bullet_dodger.launch.pyw >> -rw-r--r-- 1 jorge jorge 790 Oct 24 18:56 bullet.ico >> -rw-r--r-- 1 jorge jorge 6344 Oct 24 19:05 installer.nsi >> -rw-r--r-- 1 jorge jorge 34570 Oct 24 18:52 LICENSE >> drwxr-xr-x 4 jorge jorge 4096 Oct 24 19:05 pkgs >> drwxr-xr-x 2 jorge jorge 4096 Oct 24 19:05 Python >> -rw-r--r-- 1 jorge jorge 29269656 Oct 24 19:00 python-3.5.2.exe >> -rw-r--r-- 1 jorge jorge 2360 Oct 24 18:48 windowsversion.nsh > "Bullet_dodger_1.6.10.exe" is the only file you need to distribute; the > others were involved in building that. However, it is an installer - so when > the user double clicks it, they will get a standard installation wizard to > set up your game. Pynsist does not make an exe that runs your game directly. > > Thomas I tried the installer I created, but it didn't work. Apparently it installs correctly, but it doesn't launch the game. I'm using a Windows 8 virtual machine. I tried to debug, but I have no idea in Windows. I observed that the program in the Windows menu links to a file called pythonw when installed, how can I get the error message that helps me understand and solve the problem. Is there a way to test or debug the installer in GNU/Linux? Here is the installer.cfg file I used to build the executable: [Application] name=Bullet dodger version=1.6.10 # How to launch the app - this calls the 'main' function from the 'myapp' package: entry_point=bullet_dodger.main:start_screen icon=bullet_dodger/assets/bullet.ico [Python] version=3.5.2 bitness=32 format=bundled [Include] # Importable packages that your application requires, one per line pypi_wheels= pygame==1.9.2b1 # Other files and folders that should be installed files = LICENSE And here is my game: https://notabug.org/jorgesumle/bullet_dodger
Re: [pygame] Distributing games for Windows - Pynsist
Hi Jorge, On 25 October 2016 at 00:00, Jorge Maldonado Ventura < jorgesu...@freakspot.net> wrote: > Here is what I got, but I want to distribute just one executable file; can > I do that with your program? > > ~/Code/Repos/bullet_dodger_stable/build/nsis $ ls -l > total 49272 > drwxr-xr-x 2 jorge jorge 4096 Oct 24 18:57 assets > -rw-r--r-- 1 jorge jorge 2344 Oct 24 19:05 Bullet_dodger_1.6.10.exe > -rw-r--r-- 1 jorge jorge 1293 Oct 24 19:05 Bullet_dodger.launch.pyw > -rw-r--r-- 1 jorge jorge 790 Oct 24 18:56 bullet.ico > -rw-r--r-- 1 jorge jorge 6344 Oct 24 19:05 installer.nsi > -rw-r--r-- 1 jorge jorge34570 Oct 24 18:52 LICENSE > drwxr-xr-x 4 jorge jorge 4096 Oct 24 19:05 pkgs > drwxr-xr-x 2 jorge jorge 4096 Oct 24 19:05 Python > -rw-r--r-- 1 jorge jorge 29269656 Oct 24 19:00 python-3.5.2.exe > -rw-r--r-- 1 jorge jorge 2360 Oct 24 18:48 windowsversion.nsh > "Bullet_dodger_1.6.10.exe" is the only file you need to distribute; the others were involved in building that. However, it is an installer - so when the user double clicks it, they will get a standard installation wizard to set up your game. Pynsist does not make an exe that runs your game directly. Thomas
Re: [pygame] Distributing games for Windows - Pynsist
On 2016-10-24 18:39, Thomas Kluyver wrote: > I've mentioned this on the list before, but some changes since then have made > it easier to use with Pygame. > > Pynsist (https://pynsist.readthedocs.io/ [1] ) is an open source tool to > build Windows installers for Python applications. It's based on the popular > NSIS installer system, which makes it possible to build installers even on > Linux or Mac systems. > > Pynsist can now download wheels from PyPI to include in an installer. Since > pygame has (beta) Windows wheels, it's much easier to include Pygame in an > installer than last time I posted here. Here's an example of building an > installer for the 'aliens' example game: > https://github.com/takluyver/pynsist/tree/master/examples/pygame [2] > > I'm happy to answer questions about it here, on Github, and on Stackoverflow > (tag: pynsist). > > Thanks, > Thomas Hello, Thomas I tried to make an executable for my game Bullet dodger following the example you linked to. Here is what I got, but I want to distribute just one executable file; can I do that with your program? ~/Code/Repos/bullet_dodger_stable/build/nsis $ ls -l total 49272 drwxr-xr-x 2 jorge jorge 4096 Oct 24 18:57 assets -rw-r--r-- 1 jorge jorge 2344 Oct 24 19:05 Bullet_dodger_1.6.10.exe -rw-r--r-- 1 jorge jorge 1293 Oct 24 19:05 Bullet_dodger.launch.pyw -rw-r--r-- 1 jorge jorge 790 Oct 24 18:56 bullet.ico -rw-r--r-- 1 jorge jorge 6344 Oct 24 19:05 installer.nsi -rw-r--r-- 1 jorge jorge34570 Oct 24 18:52 LICENSE drwxr-xr-x 4 jorge jorge 4096 Oct 24 19:05 pkgs drwxr-xr-x 2 jorge jorge 4096 Oct 24 19:05 Python -rw-r--r-- 1 jorge jorge 29269656 Oct 24 19:00 python-3.5.2.exe -rw-r--r-- 1 jorge jorge 2360 Oct 24 18:48 windowsversion.nsh I thought that bundled option meant one .exe file, but maybe I made the installer.cfg wrong, any help is really appreciated: [Application] name=Bullet dodger version=1.6.10 # How to launch the app - this calls the 'main' function from the 'myapp' package: entry_point=bullet_dodger.main:start_screen icon=bullet_dodger/assets/bullet.ico [Python] version=3.5.2 bitness=32 format=bundled [Include] # Importable packages that your application requires, one per line pypi_wheels= pygame==1.9.2b1 # Other files and folders that should be installed files = LICENSE bullet_dodger/assets Links: -- [1] https://pynsist.readthedocs.io/ [2] https://github.com/takluyver/pynsist/tree/master/examples/pygame
Re: [pygame] Distributing games for Windows - Pynsist
On 24 October 2016 at 22:33, Yann Thorimbert wrote: > This sounds nice, I will try soon. Until now, I've always used py2exe in > order to provide "standalone" windows version of my python-pygame scripts. > What are the pros and cons, in your opinion, to use py2exe or a method like > pynsist ? The main pros & cons for Pynsist are: Pros: Code that works in development is more likely to work for users - it runs more 'normally' than a frozen exe. Plus building installers from Linux is nice if, like me, you don't use Windows much. Cons: You get an installer, not just an exe to launch. (Not a con under all circumstances, but it is less flexible) There's a bit more comparison in the FAQs: http://pynsist.readthedocs.io/en/latest/faq.html#alternatives Thomas
RE: [pygame] Distributing games for Windows - Pynsist
?Hello, This sounds nice, I will try soon. Until now, I've always used py2exe in order to provide "standalone" windows version of my python-pygame scripts. What are the pros and cons, in your opinion, to use py2exe or a method like pynsist ? Thanks, Yann De : owner-pygame-us...@seul.org de la part de Thomas Kluyver Envoyé : lundi 24 octobre 2016 18:39 À : pygame-users Objet : [pygame] Distributing games for Windows - Pynsist I've mentioned this on the list before, but some changes since then have made it easier to use with Pygame. Pynsist (https://pynsist.readthedocs.io/ ) is an open source tool to build Windows installers for Python applications. It's based on the popular NSIS installer system, which makes it possible to build installers even on Linux or Mac systems. Pynsist can now download wheels from PyPI to include in an installer. Since pygame has (beta) Windows wheels, it's much easier to include Pygame in an installer than last time I posted here. Here's an example of building an installer for the 'aliens' example game: https://github.com/takluyver/pynsist/tree/master/examples/pygame I'm happy to answer questions about it here, on Github, and on Stackoverflow (tag: pynsist). Thanks, Thomas