Skip to content
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? Sign in to your account

Installation matters #71

Open
BertrandBordage opened this issue Apr 27, 2013 · 26 comments
Open

Installation matters #71

BertrandBordage opened this issue Apr 27, 2013 · 26 comments

Comments

@BertrandBordage
Copy link
Collaborator

Not a critical issue, but it's a tiny effort that stops the distribution of this project.

Currently, using pyCraftr is easy for geeks. Install pyglet, clone the repository and that's all.

For other people, it's not that easy. This requires to know how to:

  • install dependencies
  • use command-line
  • use git to update the game

Maybe 30 % of Linux users know how to use it. And something like 0.05 % of Mac and Windows users do.

People both need:

  • that dependencies and pyCraftr download/install in a single step
  • a launcher with an icon
  • an easy way to update the game

What goals we could achieve:

  • have Ubuntu (sorry for other distros), MacOS and Windows installers including dependencies and launcher(s)
  • add the game to the Ubuntu software center (when the project will be stable and less "alpha-like") ; that will be a good ad

What do we need:

  • a name. Now that anybody calls this "pyCraftr", why not choosing this? See Project name #21.
  • version numbers. I suggest http://guide.python-distribute.org/specification.html#sequence-based-scheme
  • an icon
  • a module structure, so that the launcher can find the game installed somewhere in PYTHON_PATH
  • improve setup.py and distribute packages somewhere
  • MacOS and Windows scripts to update the game, probably based on git tags
  • Choose what tools to use to produce packages. Distutils contains a way to build Ubuntu and Windows packages, but this might not be enough.
@ronmurphy
Copy link
Collaborator

I have VS.Net 2012 and Cython, and using these commands, i can almost do a build...

SET VS90COMNTOOLS=%VS110COMNTOOLS%

python setup.py build --compiler msvc

it almost works.

I am hoping that when i compile it, it will include pyglet, etc.. and i can just make a setup file for windows to include the other resource files (fonts, textures, sounds...)

And I was the one to change the name form Pyglet Windows to pyCraftr, it kind of made sense, and i would be happy leaving it as it, but that is just me.

@Nebual
Copy link
Collaborator

Nebual commented Apr 28, 2013

We need to drop the r. pyCraft or Pynecraft I say.

I don't feel we need a launcher, at least not like Minecraft's. The main menu basically functions as a launcher, and we can add update functionality to it if we want it. With python installed on Windows, I can just double click main.py and it runs fine, so I don't see how a launcher would make anything "easier" for the end user either. You can now launch server.py via the main menu (in my repo, which I hope to merge tonight) too.

While version numbers are a good idea, I think its still too early for them to be useful. The game is not yet suitable for non developers (its not fun enough yet). An auto updater is an excellent idea, if it still used git.

@Jimx-
Copy link
Collaborator

Jimx- commented Apr 28, 2013

Why not make a script to download pyglet and other libraries and install them automatically, that will be convenient.

@ghost
Copy link

ghost commented Apr 28, 2013

add the game to the Ubuntu software center (when the project will be stable and less "alpha-like")

We don't have to start with adding our game to Ubuntu Software Center - we can create PPA (on Launchpad). More about it.

Another solution: http://wiki.debian.org/Teams/PythonAppsPackagingTeam or https://wiki.ubuntu.com/UbuntuDevelopment/NewPackages

a name. Now that anybody calls this "pyCraftr", why not choosing this? See #21.

I also think that it should be "official" name.

version numbers

In my opinion we should use major number 0 for "alpha" version.

an icon

Maybe Minecraft-like icon with some Python logo element?

@BertrandBordage
Copy link
Collaborator Author

@avelanarius yeah, creating a PPA is a good idea. I also agrea that we should use 0.x.x as version numbers for now. And what about a rasterized and "cubed" python logo? :P

@ronmurphy
Copy link
Collaborator

Dont forget that we need to do a windows and mac client. Still trying to get the game to compile under Windows.

@ghost
Copy link

ghost commented Apr 29, 2013

@ronmurphy Have you tried my latest changes (f56844c and 9bcacf9)? With these changes I am able to compile pyCraftr under Windows (Visual Studio 2010).

@ghost
Copy link

ghost commented Apr 29, 2013

Also under Windows there is an interesing command:

python setup.py bdist_wininst

If you want to make things really easy for your users, you can create one or more built distributions for them. For instance, if you are running on a Windows machine, and want to make things easy for other Windows users, you can create an executable installer (the most appropriate type of built distribution for this platform) with the bdist_wininst command

But I'm not sure if it really works (but certainly it doesn't include libraries).

