-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mod: Add post installation fix of OpenCV pathes instead of hot fixing #1628
Conversation
Hey @coumbsek 👋 thanks for the PR! I think this is a good approach and yes I agree that ideally we should not write to the installation folder. There's a few other parts of the codebase that currently write to the installation folder (the AI model download code in particular), perhaps a few other places, so I think this should be included as part of a larger work to make the program work without writes to the install folder. This means it might take a bit before I can merge this in master. Help to fix the other parts the codebase that currently write to the install folder would speed this up of course. |
Ok, I just looked at the ai model download. There is two cases of writing in the installation folder :
The case of ai model currently falls inside the second case because it is an "optional" feature and has such is only downloaded the first time we need it at runtime.
A mitigation would be to use the user folder (like AppData under windows) to download the models, here we have right wrights and we would not need to download it for each dataset but only for each user calling ODM. What to you think ? |
I think this would be the way to go. |
Havinga look at what we can do with Innosetup I think an even better case would be to use an ODM folder inside ProgramData and make it writable for all users during setup. I think this is exactly what ProgramData is about. Regarding the others platforms (linux, mac) I have no idea of what is the equivalent and how we should manage it. |
Linux/Mac behavior can probably be left as-is for the time being. |
Ok, so it should be fixed for ai models. Do you see some other places where I should look at to fix it the same way ? |
I think there's just the |
I just realise it was missing a variable declaration in the winpostinstall.bat so the cv2 package was not initialising properly.
|
If ODM is install in a folder where the running user does not have writing permession it fails.
This is due to the hot fixing of the pyvenv.cfg and cv2 extension configs at each run.
Only read and execution permissions should be sufficient to run ODM, I think this is best pratice, at least under Windows not to write file in the installation folder during runs.
In order to achieve this I propose to transform the hot fixing to a cold fixing done once at install.
For this I introduce a bat file that is run by the setup after completing the installation process. This bat does exactly what the hot fixing was doing but once and for all.
Hope it will pass the tests and be accepted.