Working around the security of Internet Explorer

Library for macros
User avatar
AlexLachance
Posts: 2179
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2361
x 2011

Working around the security of Internet Explorer

Unread post by AlexLachance »

We'd like to create something that could be ran from the ERP, that would open SolidWorks, read an excel file for a listing, and then generate whatever is required by the listing.

The issue we're facing is that our E.R.P. is built on Internet Explorer (Eww, right?) and because of that, there is a "limitation" if I could say, by the security of Internet Explorer, and because of that, our E.R.P. cannot communicate directly with SolidWorks.

If we were to be able to have our E.R.P. communicate directly with SolidWorks, we could then have our E.R.P. have it's own SolidWorks licence so that it could then create the STEPs, PDFs, and DXFs the ERP says it requires.

Any idea how we could proceed with this? Our programmer says he believes it would be well over 120 hours of programming to work around that security limitation.
User avatar
JSculley
Posts: 643
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 877

Re: Working around the security of Internet Explorer

Unread post by JSculley »

Do you access the ERP via the browser or is it a standalone app that uses an embedded Internet Explorer browser control?
User avatar
AlexLachance
Posts: 2179
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2361
x 2011

Re: Working around the security of Internet Explorer

Unread post by AlexLachance »

JSculley wrote: Tue Nov 02, 2021 8:06 am Do you access the ERP via the browser or is it a standalone app that uses an embedded Internet Explorer browser control?
We access the ERP via the browser. They have started working on converting it so that it can be fully operating on Google Chrome, but it is not the case yet.
image.png
User avatar
JSculley
Posts: 643
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 877

Re: Working around the security of Internet Explorer

Unread post by JSculley »

SOLIDWORKS makes itself available as a COM object. Internet Explorer can create and communicate with COM objects via Javascript like this:
image.png
If I load a web page with the above, I get a warning like this:
image.png
If I allow blocked content, I get another warning:
image.png
image.png (8.81 KiB) Viewed 2805 times
If I click 'Yes', SOLIDWORKS starts (in the background) and displays the message as intended:
image.png
image.png (3.61 KiB) Viewed 2805 times
I need to install IIS to see what happens when the HTML file is served from a web server as opposed to loading a local file. I'll report back.
User avatar
mattpeneguy
Posts: 1386
Joined: Tue Mar 09, 2021 11:14 am
Answers: 4
x 2489
x 1899

Re: Working around the security of Internet Explorer

Unread post by mattpeneguy »

JSculley wrote: Tue Nov 02, 2021 9:02 am SOLIDWORKS makes itself available as a COM object. Internet Explorer can create and communicate with COM objects via Javascript like this:

image.png

If I load a web page with the above, I get a warning like this:

image.png

If I allow blocked content, I get another warning:

image.png

If I click 'Yes', SOLIDWORKS starts (in the background) and displays the message as intended:

image.png

I need to install IIS to see what happens when the HTML file is served from a web server as opposed to loading a local file. I'll report back.
I'm not a programmer, but when I saw his post, I thought could this be done with Javascript? And viola, maybe it can be done.
If it's working only in IE, there's probably some out dated code in there requiring IE. We had a similar thing with our SAP implementation, but to my knowledge they figured it out and fixed it.
User avatar
JSculley
Posts: 643
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 877

Re: Working around the security of Internet Explorer

Unread post by JSculley »

I need to install IIS to see what happens when the HTML file is served from a web server as opposed to loading a local file. I'll report back.
It works over the local intranet as well. I enabled the web server on one of our test servers, put a file with the same Javascript I posted previously, and when browsing to the server I get this message:
image.png
Clicking 'Allow' leads to this message:
image.png
image.png (8.5 KiB) Viewed 2795 times
Clicking 'Yes' starts SW and shows the message:
image.png
image.png (3.64 KiB) Viewed 2795 times
I don't have an external web server to test with, but I would think that it would work the same way. The bottom line is that out of the box, IE isn't prevented from interacting with SW.
User avatar
AlexLachance
Posts: 2179
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2361
x 2011

Re: Working around the security of Internet Explorer

Unread post by AlexLachance »