@ronmurphy
Copy link
Collaborator

@avelanarius I JUST got the project to compile by way of this...

SET VS90COMNTOOLS=%VS110COMNTOOLS%
python setup.py install build --compiler=msvc

but i dont know where the windows exe is stores afterwards. I will try the above way!

edit: the above way does work, i will try to make a setup installer to download the needed dependent files and install them prior the actual setup, then the game.

@ronmurphy
Copy link
Collaborator

ok here is my build4win.bat , it does a fresh compile every time, for whatever new features, etc... that have been added in.

@echo off
echo Setting tools to VS2012...
SET VS90COMNTOOLS=%VS110COMNTOOLS%
echo Clearing old compile files (if the exist)...
del *.pyc
del *.c
del *.h
del *.so
echo Doing a fresh compile...
python setup.py build --compiler=msvc
echo Packaging for Windows (w/o dependents...)
python setup.py bdist_wininst
echo Done.
@echo on

@ghost
Copy link

ghost commented Apr 30, 2013

@BertrandBordage
Copy link
Collaborator Author

@avelanarius What's the advantage on distutils?

@BertrandBordage
Copy link
Collaborator Author

I meant, what additional feature of Distribute would you like to use? Cause Distribute is itself an additional dependency, so it seems quite counterproductive…

@ghost
Copy link

ghost commented Apr 30, 2013

Stupid question, but does setuptools / distutils have this function (at build time)?

Automatically find/download/install/upgrade dependencies at build time using the EasyInstall tool, which supports downloading via HTTP, FTP, Subversion, and SourceForge, and automatically scans web pages linked from PyPI to find download links. (It’s the closest thing to CPAN currently available for Python.)

@ghost
Copy link

ghost commented Apr 30, 2013

Yes... So we don't need Distribute...

@BertrandBordage
Copy link
Collaborator Author

Hum… I can't find it. There's a install_requires command in Distribute and setuptools, but not in distutils. And AFAIK, distutils is officially the package to use.

@ghost
Copy link

ghost commented Apr 30, 2013

So automatic downloading of dependencies is only available in setuptools (and Distribute) and not distutils?

@BertrandBordage
Copy link
Collaborator Author

It seems.

@ghost
Copy link

ghost commented Apr 30, 2013

dependencies and pyCraftr download/install in a single step

And with setuptools / Distribute it would be easier to achieve.

@BertrandBordage
Copy link
Collaborator Author

I agree, we have to do things the right way: if possible, with distutils, if not, with setuptools. However, we will need an OS-specific way to install dependencies such as OpenAL.

Nebual suggested PyInstaller to make OS-dependant complete installers. That's probably a good solution for us to produce easy installers. But we also need a clean setup.py for developpers (at least for Cython).

@Nebual
Copy link
Collaborator

Nebual commented Apr 30, 2013

I don't believe PyInstaller actually makes "installers", they're standalone executables.

Its pretty good at finding dependencies and packaging them with the executable though, optionally even including python itself as a dependency.

@ronmurphy
Copy link
Collaborator

py2exe does good for a windows setup file, but i dont know how to specify
dependent files or folders.

On Tue, Apr 30, 2013 at 2:21 PM, Nebual [email protected] wrote:

I don't believe PyInstaller actually makes "installers", they're
standalone executables.

Its pretty good at finding dependencies and packaging them with the
executable though, optionally even including python itself as a dependency.


Reply to this email directly or view it on GitHubhttps://github.com//issues/71#issuecomment-17245047
.

@r58Playz
Copy link

I have a updater script:

from subprocess import check_call as run
import shutil
import os
import time
import sys

def update():
    UPDATE_CMD = ( # base command 
    'git clone ' 
    'update_url updatedir --quiet'   #quiet means it won't print anything
    )
    try:
        run(UPDATE_CMD)
    except:
        print("An error occured. Exiting...")
        time.sleep(3)
        sys.exit()
    files=os.listdir("updatedir")
    for fle in files:
        full_filename = os.path.join("updatedir", fle)
        if os.path.isfile(full_filename):
            if file != "update.py":
                current_dir=os.path.basename(os.getcwd())
                shutil.copy(full_filename, current_dir)
    os.system('powershell.exe rm -r -fo updatedir')

but it works on windows only.
You could add a check for windows and run
os.system('powershell.exe rm -r -fo updatedir'),
otherwise run
os.system('rm -rf updatedir')

@r58Playz
Copy link

I also agrea that we should use 0.x.x as version numbers for now.

Try using 0.xx for globals.APP_VERSION

@r58Playz
Copy link

I've tried PyInstaller, it doesn't work with the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants