From 5cddc84949271c935879c6c136aef6575b5cf189 Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Tue, 12 Nov 2024 19:08:01 +0000 Subject: [PATCH 1/3] add standalone isisicp installer --- .../ibex_install_utils/install_tasks.py | 7 ++++++ installation_and_upgrade/update_icp.bat | 22 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 installation_and_upgrade/update_icp.bat diff --git a/installation_and_upgrade/ibex_install_utils/install_tasks.py b/installation_and_upgrade/ibex_install_utils/install_tasks.py index a83acf3..b0cdd6d 100644 --- a/installation_and_upgrade/ibex_install_utils/install_tasks.py +++ b/installation_and_upgrade/ibex_install_utils/install_tasks.py @@ -200,6 +200,9 @@ def run_instrument_install(self) -> None: self._python_tasks.update_script_definitions() self._server_tasks.setup_log_rotation() + def run_update_icp(self) -> None: + self._server_tasks.update_icp(self.icp_in_labview_modules()) + def save_motor_params(self) -> None: self._server_tasks.save_motor_parameters_to_file() @@ -406,6 +409,10 @@ def run_vhd_post_install(self) -> None: UpgradeInstrument.run_truncate_database, "backup and truncate the sql database on the instrument", ), + "update_icp": ( + UpgradeInstrument.run_update_icp, + "update isisicp on the instrument", + ), "force_upgrade_mysql": ( UpgradeInstrument.run_force_upgrade_mysql, "upgrade mysql version to latest and recreate tables", diff --git a/installation_and_upgrade/update_icp.bat b/installation_and_upgrade/update_icp.bat new file mode 100644 index 0000000..bcaa870 --- /dev/null +++ b/installation_and_upgrade/update_icp.bat @@ -0,0 +1,22 @@ +setlocal EnableDelayedExpansion +set "SOURCE=\\isis.cclrc.ac.uk\inst$\Kits$\CompGroup\ICP\Releases" +call "%~dp0define_latest_genie_python.bat" +IF %errorlevel% neq 0 goto ERROR + +git --version + +IF %errorlevel% neq 0 ( + echo No installation of Git found on machine. Please download Git from https://git-scm.com/downloads before proceeding. + goto ERROR +) + +call "%LATEST_PYTHON%" "%~dp0IBEX_upgrade.py" --release_dir "%SOURCE%" --release_suffix "%SUFFIX%" --confirm_step update_icp +IF %errorlevel% neq 0 goto ERROR +call "%~dp0remove_genie_python.bat" %LATEST_PYTHON_DIR% + +exit /b 0 + +:ERROR +set errcode = %ERRORLEVEL% +call "%~dp0remove_genie_python.bat" %LATEST_PYTHON_DIR% +EXIT /b !errcode! From 21925cd2c41a6f77d6131cfe75867782fca5d5d8 Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Tue, 12 Nov 2024 19:40:51 +0000 Subject: [PATCH 2/3] bat -> cmd --- .../ibex_install_utils/tasks/server_tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation_and_upgrade/ibex_install_utils/tasks/server_tasks.py b/installation_and_upgrade/ibex_install_utils/tasks/server_tasks.py index 35f0b7c..a774cde 100644 --- a/installation_and_upgrade/ibex_install_utils/tasks/server_tasks.py +++ b/installation_and_upgrade/ibex_install_utils/tasks/server_tasks.py @@ -605,7 +605,7 @@ def update_icp(self, icp_in_labview_modules, register_icp=True): icp_top = os.path.join(EPICS_PATH, "ICP_Binaries", "isisdae") register_icp_commands.add_command( - f'cd /d "{icp_top}" && register_programs.bat', + f'cd /d "{icp_top}" && register_programs.cmd', "", expected_return_val=None, ) From 9e37dbc2cc5fff989ef67fb2c4e493f0b38da50b Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Tue, 12 Nov 2024 20:14:15 +0000 Subject: [PATCH 3/3] Revert "bat -> cmd" This reverts commit 21925cd2c41a6f77d6131cfe75867782fca5d5d8. --- .../ibex_install_utils/tasks/server_tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation_and_upgrade/ibex_install_utils/tasks/server_tasks.py b/installation_and_upgrade/ibex_install_utils/tasks/server_tasks.py index a774cde..35f0b7c 100644 --- a/installation_and_upgrade/ibex_install_utils/tasks/server_tasks.py +++ b/installation_and_upgrade/ibex_install_utils/tasks/server_tasks.py @@ -605,7 +605,7 @@ def update_icp(self, icp_in_labview_modules, register_icp=True): icp_top = os.path.join(EPICS_PATH, "ICP_Binaries", "isisdae") register_icp_commands.add_command( - f'cd /d "{icp_top}" && register_programs.cmd', + f'cd /d "{icp_top}" && register_programs.bat', "", expected_return_val=None, )