Welcome Guest.   Make a donation to an author on the site October 30, 2014, 11:47:21 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2011! Download 30+ custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1] 2 Next   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: FScript2, a new way to build javascript plugins for FARR  (Read 8999 times)
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« on: January 08, 2011, 05:09:54 AM »

I've completed a first beta version of fscript2. Too bad, I'm a build too late for NANY Wink

FScript2 is a new way to write plugins for FARR in javascript, vbscript, and possibly other active scripting languages. FScript did that but it had a number of shortcomings. In particular, it was difficult to maintain and especially to update. FScript2 should solve that.

What it does

FScript2 load all fscript plugins under one master DLL. Other than that FScript2 does the same thing that FScript does, but it does them so much more neatly Wink :

- This means that once FScript2 is installed, an fscript plugin can be as light as a single fscript.js.
- This should also make plugins much lighter in memory since there will be only one DLL that control all plugins.
- This also means that FScript2 will be updatable by DCUpdate so there won't be a need for plugins scripter to repackage their plugins with my latest DLL, which has caused a lot of issues as I fixed bugs progressively.

How to use it

FScript2 is compatible with FScript plugins. To allow an FScript2 plugin you must delete the fscript.dll from that plugin.

Copy FScript2 inside the plugin folder. FScript2 will try to detect plugins one folder under its installation folder : If you install it into 'plugins/Fscript2', it will scan every folder under the 'plugins' folder seeking for fscript.js files.

To enable thoses plugins to use FScript2, fscript.dll must be deleted inside each plugin. Folder that contains an fscript.dll file will be ignored.  This is a security and should help with the transition : If some plugin doesn't work with FScript2, restore its original dll, and everything will work again.

Launch FARR and it should load plugins as if they were natives FARR plugins.

Extra notes

FScript2 create proxy dll for each FScript2 plugins. They are very small 10k DLL, that forward all call to the DLL. Theses DLL are created inside the proxy folder inside the FScript2 folder. This means that, that folder must be writable, so that FScript2 enable plugins. If you have some warning telling you that some plugins can be copied, you might have to fix that.

Some FScript plugins doesn't seems to work, but I'm unsure if this came from the plugin or from Fscript2 as they do not seems to work correctly with Fscript either. I'll be very happy to have some report of what works and what doesn't. Retesting all fscript plugins with fscript2 is beyond what I can do, so testers are welcome.

Try it
Get FScript2 here.
« Last Edit: January 08, 2011, 06:17:05 AM by ecaradec » Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
cranioscopical
Friend of the Site
Supporting Member
**
Posts: 4,182



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: January 08, 2011, 08:33:12 AM »

Works well for me, thanks for the effort!

(a few DC credits coming your way)
Logged

Chris
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: January 08, 2011, 08:41:26 AM »

Thanks, your credits are very appreciated. It has been an epic fight to shape all that code into that proxy dll stuff Wink
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
cranioscopical
Friend of the Site
Supporting Member
**
Posts: 4,182



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: January 08, 2011, 08:45:26 AM »

PrinterList plugin doesn't work.
Subsequent to that search for plugins in FARR shows empty (unloaded), as it should but then anything I try to do with FARR throws an access violation error and I have to kill the process to escape.

TimeZone works
ProcessInfo works (I think). It loads but I can't get at it due to the issue mentioned above. Once Printerlist fails to load things go bad.
Logged

Chris
cranioscopical
Friend of the Site
Supporting Member
**
Posts: 4,182



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: January 08, 2011, 08:51:52 AM »

Yep, I spoke too soon about it working.

With Timezone and ProcessInfo loaded, and PrinterList removed, if I try to look at the plugins through the FARR interface I get an error and the only way I can get out is to kill the FARR process.

Let me go back to the old way and make sure that wasn't happening before (I don't spend a lot of time looking at plugins in FARR Grin)

I just reverted to the old way. Problem gone. It's fscript2, I hate to tell you.

On my system, once fscript2 is loaded I can't exit FARR normally, even without trying to look at plugins.

I'm on XP SP3.
« Last Edit: January 08, 2011, 08:59:03 AM by cranioscopical » Logged

Chris
cranioscopical
Friend of the Site
Supporting Member
**
Posts: 4,182



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: January 08, 2011, 09:05:48 AM »

Here's my plan… I'll change my name to Jonah and move back to Whales.

What else can I do to help?
Logged

Chris
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: January 08, 2011, 09:50:19 AM »

I tried to reproduced it on XP SP3 as well, but couldn't, but it might be some subtle combination of installed plugins ? What plugins are you running ?





Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
mouser
First Author
Administrator
*****
Posts: 33,610



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: January 08, 2011, 11:14:42 AM »

