Skip to content

Commit

Permalink
new feature: option for exclusive PC usage (toolbox will not work und…
Browse files Browse the repository at this point in the history
…er other systems)
  • Loading branch information
marwan committed Sep 4, 2014
1 parent 807a89f commit 583b881
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions makeinstall.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ function makeinstall(varargin)
% $Revision$
%
% $Log$
% Revision 3.32 2014/08/19 19:47:58 marwan
% avoid addpath of package directories (+folders)
%
% Revision 3.31 2014/08/19 11:32:21 marwan
% fid-bug in error handling fixed, extension of ignoring of further non-Matlab files
%
Expand Down Expand Up @@ -195,7 +198,7 @@ function makeinstall(varargin)
toolbox_name = ''; install_file = ''; install_path = ''; deinstall_file = ''; src_dir = '';
install_dirPC = ''; install_dirUNIX = ''; version_file = ''; version_number = ''; release = '';
infostring = ''; old_dirs = ''; xml_name = ''; xml_start = ''; xml_demo = ''; xml_web = ''; restart = 0;
count_warnings = 0; include_pfiles = 0;
count_warnings = 0; include_pfiles = 0; pc_only = 0;
max_warnings = 10; % more warnings than this number will be suppressed - feel free to change this number
fid = 0;

Expand Down Expand Up @@ -343,6 +346,7 @@ function makeinstall(varargin)
if isempty(version_number), version_number = 'none'; end
if isempty(release), release = ' '; end
if isempty(include_pfiles), include_pfiles = 0; end
if isempty(pc_only), pc_only = 0; end
% if isempty(infostring), infostring = ''; end
old_dirs = lower(old_dirs);
if ~iscell(old_dirs), old_dirs = cellstr(old_dirs); end
Expand Down Expand Up @@ -390,6 +394,11 @@ function makeinstall(varargin)
b(i) = strrep(b(i),'$generation_date$',time_string);
b(i) = strrep(b(i),'$check_for_old$',check_for_old);
b(i) = strrep(b(i),'$mi_version$',mi_version);
if pc_only
b(i) = strrep(b(i),'$pc_only$','if ~ispc, error(''Sorry, this toolbox can be used only on a PC (Windows).''), end');
else
b(i) = strrep(b(i),'$pc_only$','');
end
if isempty(infostring)
b(i) = strrep(b(i),'$infostring$','');
else
Expand Down Expand Up @@ -786,8 +795,9 @@ function makeinstall(varargin)
fprintf(fid,'%s\n','old_dirs=''''; % possible old (obsolete) toolbox folders');
fprintf(fid,'%s\n','install_path=''''; % the root folder where the toolbox folder will be located (default is $USER$/matlab or $MATLABROOT$/toolbox, or $USERS$/octave when installing for Octave)');
fprintf(fid,'%s\n',['install_dirUNIX=''',toolbox_name,'''; % the folder where the toolbox files will be extracted (UNIX)']);
fprintf(fid,'%s\n','install_dirPC=install_dirUNIX; % the folder where the toolbox files will be extracted (PC)');
fprintf(fid,'%s\n',['src_dir=''',pwd,'''; % folder with the origin toolbox']);
fprintf(fid,'%s\n','install_dirPC=install_dirUNIX; % the folder where the toolbox files will be extracted (PC)');
fprintf(fid,'%s\n',['src_dir=''',pwd,'''; % folder with the origin toolbox (optional, can be empty)']);
fprintf(fid,'%s\n\n','pc_only=0; % switch to 1 only if the toolbox is not working under Linux or Mac');
fprintf(fid,'%s\n\n','include_pfiles=0; % switch to ignore (=0) or include (=1) Matlab p-files');
fprintf(fid,'%s\n','version_file=''''; % include in this file a line like this: % $Revision$');
fprintf(fid,'%s\n','version_number=''''; % or put the version number in this variable');
Expand Down Expand Up @@ -844,6 +854,8 @@ function makeinstall(varargin)
%@time_stamp='';checksum='';checksum_file=''; instpaths = '';
%@errcode=0;
%@
%@ $pc_only$
%@
%@try
%@ warning('off')
%@ if isoctave
Expand Down

0 comments on commit 583b881

Please sign in to comment.