INTO-CPS-Association / into-cps-application

The front-end of the INTO-CPS tool chain
https://into-cps-association.github.io/simulation/app.html
Other
17 stars 8 forks source link

Issues loading icons when application is launched from a "wierd" directory #74

Open clegaard opened 4 years ago

clegaard commented 4 years ago

At the exercise session a student had issues launching the application from the path.

Launching the application from:

C:\Users\Omer\Documents\AARHUS STUDY MATERIALS\2nd semester Spring 2020\Systems Engineering\Lectures\Week 5 INTO CPS\INTO CPS APP\into-cps-app-3.4.9-win32-x64\into-cps-app-3.4.9-win32-x64>

Gives the following error missing icons 1 missing icon lock

Failed to load resource: net::ERR_FILE_NOT_FOUND
Failed to load resource: net::ERR_FILE_NOT_FOUND
EXCEPTION: Failed to load angular2-app/coe/inputs/fmu-max-step-size.component.html
EXCEPTION: Failed to load angular2-app/coe/inputs/fmu-max-step-size.component.html
Failed to load resource: net::ERR_FILE_NOT_FOUND
Failed to load resource: net::ERR_FILE_NOT_FOUND
Failed to load resource: net::ERR_FILE_NOT_FOUND
Uncaught TypeError: Cannot read property 'openCOE' of undefined

When running from desktop it works: C:\Users\Omer\Desktop

clagms commented 4 years ago

I was not able to reproduce this. I tried:

  1. Running the into-cps app from a path that has spaces in it.
  2. Opening a project that sits in a path that has spaces in it.

@clegaard any ideas on what causes this bug?

clegaard commented 4 years ago

No, the only thing i can say with certainty is that when i moved the project to his desktop the problem disappeared.

If its not the spaces, it may be:

  1. dashes
  2. insanely long path
clagms commented 4 years ago

I was able to reproduce this. I'm pretty sure it's the size, as the dashes were already in my initial test.

Scenario:

  1. Put into-cps-app in an insanely long path. Ex: C:\Users\au602135\Downloads\long directory\with very weird-path\AARHUS STUDY MATERIALS\2nd semester Spring 2020\Systems Engineering\Lectures\Week 5 INTO CPS\INTO CPS APP
  2. Launch into-cps app.
  3. Observe how the app tries to load stuff whose path exceeds the 260 characters (that's the limit I think). For example: C:/Users/au602135/Downloads/long%20directory/with%20very%20weird-path/AARHUS%20STUDY%20MATERIALS/2nd%20semester%20Spring%202020/Systems%20Engineering/Lectures/Week%205%20INTO%20CPS/INTO%20CPS%20APP/into-cps%20app-3.4.9-win32-x64/resources/app/dist/angular2-app/mm/mm-configuration.component.html

How do we deal with this? Can we have a check for names being loaded, and give a more graceful message? Right now, "file not found" is not very helpful. The problem is that some of the resources being loaded are scripts... so there's not much we can do there. Maybe this is an issue of the underlying framework?

We can update the documentation recommending that into-cps-app is not installed in a long directory.

clegaard commented 4 years ago

Good job. A quick google search reveals that the maximum path length is around ~ 250 on Windows.

https://social.technet.microsoft.com/Forums/windows/en-US/43945b2c-f123-46d7-9ba9-dd6abc967dd4/maximum-path-length-limitation-on-windows-is-255-or-247?forum=w7itprogeneral

Given that the program is distributed in a portable manner, there is no way for an installer to give a warning about path length. A think a warning on startup would be reasonable.