librelist archives

« back to archive

Accessing package directory

Accessing package directory

From:
NachoKB
Date:
2011-12-12 @ 15:02
Hi all,
  this is the first time I write to this list.

  I have a packages win32 Shoes app which need to access the directory in
which the exe is executing. From the script, Dir.pwd points to the temp
file where the tar is unpacked (which is fine for accessing files packaged
with the app). But I'm trying to access a file which will be distributed
besides this exe.

  I couldn't find any way to get this so I proposed the runtime did this:
https://github.com/shoes/shoes/issues/168

  Anyone has an idea if this is accessible (or if this is the sane way to
do it)?

  Thanks in advance,

P.S. sorry for the double post, but I guess this list will reach a broader
audience.

nachokb

Re: [shoes] Accessing package directory

From:
Steve Klabnik
Date:
2011-12-12 @ 15:13
Double posts are better than single posts, but I already posted over there. ;)

Oh, and welcome to the list.

Re: [shoes] Accessing package directory

From:
ashbb
Date:
2011-12-13 @ 12:18
Hi NachoKB,

> this is the first time I write to this list.
Welcome! Thank you for the useful proposal. I like your idea. :)

BTW, if it's okay to make a package as .shy file instead of .exe file, you
can use ARGV.

Try out the following. ;-)

- save this snippet to test.rb

   Shoes.app do
     para ARGV
   end

- make test.shy from test.rb

- run test.shy

This snippet doesn't show you the temp dir of test.rb, but shows you the
real "current directory" of test.shy.

ashbb

Re: [shoes] Accessing package directory

From:
Date:
2011-12-14 @ 08:31
Hi ashbb, i’m new to this list, Shoes and even to ruby but I’m working on it.

If I try your snippet I get 

Error in c:/shoes/0.r1134/lib/shoes/shy.rb line 32 “Invalid header”

What is the function of such a shy file ?

 

Sorry for the silly question.

Grtz

 

Peter Mariën
medewerker Informatica
_________________________________________________
CM Waas en Dender, Bogaerdstraat 33, 9200 DENDERMONDE
tel. 03 760 38 71; gsm 047-845 19 50
peter.marien@cm.be
www.cm.be
Denk aan het milieu vooraleer je dit bericht of de bijlagen afdrukt

Van: shoes@librelist.com [mailto:shoes@librelist.com] Namens ashbb
Verzonden: dinsdag 13 december 2011 13:19
Aan: shoes@librelist.com
Onderwerp: Re: [shoes] Accessing package directory

 

Hi NachoKB,

> this is the first time I write to this list.
Welcome! Thank you for the useful proposal. I like your idea. :)

BTW, if it's okay to make a package as .shy file instead of .exe file, you
can use ARGV.

Try out the following. ;-)

- save this snippet to test.rb

   Shoes.app do
     para ARGV
   end

- make test.shy from test.rb

- run test.shy

This snippet doesn't show you the temp dir of test.rb, but shows you the 
real "current directory" of test.shy.

ashbb

Re: [shoes] Accessing package directory

From:
ashbb
Date:
2011-12-14 @ 12:07
Hi Peter,

Welcome to Shoes ML! :)

> Error in c:/shoes/0.r1134/lib/shoes/shy.rb line 32 “Invalid header”
Oh, are you using Shoes 2 (0.r1134)?

If so, try the following.

- cd c:\shoes\0.r1134
- .\shoes.exe -p

You can open Shoes 2 packager window like this:

- select test.rb file with 'Browse...' button
- check 'Shoes(.shy)' and unckeck others
- click 'ok' button
- input a few informations

Then you will get 'test.shy' file.

A .shy file is an executable binary file, so it will be run when you
double-click the file.

ashbb

Re: [shoes] Shy error

From:
Date:
2011-12-14 @ 12:29
Thanks ashbb, my First binary Shoes file Works. It’s only 1KB !! Great.

At work I work with r1134 because I have windows Vista here and there are 
issues with displaying.

At home I work with most recent version but most of the time I try to work
with green shoes.

Got some issues there too, you will hear from me often I’m afraid 8>)

Grtz

 

Peter Mariën
medewerker Informatica
_________________________________________________
CM Waas en Dender, Bogaerdstraat 33, 9200 DENDERMONDE
tel. 03 760 38 71; gsm 047-845 19 50
peter.marien@cm.be
www.cm.be
Denk aan het milieu vooraleer je dit bericht of de bijlagen afdrukt

Van: shoes@librelist.com [mailto:shoes@librelist.com] Namens ashbb
Verzonden: woensdag 14 december 2011 13:07
Aan: shoes@librelist.com
Onderwerp: Re: [shoes] Accessing package directory

 

Hi Peter,

Welcome to Shoes ML! :)

> Error in c:/shoes/0.r1134/lib/shoes/shy.rb line 32 “Invalid header”
Oh, are you using Shoes 2 (0.r1134)?

If so, try the following.

- cd c:\shoes\0.r1134
- .\shoes.exe -p

You can open Shoes 2 packager window like this: 

- select test.rb file with 'Browse...' button
- check 'Shoes(.shy)' and unckeck others
- click 'ok' button
- input a few informations

Then you will get 'test.shy' file.

A .shy file is an executable binary file, so it will be run when you 
double-click the file.

ashbb

Re: [shoes] Shy error

From:
ashbb
Date:
2011-12-14 @ 14:21
Hi Peter,

> At home I work with most recent version but most of the time
> I try to work with green shoes.
Wow, cool!

> Got some issues there too, you will hear from me often I’m afraid 8>)
Feel free let me know anything you found.
Let's improve Green Shoes!! ;-)

Cheers,
ashbb

Re: [shoes] Accessing package directory

From:
ashbb
Date:
2011-12-14 @ 12:15
Oops, forgot to add this link:
http://www.rin-shun.com/tmp/shoes2_packager.png

ashbb