Thanks Jim, it's exactly what I figured but one of my colleagues was arguing with me that it couldn't be done and since my background in programmation is very basic I was holding back on refutting him.
User avatar
jcapriotti
Posts: 1862
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 30
Location: The south
x 1202
x 1992

Re: Working around the security of Internet Explorer

Unread post by jcapriotti »

Where do you store your SolidWorks files? In the ERP or PDM or network folder?
Jason
User avatar
AlexLachance
Posts: 2179
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2361
x 2011

Re: Working around the security of Internet Explorer

Unread post by AlexLachance »

jcapriotti wrote: Tue Nov 02, 2021 2:12 pm Where do you store your SolidWorks files? In the ERP or PDM or network folder?
Network folder.

If we were to speak for the sake of speaking, would there be an alternative that both works for Internet Explorer and Google Chrome, as a COM object would allow us to use this until our ERP transitions to Chrome, which is rather soon, so I'd like to perhaps find another alternative that would work for both browsers.

For reference, as far as I'm aware, the ERP is supposed to eventually work for Chrome, Safari, Edge.
User avatar
JSculley
Posts: 643
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 877

Re: Working around the security of Internet Explorer

Unread post by JSculley »

AlexLachance wrote: Tue Nov 02, 2021 2:29 pm Network folder.

If we were to speak for the sake of speaking, would there be an alternative that both works for Internet Explorer and Google Chrome, as a COM object would allow us to use this until our ERP transitions to Chrome, which is rather soon, so I'd like to perhaps find another alternative that would work for both browsers.

For reference, as far as I'm aware, the ERP is supposed to eventually work for Chrome, Safari, Edge.
There is an add-on for Chrome called IE Tab that essentially embeds the IE rendering engine in a Chrome tab. My example works with that as well.
User avatar
jcapriotti
Posts: 1862
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 30
Location: The south
x 1202
x 1992

Re: Working around the security of Internet Explorer

Unread post by jcapriotti »

Trying to get a browser to do this sounds very fragile, one update and its broken.

I would have a server with SolidWorks on it along with a custom program that "watches" for files in a processing folder. Have your ERP automatically export a file with the drawing number and revision to the "watch" folder on that server, either via a button press or workflow trigger. The watch program "sees" that file, launches SolidWorks, generates the dxf, etc, then deletes the file. Then another program uses your ERP's API to upload the contents back into the ERP.
Jason
User avatar
AlexLachance
Posts: 2179
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2361
x 2011

Re: Working around the security of Internet Explorer

Unread post by AlexLachance »

jcapriotti wrote: Tue Nov 02, 2021 4:41 pm Trying to get a browser to do this sounds very fragile, one update and its broken.

I would have a server with SolidWorks on it along with a custom program that "watches" for files in a processing folder. Have your ERP automatically export a file with the drawing number and revision to the "watch" folder on that server, either via a button press or workflow trigger. The watch program "sees" that file, launches SolidWorks, generates the dxf, etc, then deletes the file. Then another program uses your ERP's API to upload the contents back into the ERP.
I was thinking something along that line, but my collegue was saying it was impossible, but the programmer I talk to said it would be the best venue for this.

My original idea was to have a command that is launched by our E.R.P., that sends a request to our server to launch SolidWorks and process whichever files the E.R.P. tells it to, along with which file type is required to be processed.
User avatar
jcapriotti
Posts: 1862
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 30
Location: The south
x 1202
x 1992

Re: Working around the security of Internet Explorer

Unread post by jcapriotti »

AlexLachance wrote: Tue Nov 02, 2021 5:25 pm I was thinking something along that line, but my collegue was saying it was impossible, but the programmer I talk to said it would be the best venue for this.

My original idea was to have a command that is launched by our E.R.P., that sends a request to our server to launch SolidWorks and process whichever files the E.R.P. tells it to, along with which file type is required to be processed.
That's another way to do it. I just wouldn't rely on the ERP's web GUI to do it. Handle the request server side with a service or scheduled task. Or if you have access to the DB, have a program watch for certain access. Just depends on your ERP DB structure so its hard to recommend anything.
Jason
Post Reply