add platform check in upgrade.py