DO11: Bad Script AddIn confuses DOpus

To reproduce this issue do the following steps:

  • Create a new file called Test.vbs containing only one line of text: @language vbscript is enough to confuse DOpus. Copy this file to /dopusdata\Script AddIns
  • Exit and restart DOpus

Results:

  • The folder tree (and also Buttons with e.g. Go DRIVEBUTTONS=hideempty,removable,cdrom) will suddenly show all empty drives although they're set to be hidden in Prefs.
  • The Script page in Prefs is empty. Even working scripts are not shown anymore
  • You will be unable to delete/move or even copy the file Test.vbs from /dopusdata\Script AddIns inside DOpus.
  • Even after deleting the file using windows explorer you can't exit DOpus. dopus.exe hangs in Taskmanager and doubleclick on desktop opens a second instance of it but nothing happens. dopus.exe must be killed in taskmanager.

I think DOpus should be mor resistant against bad scriptfiles in the AddIns folder. I always see the described effects when testing and playing around with scripts containing some bad code.
A button to immediately disable/enable all scripts in the Script AddIns folder would be nice in this situation. Does a command to do this already exist?

Yeah, I think AB was the first to report how mistakes in scripts can seriously destabilize Opus. While your specific example didn't cause the degree of breakage for me as you saw (folder tree, prefs, etc) it DOES cause the inability to delete files. I've also had it happen where drag and drop operations become unreliable, and drop menu actions using dopusrt do absolutely nothing.

I really hope GPSoft have some control over fencing Opus from these instabilities... but I'm not sure what they'll be able to do. I have taken to the habit of keeping a batch file handy:

del "C:\Users\<my_user_name>\AppData\Roaming\GPSoftware\Directory Opus\Script AddIns\*" /S /Q

In order to clear things up - followed by exiting and fully restarting Opus. AB also found that once things are sufficiently unstable, doing a normal exit from within Opus may not actually close the dopus.exe process... requiring you to manually kill it in task manager.

Depending on whether or not GPSoft can do something here - I think it might be helpful for others to be able to start Opus with a safety switch... maybe /noscripts or something like that, just so they can get Opus functional and clean things up easily. I'm content with my batch file, but for others it might be helpful?

...FWIW, the reason I mentioned a startup switch to disable scripts was mainly because - given the wide range of breakage when things become unstable - who knows if a 'button' such as you described would always even work as intended :wink:. +1 for your idea... but I think we'd also do well to have something that can make sure things 'start' stable right when Opus is loading.

Maybe the effects of a bad script depend on which other scripts are run before/after them as well?

That could explain why both of you see different results with the Test.vbs example in the first post, and also why Jon isn't able to see any problems when he tries the same on his machine.

If there's nothing sensitive in them, would you be able to zip up your /dopusdata/Script Addins folders + /dopusdata/ConfigFiles/ScriptConfig.oxc files?

I'll share as much of my slop code as you're willing to subject yourselves to... :sunglasses:

My other observations were only seen with my own scripting adventures. When I try the simple one-liner that Kundal described I only get the inability to delete files and the hung dopus.exe process. But to your point, on a clean restart of Opus just now, adding the test.vbs file back again, I don't see ANY of those results. Really weird.

I'm not at my home PC at the moment but I know that in my Script AddIns folder are exactly two scripts. One is the sample script Select Newest Files.js and the other one is OnAfterFolderChange_smartgetsizes (vb).osp from Steje. Both are unchanged how I downloaded them. I'll look at the config file when I'm at home tonight.
Maybe you need to have the button with Go DRIVEBUTTONS=hideempty,removable,cdrom on a toolbar to reproduce the weird issue with empty drives?

Here's the content of the file scriptconfig.oxc:<?xml version="1.0" encoding="UTF-8"?> <script_config> <script disable="no" id="3C22E171-60F5-4C20-9B7F-AE77351D122D" path="C:\Users\Admin\AppData\Roaming\GPSoftware\Directory Opus\Script AddIns\OnAfterFolderChange_smartgetsizes (vb).osp\OnAfterFolderChange_smartgetsizes.vbs"> <script_config /> </script> <script disable="no" id="491CB384-2699-4C4C-A303-8EDB15E26F6A" path="C:\Users\Admin\AppData\Roaming\GPSoftware\Directory Opus\Script AddIns\OnAfterFolderChange_smartgetsizes (vb).osp\ScriptCommand_smartgetsizes.vbs"> <script_config /> </script> <script disable="no" id="6B6FE34A-7B59-4582-AAF1-97B542BBCD50" path="C:\Users\Admin\AppData\Roaming\GPSoftware\Directory Opus\Script AddIns\Select Newest Files.js" /> <script disable="no" id="6B6FE34A-7B59-4582-AAF1-97B542BBCD50" path="C:\Users\Admin\AppData\Roaming\GPSoftware\Directory Opus\Script AddIns\Select Newest Files.js" /> <script disable="no" id="6B6FE34A-7B59-4582-AAF1-97B542BBCD50" path="C:\Users\Admin\AppData\Roaming\GPSoftware\Directory Opus\Script AddIns\Select Newest Files.js" /> <script disable="no" id="6B6FE34A-7B59-4582-AAF1-97B542BBCD50" path="C:\Users\Admin\AppData\Roaming\GPSoftware\Directory Opus\Script AddIns\Select Newest Files.js" /> <script disable="no" id="6B6FE34A-7B59-4582-AAF1-97B542BBCD50" path="C:\Users\Admin\AppData\Roaming\GPSoftware\Directory Opus\Script AddIns\Select Newest Files.js" /> <script disable="no" id="6B6FE34A-7B59-4582-AAF1-97B542BBCD50" path="C:\Users\Admin\AppData\Roaming\GPSoftware\Directory Opus\Script AddIns\Select Newest Files.js" /> <script disable="no" id="6B6FE34A-7B59-4582-AAF1-97B542BBCD50" path="C:\Users\Admin\AppData\Roaming\GPSoftware\Directory Opus\Script AddIns\Select Newest Files.js" /> <script disable="no" id="6B6FE34A-7B59-4582-AAF1-97B542BBCD50" path="C:\Users\Admin\AppData\Roaming\GPSoftware\Directory Opus\Script AddIns\Select Newest Files.js" /> </script_config>Weird is that every time I restart DOpus a new identical line for the Select Newest Files.js script is added.
I removed all scripts from the Script AddIns folder and also deleted scriptconfig.oxc and the DRIVEBUTTONS button but nothing changed. I also toggled some Prefs settings on/off that could possibly be involved without getting rid of the empty drives issue. At the end I renamed the /dopusdata folder and tested with a virgin installation with english language and saw exactly the same issues.

Ok, I think we might have a handle on this now - check the next beta.

That's great... what was the clue?

Thanks for fixing this. :thumbsup:
I can't reproduce the issue any longer with Beta 7 at least with my simple one-line example. It's ignored now as it should.

Playing with script, I create new text file in Scripts Addins folder.

I accidentaly remove extension .txt and Dopus crash (error 0xC0000005 in 'dopus_worker').

If I try to restart Dopus, it crash again and again (error 0xC0000005 in 'dopus_main') until I rename or delete file with Explorer.

And if I rename file with Opus until I restart, integrity error is display.

Thanks! That's fixed for the next beta.