|
65 | 65 |
|
66 | 66 | if ~status && install |
67 | 67 |
|
68 | | - msg = sprintf('installing MACS toolbox in:\n%s.\n\n', ... |
69 | | - fullfile(spm('dir'), 'toolbox', 'MACS')); |
70 | | - id = 'installingMacsToolbox'; |
71 | | - logger('WARNING', msg, 'id', id, 'filename', mfilename(), 'options', opt); |
72 | | - |
73 | | - copyfile(fullfile(returnRootDir(), 'lib', 'MACS'), ... |
74 | | - fullfile(spm('dir'), 'toolbox', 'MACS')); |
| 68 | + installMacstoolbox(opt); |
75 | 69 |
|
76 | 70 | status = checkToolbox(toolboxName); |
77 | 71 |
|
|
94 | 88 | end |
95 | 89 |
|
96 | 90 | end |
| 91 | + |
| 92 | +function installMacstoolbox(opt) |
| 93 | + SPM_DIR = spm('dir'); |
| 94 | + MACS_TOOLBOX_DIR = fullfile(returnRootDir(), 'lib', 'MACS'); |
| 95 | + |
| 96 | + target_dir = fullfile(SPM_DIR, 'toolbox', 'MACS'); |
| 97 | + |
| 98 | + msg = sprintf('installing MACS toolbox in:\n%s.\n\n', target_dir); |
| 99 | + id = 'installingMacsToolbox'; |
| 100 | + logger('WARNING', msg, 'id', id, 'filename', mfilename(), 'options', opt); |
| 101 | + |
| 102 | + if exist(target_dir, 'dir') == 7 |
| 103 | + rmdir(target_dir, 's'); |
| 104 | + end |
| 105 | + mkdir(target_dir); |
| 106 | + copyfile(MACS_TOOLBOX_DIR, target_dir); |
| 107 | +end |
0 commit comments