Skip to content

Commit 38c5fa8

Browse files
committed
update version switcher example to use core_version_info, resolves #6204
1 parent 61888cf commit 38c5fa8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

python/examples/version_switcher.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import sys
2323

2424
from binaryninja.update import UpdateChannel, are_auto_updates_enabled, set_auto_updates_enabled, is_update_installation_pending, install_pending_update
25-
from binaryninja import core_version
25+
from binaryninja import core_version_info, get_install_directory, user_directory
2626
import datetime
2727
from six.moves import input
2828

@@ -72,11 +72,11 @@ def select(version):
7272
if are_auto_updates_enabled():
7373
print("Disabling automatic updates.")
7474
set_auto_updates_enabled(False)
75-
if (version.version == core_version()):
75+
if (version.version == core_version_info()):
7676
print("Already running %s" % version.version)
7777
else:
7878
print("version.version %s" % version.version)
79-
print("core_version %s" % core_version())
79+
print("core_version %s" % core_version_info())
8080
print("Downloading...")
8181
print(version.update())
8282
print("Installing...")
@@ -120,8 +120,10 @@ def main():
120120
load_channel(chandefault)
121121
while not done:
122122
print("\n\tBinary Ninja Version Switcher")
123+
print("\t\tCurrent Install:\t%s" % get_install_directory())
124+
print("\t\tCurrent User Path:\t%s" % user_directory())
123125
print("\t\tCurrent Channel:\t%s" % channel.name)
124-
print("\t\tCurrent Version:\t%s" % core_version())
126+
print("\t\tCurrent Version:\t%s" % core_version_info())
125127
print("\t\tAuto-Updates On:\t%s\n" % are_auto_updates_enabled())
126128
for index, version in enumerate(versions):
127129
date = datetime.datetime.fromtimestamp(version.time).strftime('%c')

0 commit comments

Comments
 (0)