I'm trying to figure out if there is a way to include file paths in ocra and still have the application make an exe. I have it set up so that the .exe generated by ocra would sit on the same directory level as another folder. That folder is named 'Place Files Here', and the program simply performs regex commands on text files in the 'Place Files Here' folder. I can run ocra without errors if I use only Dir.getwd, but if I try to add directory = Dir.getwd + '/Place Files Here' it won't run. Any help would be greatly appreciated. Thanks!
A:
On a second look I'm not sure I understand what your exactly trying to do.
You add directories to the .exethem by passing them as command line parameters like:
orca myscript.rb filepath/** anotherPath/** filepath/yetanotherpath/**
You can access all the files in the same directory as the .exe in your script with like noraml
This is covered in the documentation: ocra docs
JustSmith
2010-04-29 18:00:19
I'm still kind of confused how to use the command line arguments when making the exe... I don't want it to access the files in the same level, I would like it to access the files located in the 'Place Files Here' folder. The structure looks like this...Top Level Folder -> +Regex.rb(file) +Place Files Here(folder)Also, I don't want it to access specific files since they are subject to change. I would just like to point it at a directory.
Ruby Novice
2010-04-29 18:14:32
I see this breaking down into these cases. One: Accessing files that exist before packaging. These will have to be added with the command line parameter. Two: Accessing files in a location relative to the exe that were placed there by the user. These files can be accessed like you would in your script and don't need to, can't, be added when making the exe
JustSmith
2010-04-29 18:37:37
Ah, it appears that I made a stupid mistake, you were correct. It just gave me a warning saying it was not recommended, but ultimately it was something I had done caused all the errors. I forgot to change the directory back to where the ruby file was originally contained before OCRA began to compile the .exe Thanks for the advice :)
Ruby Novice
2010-04-29 18:56:37