%function lsdc2_install
%  Install at home a copy of CMNO files found in the lab
%  April 2023, J. Gaspar

if ~ispc
    error('Install script made only for Windows')
end

% define and make destination dir
p= 'c:\users2';
if ~exist(p, 'dir')
    mkdir(p);
end

% define source (url) and local file (lsdc2.zip)
url= 'http://users.isr.ist.utl.pt/~jag/aulas/cmno22/distr/lsdc2.zip';
f= 'lsdc2';
e= '.zip';

% function download_and_unzip( p, f, e, url )
str= ['curl --output "' f e '" --ssl-no-revoke --url ' url];
cd0= cd; cd(p)
try
    %[status, cmdout]= system(str);
    [~, ~]= system(str);
catch
    error('download of zip file failed')
end

unzip([f e])
cd(cd0);

% local install
cd0= cd; cd c:\users2\lsdc2
login_z_install
cd(cd0);

% typical usage
disp('Whenever you want, go to your working folder with >> login_cee')
