Author |
Topic  |
|
dlw21
USA
18 Posts |
Posted - 02/04/2003 : 3:58:24 PM
|
Hi Folks,
I was wondering if it would be possible run an .OGS file from either the commandline directly, or by dragging and dropping the OGS file onto the Origin icon...
The task I am trying to accomplish is this: I have some tools with buttons and things that I'd like to be able to install with a simple call to the "installer" script, either like:
origin70.exe Package.ogs
or by dragging and dropping onto the executable. This would provide a brain-dead way of sharing my tools with my collaborators.
(I use OriginPro 7 (network version).)
This may look familiar, since one possible way of doing this would be via the OPKSetup.ogs mechanism automatically run when a .OPK file is unpacked. Unfortunately, I am interested in something more generic and the OPK method doesn't *quite* work for me. (related question: do OPK files support directory structures within them?)
I've not found anything like this in the documentation, and just trying it out didn't work the way I'd hoped.
Any suggestions?
If this capability doesn't currently exist, might I suggest it be considered for future releases?
Thanks, Dave
|
|
Mike Buess
USA
3037 Posts |
Posted - 02/04/2003 : 6:41:01 PM
|
Hi Dave,
quote: I was wondering if it would be possible run an .OGS file from either the commandline directly, or by dragging and dropping the OGS file onto the Origin icon...
If you drop an OGS file onto Origin it should just open in CodeBuilder. To find out how to run a script from the command line read the "Running scripts at startup" topic at labtalk.nmrtools.com.
Having said that, OPK is really the best way to go and the answer to your related question is yes. To create a directory structure in the Origin program folder just make a file list using relative paths...
OPKname.opk // The name of your OPK file has to appear first OPKSetup.ogs Package.ogs myfolder\1stfile myfolder\2ndfile myfolder\subfolder\3rdfile etc.
Save the list as a simple text file, say OPKname.txt. (If you have a complicated directory structure with lots of files you can use the free OFileMan add-on to make the list or write your own OriginC function as I've done.) Then create the OPK file...
dll -a Opack Opack; opack.saveFolderInfo=1; // save your directory structure opack.getFileNames(%YOPKname.txt); opack.pack(); dll -r opack;
OPKSetup.ogs can be as simple as this...
#OPKSetup.ogs [OnBeforeSetup] // This runs before the files are unpacked opack.useFolderInfo=1; // unpack according to your directory structure
[OnAfterSetup] // This runs after the files are unpacked run.file(Package.ogs); -- or more likely -- run.section(Package,SectionName);
If for some reason you don't want to install your files via OPK you can still launch the installer script with an OPK file containing only an OPKSetup that looks like this...
[OnAfterSetup] run.section(Package,SectionName);
I've been distributing Origin add-ons since Origin 5.0 and OPK is definitely the best installation mechanism I've tried so far.
Mike Buess Origin WebRing Member |
 |
|
|
Topic  |
|
|
|