whoa this is a surprise!!! can't wait to try it.

it sounds like you are inventing a whole new thing -- very interesting and challengine.

i only hope you do not lose your sanity in the process!   Kiss
« Last Edit: January 08, 2011, 11:16:24 AM by mouser » Logged
cranioscopical
Friend of the Site
Supporting Member
**
Posts: 4,182



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #8 on: January 08, 2011, 11:23:25 AM »

I tried to reproduced it on XP SP3 as well, but couldn't, but it might be some subtle combination of installed plugins ? What plugins are you running ?

These

Logged

Chris
mouser
First Author
Administrator
*****
Posts: 33,610



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #9 on: January 08, 2011, 11:27:23 AM »

so i have a question, if we assume on some machines it wont be possible for fscript2 to create the proxy dll, would one solution simply be to copy in the proxy dll manually?

and would this be a reasonable approach for new fscript2 based plugins? to simply include the proxy dll with their plugin?
Logged
mouser
First Author
Administrator
*****
Posts: 33,610



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: January 08, 2011, 11:40:15 AM »

separate question is..

it sounds like youve created something extremely clever -- that lets existing plugins still THINK they are loading the fscript.dll but really are loading the new one through a proxy.

but here is my question about a possibly simpler solution:

since dll's are actually made to be shared if the same dll is in the search path, might a simple solution be for me to just have the core FARR load the fscript.dll from it's own program file directory (included with future farr builds) and add that directory to the dll search path?

does that solve the main problem of having ONE centralized fscript.dll or fscript2.dll that will be updated when needed, and preferably included with FARR install?
Logged
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #11 on: January 08, 2011, 11:54:26 AM »

Yes creating DLL by hand is possible and will work. Actually you only need write access when you add a plugin, remove a plugin or if fscript2 changed and it need to write a new version of the proxy. If you're not adding, removing or updating plugin you should be fine.

However I'd rather keep the proxy with the master DLL otherwise we could end up with various versions. There is very few code in them, but not none at all and it would be problematic if you needed to add new FARR API as I'd need to implement them in order to forward them and then all proxy would need to be modified. It is also important that they are located in a subfolder of fscript2 as they must be loaded AFTER fscript2 to be able to initialize correctly.

One way to solve it would be that FARR support some kind of proxy for DLL like a file that would point to the DLL to load instead or even better an API for FScript2 to allow it to load plugins. The alias wouldn't solve the write issue, but the API would. I wanted a version that works for every versions of FARR first so I went this path first.

We could wait a little to see if I can fix them that way and see the issues before moving to something else.

I'm already half crazy anyway Wink

« Last Edit: January 09, 2011, 12:57:38 PM by ecaradec » Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #12 on: January 08, 2011, 11:56:25 AM »

separate question is..

it sounds like youve created something extremely clever -- that lets existing plugins still THINK they are loading the fscript.dll but really are loading the new one through a proxy.

but here is my question about a possibly simpler solution:

since dll's are actually made to be shared if the same dll is in the search path, might a simple solution be for me to just have the core FARR load the fscript.dll from it's own program file directory (included with future farr builds) and add that directory to the dll search path?

does that solve the main problem of having ONE centralized fscript.dll or fscript2.dll that will be updated when needed, and preferably included with FARR install?

That's sound nice but I didn't exactly get you. Can you rephrase it ?
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
mouser
First Author
Administrator
*****
Posts: 33,610



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #13 on: January 08, 2011, 12:15:44 PM »

Well what i was saying was simply this:

Let's first start at the begining:
  • Fscript (and FSubScript) is one of the most brilliant things ever invented.

But it has one problem:
  • As currently used, each plugin loads its own different copy of fscript.dll
  • This causes problems because when fscript.dll gets updated, some plugins have older fscript.dll versions and they may have bugs.

The basic idea of the solution:
  • Have all fscript-based plugins share the same dll.

And the specifics:
  • Can't we just put a single fscript.dll in the FARR main directory and include it with all farr releases, and have farr tell windows that when a farr plugin loads, to use that version of fscript.dll for the plugin?  Wouldn't that be simpler? Or is there a problem with that that i'm not understanding.
Logged
cranioscopical
Friend of the Site
Supporting Member
**
Posts: 4,182



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #14 on: January 08, 2011, 01:01:11 PM »

I've been trying to drop plug-in items from FARR one at a time.
I had fscript2 working with just 1 plug-in (TimeZone - thanks Perry) but then FARR threw an error as soon as I tried to look at the plug-ins list.
Logged

Chris
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #15 on: January 08, 2011, 01:43:14 PM »

mouser you're a master at praising then critisizing...

If this could work, it would be wonderful.

