From: James Britt Date: 2005-06-23T22:55:03+09:00 Subject: Re: Packaging dillema Joe Van Dyk wrote: > I just realized that using Rubyscript2exe with sqlite probably isn't a > good idea, since the database disappears once the application gets > shut down, and I need the database to persist between application > launches. Hm. I had a similar problem early this year. Working a contract job, I wanted to get co-workers to test a Web app using WATIR (the very cool IE-based Web testing framework) without them having to install Ruby. I used Rubyscript2exe to bundle up the application. The main app would start an instance of WEBrick, pause a bit, then launch a browser to point to the WEBrick instance. The default page would prompt the use for a base test site URL, and list the names of test scripts that were stored in a subdirectory. Once could then click on a link for test script, which would then drive WATIR. The tricky part was that I wanted people to be able to create their own test scripts, and not lose them when the main app was closed. (The test scripts were Ruby code, but I created a DSL so that writing one's own examples did not require knowing any real Ruby, though it was always an option for those with more ambition.) My solution was to create the exe, and bundle it in a zip file with sample scripts and a default config file. The installation was basically to unzip the bundle to create the application directory structure and default files, then just run the main app exe. I believe that the executable created by Rubyscript2exe knows from what directory it is launched, so the code kicked off it could figure out where to look for script files relative to its execution point, and where to write out any logs. (I cannot find any actual code right now or I would show an example, or at least confirm my recollection of why this worked.) But if you can have your installation create a permanent subdirectory then you can get your code to read and write to safe location. James Britt -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys