I'm excited that I found a workaround for a nasty problem related to Windows Security when using wwDotnetBridge. Windows marks files downloaded from the Internet either directly or inside of a Zip archive as blocked and wwDotnetBridge is affected by that often resulting in errors when first trying to use wwDotnetBridge.
After reading about some other security related issues in Windows, I by chance ran into some information on how Zone Identifiers work and with that information was able to bake unblocking directly into the wwDotnetBridge
FoxPro code.
You find out more in this blog post:
These changes will be in the next updates for Web Connection, West Wind Client Tools and the open source version of wwDotnetBridge shortly.
Enjoy,
+++ Rick ---
Congratulations, Rick.
Yep, when I first tried to use wwDotnetBridge I got the blocking error and had to post here on the forum to get the fix.
This sure will make everyone's life easier!
Yup... I'm pretty excited about this because this has been one of the biggest support issues - I also suspect this makes quite a few people just walk away because they likely never get to the documentation part 😃
Worse - I just realized the wwClientTools were loading wwDotnetBridge by default and if it failed it wouldn't run at all. Added some additional check logic so that it will work now (if for some reason unblocking isn't the problem) even if wwDotnetBridge can't run.
All those little bloody details...
+++ Rick ---
Hi. I get this error. I tried putting the code you suggest in several places (in the method in my form, in the load of my form, at the top of the wwdotnetbridge.prg), and nothing changes.
Can you clarify for me where the lines of code that produce the Wahlah! are to be put until your new release comes out?
Thanks.
It has to be done before wwdotnetbridge gets loaded for the first time...
wwDotnetBridge has it inside of it's Load()
method (here):
FUNCTION Load(llNoUnblockOnError)
LOCAL lcError, lnSize, lnDispHandle, lcPath, lcCmd
IF VARTYPE(this.oDotNetBridge) != "O"
this.SetClrVersion(this.cClrVersion)
IF this.lUseCom
this.oDotNetBridge = CREATEOBJECT("Westwind.wwDotNetBridge")
ELSE
*** Load by filename - assumes the wwDotNetBridge.dll is in the Fox path
DECLARE Integer ClrCreateInstanceFrom IN WWC_CLR_HOSTDLL string, string, string@, integer@
*** Remove the Zone Identifier to 'Unblock'
DECLARE INTEGER DeleteFile IN WIN32API STRING
DeleteFile(FULLPATH("wwDotNetBridge.dll") + ":Zone.Identifier")
#IF IS_WESTWIND
DeleteFile(FULLPATH("Newtosoft.Json.dll") + ":Zone.Identifier")
DeleteFile(FULLPATH("Markdig.dll") + ":Zone.Identifier")
#ENDIF
lcError = SPACE(2048)
lnSize = 0
lnDispHandle = ClrCreateInstanceFrom(FULLPATH("wwDotNetBridge.dll"),;
"Westwind.WebConnection.wwDotNetBridge",@lcError,@lnSize)
...
+++ Rick ---