Change Install Directory If Running Catalina But Not on Mojave

70 Views Asked by At

Needing to run the appblocker software in our macs in our corporate environment. Currently, the code / appblocker works on Mojave but not Catalina due to the dual hard drive issue it creates (link below).

Hopefully it's an easy one but I cant get it to work. I need a piece of python code, where if the user is on MacOS Catalina, it changes the directory and runs the appblocker, if it is on Mojave, just run the appblocker normally. I've linked all the resources I've used below in including Catalina's dual hard drive, and where I got the appblocker from (recommendation from our vendor.)

The code I use can be found under the github link below under AppBlocker.py

https://github.com/erikberglund/AppBlocker

https://www.launchd.info/

https://www.macworld.com/article/3451363/why-you-might-see-a-new-data-disk-in-catalina.html

1

There are 1 best solutions below

7
KJTHoward On

You'd have to run this on your systems to double check the version numbers, but something like this should work:

import platform, os

if int(platform.release()[:2])==19:
    #we are on Catalina
    os.chdir("NEW FOLDER")

#run rest of code....