boskee / Minecraft

Simple Minecraft-inspired program using Python and Pyglet
MIT License
206 stars 33 forks source link

Installation matters #71

Open BertrandBordage opened 11 years ago

BertrandBordage commented 11 years ago

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:

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

People both need:

What goals we could achieve:

What do we need:

ronmurphy commented 11 years ago

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 commented 11 years ago

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- commented 11 years ago

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

ghost commented 11 years ago

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 commented 11 years ago

@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 commented 11 years ago

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

ghost commented 11 years ago

@ronmurphy Have you tried my latest changes (https://github.com/boskee/Minecraft/commit/f56844c6fd6a32759213bb6ec3fa21d4cf92e353 and https://github.com/boskee/Minecraft/commit/9bcacf98e4325ef1de1db029c29a7e84b53b07d9)? With these changes I am able to compile pyCraftr under Windows (Visual Studio 2010).

ghost commented 11 years ago

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 commented 11 years ago

@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 commented 11 years ago

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 commented 11 years ago

@BertrandBordage What about Distribute (http://pythonhosted.org/distribute/setuptools.html)? https://github.com/boskee/Minecraft/commit/7cb066d569edfb3f850edd159926de01e095114c

BertrandBordage commented 11 years ago

@avelanarius What's the advantage on distutils?

ghost commented 11 years ago

http://stackoverflow.com/questions/6344076/differences-between-distribute-distutils-setuptools-and-distutils2 :)

BertrandBordage commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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

BertrandBordage commented 11 years ago

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 commented 11 years ago

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

BertrandBordage commented 11 years ago

It seems.

ghost commented 11 years ago

dependencies and pyCraftr download/install in a single step

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

BertrandBordage commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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 notifications@github.com 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/boskee/Minecraft/issues/71#issuecomment-17245047 .

r58Playz commented 5 years ago

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 commented 5 years ago

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

Try using 0.xx for globals.APP_VERSION

r58Playz commented 5 years ago

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