From 821daf87bba5fa47a2ef856d5fb0817a2746800f Mon Sep 17 00:00:00 2001 From: aymanhab Date: Sat, 14 Dec 2024 12:38:12 -0800 Subject: [PATCH 1/2] initialize api_distro to false on windows as layout doesn't change between api and app --- Bindings/Java/Matlab/configureOpenSim.m.in | 1 + 1 file changed, 1 insertion(+) diff --git a/Bindings/Java/Matlab/configureOpenSim.m.in b/Bindings/Java/Matlab/configureOpenSim.m.in index b92d77426c..aac289933f 100644 --- a/Bindings/Java/Matlab/configureOpenSim.m.in +++ b/Bindings/Java/Matlab/configureOpenSim.m.in @@ -114,6 +114,7 @@ try % This function returns all but the leaf element of the provided path. openSimFolder = fileparts(openSimFolder); end + api_distro = false; % For this to be an OpenSim installation, there must be a buildinfo file. buildInfoFile = fullfile(openSimFolder, '@CMAKE_INSTALL_SYSCONFDIR@', ... 'OpenSim_buildinfo.txt'); From b0b8d847590cdf9a7fb764b23fe417ed63783c7d Mon Sep 17 00:00:00 2001 From: aymanhab Date: Tue, 17 Dec 2024 12:17:42 -0800 Subject: [PATCH 2/2] Return api_distro as output --- Bindings/Java/Matlab/configureOpenSim.m.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Bindings/Java/Matlab/configureOpenSim.m.in b/Bindings/Java/Matlab/configureOpenSim.m.in index aac289933f..696d3fafb9 100644 --- a/Bindings/Java/Matlab/configureOpenSim.m.in +++ b/Bindings/Java/Matlab/configureOpenSim.m.in @@ -66,7 +66,7 @@ function configureOpenSim() % permissions and limitations under the License. % % ----------------------------------------------------------------------- % -function [openSimFolder] = uiGetOpenSimFolder() +function [openSimFolder, api_distro] = uiGetOpenSimFolder() % Prompt user for OpenSim folder. startPath = ''; @@ -86,6 +86,7 @@ function [openSimFolder] = uiGetOpenSimFolder() if ~openSimFolder showMessage('You did not select a folder.', 'Error', true); end + api_distro = false if ismac [~, name, ext] = fileparts(openSimFolder); % If openSimFolder is '/Applications/OpenSim 4.0.1' then we'll get: @@ -123,7 +124,7 @@ try % installation; ask the user to choose an install directory. correctFolder = false; while ~correctFolder - openSimFolder = uiGetOpenSimFolder(); + [openSimFolder, api_distro] = uiGetOpenSimFolder(); % Check if the user selected a valid folder. if api_distro subfoldername = 'etc';