I'm not sure how it could work within the current FARR plugin system although, loading several times the same DLL would not create different plugins in memory. Each API call would then need to be modified to add some context (the hostptr probably) to know which plugin it refers too. (An easier solution could be to add method to query the actual hostptr, that would at least avoid to duplicate the whole plugin API, but you'll have to set it carefully before doing any call to plugins )

At that point the FARR plugins would be able to embed multiple plugins inside one and fscript2 could be located anywhere...

May be I miss something ?
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #16 on: January 08, 2011, 01:45:26 PM »

I've been trying to drop plug-in items from FARR one at a time.
I had fscript2 working with just 1 plug-in (TimeZone - thanks Perry) but then FARR threw an error as soon as I tried to look at the plug-ins list.

Thanks, I've found that I've outdated plugins, may be this is why I can't reproduce this issue. I'll try to find the exact same version. Which version of FARR do you have btw, if I have the exact same setup I should get it dammit Wink ?
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
cranioscopical
Friend of the Site
Supporting Member
**
Posts: 4,182



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #17 on: January 08, 2011, 02:34:56 PM »

Thanks, I've found that I've outdated plugins, may be this is why I can't reproduce this issue. I'll try to find the exact same version. Which version of FARR do you have btw, if I have the exact same setup I should get it dammit Wink ?

v2.93.01

FWIW, whatever combination of plug-ins that I've tried here, causing an ugly with fscript2/FARR, has been corrected by reverting to the old system.
I haven't tried with no plug-ins at all — should I do so?

Mouser's praise for you is first probably because it's so well deserved  Thmbsup
Logged

Chris
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #18 on: January 09, 2011, 01:05:24 PM »

I tried to reproduce your problem cranioscopical... I have setup the exact same combination of plugins but I don't get crashes. The only thing that seems different is that timezone keeps showing me the following message :

Quote
---------------------------
TimeZone Data Download
---------------------------
No records extracted. The datafile has not been written. The days not parsed:
Please see DayName_Log.txt and adjust the INI file.

Other than that it seems to work. I think we need someone else to test to know if there is something special on my PC or yours.
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
mouser
First Author
Administrator
*****
Posts: 33,610



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #19 on: January 09, 2011, 01:45:23 PM »

Quote
I'm not sure how it could work within the current FARR plugin system although, loading several times the same DLL would not create different plugins in memory. Each API call would then need to be modified to add some context (the hostptr probably) to know which plugin it refers too.

ah i see, i knew it was too simple an idea.

ok i will start helping to test fscript2.
Logged
cranioscopical
Friend of the Site
Supporting Member
**
Posts: 4,182



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #20 on: January 09, 2011, 01:56:16 PM »

I think we need someone else to test to know if there is something special on my PC or yours.

Sorry you've had a hassle. I agree with you, let's wait to see how others get on.
Thank you for working so hard on this!

(I had the same message from TimeZone and, because I'm busy at the moment, I simply dropped back a couple of versions pro tem.)
 
Logged

Chris
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #21 on: January 13, 2011, 01:17:19 PM »

Did someone tried ? It's still a bit experimental but it would really help if I had some extra reports. It would be a good thing for FARR as well as it would be an exit for FScript past issues. At least if you have some issue with fscript, it could be good to check if fscript2 fix them.
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
mouser
First Author
Administrator
*****
Posts: 33,610



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #22 on: January 13, 2011, 01:22:28 PM »

just been buried in other stuff but i plan to have a long session with it this weekend and i will report what i find.
Logged
phitsc
Honorary Member
**
Posts: 1,010



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #23 on: January 17, 2011, 01:59:49 PM »

Tried it with GooglePlus, the only fscript-based plugin I have currently installed.

I first get a message box telling me: "Impossible to create in Plugins/FScript2/proxy"
and after that another one with: "Impossible to copy some GooglePlus.fscript.dll in Plugins/FScript2/proxy"

They are being shown alternately, endlessly, i.e. I need to kill FARR to stop it. After restarting FARR, they were being shown once each and then FARR seemed to run ok. GooglePlus obviously didn't work though.

I understand that you know about this issue. But I think you and mouser should try to find a way to solve this problem so that FScript2 works without the user having to make any changes on filesystem security settings.

I'm running Windows 7 with the default security settings.
Logged

ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #24 on: January 20, 2011, 06:19:02 AM »

Thanks for trying it.  My little hack seems to show it limits. I've been talking with mouser about the possibility of an api to solve the plugin cohosting issue.
I could add an ignore button to avoid the infinite message loop but you'd end up with a non functionning plugin anyway.
Having played with it, I really think it would be great. It feels very good to create a plugin with a single js and see farr recognize it as a native plugin.
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
Pages: [1] 2 Next   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.044s | Server load: 0.07 ]