Skip to content

Commit 1d6796b

Browse files
committed
fix jdk install and put in instrument apps
1 parent fe3da80 commit 1d6796b

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

installation_and_upgrade/ibex_install_utils/install_tasks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ def run_update_icp(self) -> None:
199199
self._server_tasks.update_icp(self.icp_in_labview_modules())
200200

201201
def save_motor_params(self) -> None:
202-
self._server_tasks.save_motor_parameters_to_file()
202+
self._system_tasks.check_java_installation()
203+
204+
# self._server_tasks.save_motor_parameters_to_file()
203205

204206
def run_instrument_deploy(self) -> None:
205207
"""Deploy a full IBEX upgrade on an existing instrument."""

installation_and_upgrade/ibex_install_utils/tasks/system_tasks.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,22 @@ def check_java_installation(self) -> None:
8888
"""
8989
Checks Java installation
9090
"""
91-
installer, _ = Java().find_latest()
91+
installer, version = Java().find_latest()
9292

9393
if os.path.exists(installer):
9494
print(f"running installer at {installer}")
95-
subprocess.call(
96-
f"msiexec /i {installer} "
97-
"ADDLOCAL=FeatureMain,FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome "
98-
'INSTALLDIR="c:\\Program Files\\Eclipse Adoptium\\" /quiet'
95+
96+
admin_commands = AdminCommandBuilder()
97+
admin_commands.add_command(
98+
f'msiexec /i "{installer}"', "ADDLOCAL=FeatureMain,FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome "
99+
f'INSTALLDIR="c:\\Instrument\\apps\\JDK\\{version}" /quiet', expected_return_val=None
99100
)
101+
log_file = admin_commands.run_all()
102+
103+
with open(log_file, "r") as logfile:
104+
for line in logfile.readlines():
105+
print("Java update output: {}".format(line.rstrip()))
106+
100107
self.prompt.prompt_and_raise_if_not_yes(
101108
"Make sure java installed correctly.\r\n"
102109
"After following the installer, ensure you close and then re-open"

0 commit comments

Comments
 (0)