Forums Archived

The forums are being archived. See this topic for more information.

Window Installer

Get help and support with Rubygame

Window Installer

Postby kiba » Thu Apr 01, 2010 2:16 am

Has anybody found a nice easy way of installing rubygame application on the desktop that doesn't require multiple steps for the user to go through? A installer that install everything they need in one click plus an icon to click on?

So far my effort is dismal and I didn't use my time wisely enough to figure out it yet.
I write libre games. My libre game programming service is also availiable for anybody that want to pay.

I ran the Libregamewiki, the free gaming encyclopedia.
kiba
 
Posts: 53
Joined: Sat Feb 07, 2009 2:13 am

Re: Window Installer

Postby tape0 » Thu Apr 01, 2010 5:44 pm

You could try rubyscript2exe, but I've never got it working. Also it looks not quite portable (it packs all files into one .exe, which when run unpacks everything into %temp%). I've written my own loader in the last 15 minutes which _should_ work but it segfaults.
Code: Select all
#include <ruby.h>
#include <stdlib.h>
#if defined(_WIN32) || defined(_MSC_VER)
#include <windows.h>
#define OS_WINDOWS
#endif

#ifdef OS_WINDOWS
int __stdcall WinMain(HINSTANCE __0, HINSTANCE __1, LPSTR __2, int __3)
#else
int main(int argc, char* argv)
#endif
{
#ifdef OS_WINDOWS
    int argc;
    char **argv;
    NtInitialize(&argc, &argv);
#endif
    ruby_init();
    ruby_script("gameloader");
    ruby_init_loadpath();
    ruby_run_node(ruby_options(argc, argv));

    rb_eval_string("Dir.chdir('..')\n");
    rb_eval_string("$: += Dir['bin/loadpath/'].collect { |n| File.expand_path(n) }\n"); // SEGFAULT
    rb_eval_string("Dir['bin/load/'].each { |n| load n }\n");
    rb_eval_string("load 'init.rb'\n");
}


Debugging sucks.
Edit: Git-Repo: http://github.com/raphaelr/cknloader
Ok, fine Markdown. I don't need stinkin' h1's anyway.
You know you are screwed when the website of the school teaching you programming is vulnerable to blasted SQL Injection.
User avatar
tape0
 
Posts: 6
Joined: Sun May 31, 2009 6:31 pm

Re: Windows Installer

Postby tape0 » Fri Apr 02, 2010 6:59 pm

Seems to work now. The new implementation is not perfect, but at least it doesn't segfault anymore.
Testproject: http://github.com/raphaelr/cknloader/downloads

Still a mess, needs a script to automatically track all required files and one to copy those to bin/loadpath. Until then,
Code: Select all
t0 = $"
require "environment.rb"
t1 = $"
delta = t1 - t0
puts delta.join("\n")

should output everything that needs to be packed. The testproject comes already with rubygame and it's dependencies packed.
You know you are screwed when the website of the school teaching you programming is vulnerable to blasted SQL Injection.
User avatar
tape0
 
Posts: 6
Joined: Sun May 31, 2009 6:31 pm

Re: Window Installer

Postby HOMER-16 » Fri Apr 02, 2010 7:28 pm

You can try Ocra which does the samething as rubyscript2exe. Though I think you need MinGW for it to work properly.
HOMER-16
 
Posts: 13
Joined: Sat Dec 19, 2009 6:02 am

Re: Window Installer

Postby kiba » Sun Apr 04, 2010 6:51 am

Yes, I tried both of these options. It doesn't work in all sort of way and the authors are missing.
I write libre games. My libre game programming service is also availiable for anybody that want to pay.

I ran the Libregamewiki, the free gaming encyclopedia.
kiba
 
Posts: 53
Joined: Sat Feb 07, 2009 2:13 am

Re: Window Installer

Postby cgmjr » Mon Apr 05, 2010 1:42 am

I'm using OCRA. It has been a lot of trial and error, and it isn't perfect, but it works ok for me. Here's what I learned to get it to work:

1. Put all those SDL goodies in the same directory as your main script,
2. Specifically tell OCRA to include all those dlls on the command line, such as:
Code: Select all
"C:\>ocra YourScript.rb *.dll"

3. In your main script, force a change directory like this:
Code: Select all
main_dir = File.dirname(__FILE__)                  #get the directory we're in

Dir.chdir main_dir  # force the working directory to be where the script resides.  This is for Ocra expansion.


Those few steps got me over the hump.

OCRA will make a single executable, and when your user executes it, it will unpack everything to a temp directory and fire up your app.
User avatar
cgmjr
 
Posts: 39
Joined: Mon Jan 11, 2010 6:41 am

Re: Window Installer

Postby kiba » Tue Apr 06, 2010 6:17 pm

cgmjr wrote:I'm using OCRA. It has been a lot of trial and error, and it isn't perfect, but it works ok for me. Here's what I learned to get it to work:

1. Put all those SDL goodies in the same directory as your main script,
2. Specifically tell OCRA to include all those dlls on the command line, such as:
Code: Select all
"C:\>ocra YourScript.rb *.dll"

3. In your main script, force a change directory like this:
Code: Select all
main_dir = File.dirname(__FILE__)                  #get the directory we're in

Dir.chdir main_dir  # force the working directory to be where the script resides.  This is for Ocra expansion.


Those few steps got me over the hump.

OCRA will make a single executable, and when your user executes it, it will unpack everything to a temp directory and fire up your app.


None of your suggestions work for me. I don't know what I am doing wrong since window give me no errors at all other than the program have a problem running. No detail details.
I write libre games. My libre game programming service is also availiable for anybody that want to pay.

I ran the Libregamewiki, the free gaming encyclopedia.
kiba
 
Posts: 53
Joined: Sat Feb 07, 2009 2:13 am


Return to Help & Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron