Silent updater
Quote from mortensm on 7. November 2020, 1:07Is there a way to perform a silent update ? Like a python script or something that when run, prism just simply updates to the newest version without any kind of user input or dialog that then our administrator can take and run on all of the school's computers at once? We have auto update turned off as we want every computer to be on the same version for compatibility purposes.
Thanks!
Is there a way to perform a silent update ? Like a python script or something that when run, prism just simply updates to the newest version without any kind of user input or dialog that then our administrator can take and run on all of the school's computers at once? We have auto update turned off as we want every computer to be on the same version for compatibility purposes.
Thanks!
Quote from RichardF on 9. November 2020, 8:30In v1.3.0.49 and newer you can use now this python script to update Prism without user input:
import sys sys.path.append("C:/Prism/Scripts") import PrismCore pcore = PrismCore.create(["noUI"]) pcore.updater.updatePrism(source="github")You would need to execute this on every computer in your school.
Another option would be to store Prism on a network location and all workstations are loading Prism from this location. Then you only need to update one Prism installation and all workstations would have the update immediately.
If network speed is an issue you could also update the Prism folder on the network drive and then copy the folder to each workstation. Either through python or by one of the countless free foldersync tools.
In v1.3.0.49 and newer you can use now this python script to update Prism without user input:
import sys sys.path.append("C:/Prism/Scripts") import PrismCore pcore = PrismCore.create(["noUI"]) pcore.updater.updatePrism(source="github")
You would need to execute this on every computer in your school.
Another option would be to store Prism on a network location and all workstations are loading Prism from this location. Then you only need to update one Prism installation and all workstations would have the update immediately.
If network speed is an issue you could also update the Prism folder on the network drive and then copy the folder to each workstation. Either through python or by one of the countless free foldersync tools.
Quote from mortensm on 26. November 2020, 2:01Hi, sorry for the late reply. Thanks for implementing a silent updater, but I get errors when I run the code that says it can't import PySide. Any clues as to why it can't be loaded? Everything runs fine when updating through the GUI.
When I run the code in Python 2.7 I get this:
Traceback (most recent call last):
File "c:/Prism/prismsilentinstaller.py", line 3, in <module>
import PrismCore
File "C:/Prism/Scripts\PrismCore.py", line 110, in <module>
from PySide.QtCore import *
ImportError: No module named PySide.QtCoreWhen I run the code in Python 3.8, I get this:
Traceback (most recent call last):
File "C:/Prism/Scripts\PrismCore.py", line 93, in <module>
from PySide2.QtCore import *
ModuleNotFoundError: No module named 'PySide2'During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Prism/Scripts\PrismCore.py", line 101, in <module>
from PySide.QtCore import *
ModuleNotFoundError: No module named 'PySide.QtCore'During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Prism/Scripts\PrismCore.py", line 106, in <module>
from PySide2.QtCore import *
File "C:\Prism\PythonLibs\Python37\PySide\PySide2\__init__.py", line 51, in <module>
_setupQtDirectories()
File "C:\Prism\PythonLibs\Python37\PySide\PySide2\__init__.py", line 21, in _setupQtDirectories
import shiboken2
File "C:\Prism\PythonLibs\Python37\PySide\shiboken2\__init__.py", line 27, in <module>
from .shiboken2 import *
ModuleNotFoundError: No module named 'shiboken2.shiboken2'During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Prism\prismsilentinstaller.py", line 3, in <module>
import PrismCore
File "C:/Prism/Scripts\PrismCore.py", line 110, in <module>
from PySide.QtCore import *
ModuleNotFoundError: No module named 'PySide.QtCore'Thanks for everything!
PS: is there a way to format the code when making a post like you do? I don't see any code format option anywhere.
Hi, sorry for the late reply. Thanks for implementing a silent updater, but I get errors when I run the code that says it can't import PySide. Any clues as to why it can't be loaded? Everything runs fine when updating through the GUI.
When I run the code in Python 2.7 I get this:
Traceback (most recent call last):
File "c:/Prism/prismsilentinstaller.py", line 3, in <module>
import PrismCore
File "C:/Prism/Scripts\PrismCore.py", line 110, in <module>
from PySide.QtCore import *
ImportError: No module named PySide.QtCore
When I run the code in Python 3.8, I get this:
Traceback (most recent call last):
File "C:/Prism/Scripts\PrismCore.py", line 93, in <module>
from PySide2.QtCore import *
ModuleNotFoundError: No module named 'PySide2'During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Prism/Scripts\PrismCore.py", line 101, in <module>
from PySide.QtCore import *
ModuleNotFoundError: No module named 'PySide.QtCore'During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Prism/Scripts\PrismCore.py", line 106, in <module>
from PySide2.QtCore import *
File "C:\Prism\PythonLibs\Python37\PySide\PySide2\__init__.py", line 51, in <module>
_setupQtDirectories()
File "C:\Prism\PythonLibs\Python37\PySide\PySide2\__init__.py", line 21, in _setupQtDirectories
import shiboken2
File "C:\Prism\PythonLibs\Python37\PySide\shiboken2\__init__.py", line 27, in <module>
from .shiboken2 import *
ModuleNotFoundError: No module named 'shiboken2.shiboken2'During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Prism\prismsilentinstaller.py", line 3, in <module>
import PrismCore
File "C:/Prism/Scripts\PrismCore.py", line 110, in <module>
from PySide.QtCore import *
ModuleNotFoundError: No module named 'PySide.QtCore'
Thanks for everything!
PS: is there a way to format the code when making a post like you do? I don't see any code format option anywhere.
Quote from RichardF on 26. November 2020, 2:53That error is because you don't have PySide installed which is not part of the Python installation.
Prism comes with a PySide module, but it's for Python 3.7 only.
You can add this line after the first line to the script:
sys.path.append("C:/Prism/PythonLibs/Python37/PySide")
And then you can run the script with this python:
C:\Prism\Python37\python.exe
Alternatively you can also search on google how to download and install PySide/PySide2 for your external python installations.
The syntax highlighting seems to be enabled only for some users. I still haven't found a way to make it visible for all users.
That error is because you don't have PySide installed which is not part of the Python installation.
Prism comes with a PySide module, but it's for Python 3.7 only.
You can add this line after the first line to the script:
sys.path.append("C:/Prism/PythonLibs/Python37/PySide")
And then you can run the script with this python:
C:\Prism\Python37\python.exe
Alternatively you can also search on google how to download and install PySide/PySide2 for your external python installations.
The syntax highlighting seems to be enabled only for some users. I still haven't found a way to make it visible for all users.