Skip to content

Commit

Permalink
Updated deploy script to create installer when MATLAB version new enough
Browse files Browse the repository at this point in the history
Removed accidental addition of compiled file
  • Loading branch information
AlanRace committed Aug 11, 2020
1 parent 38ce932 commit 31d6b7c
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 276 deletions.
111 changes: 0 additions & 111 deletions deploy/SpectralAnalysis_Linux.prj

This file was deleted.

160 changes: 0 additions & 160 deletions deploy/SpectralAnalysis_Linux_StandaloneWithInstaller.prj

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 49 additions & 2 deletions deploy/deploy.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,53 @@
cd([srcPath filesep 'processing' filesep 'postprocessing' filesep 'mepca'])
compileMEPCA

cd(path)
cd(curDir)

mcc -v -m SpectralAnalysis.m -a lib/ -a src/ -a *.m -a *.mex* -a version.txt
if ispc
wOption = "'WinMain:SpectralAnalysis,version=1.4'";
osText = 'win';
end

saFolder = [getSpectralAnalysisFolder() filesep];
deployFolder = [saFolder filesep 'deploy'];

mccCommand = "mcc -o SpectralAnalysis -W %s -T link:exe -v %sSpectralAnalysis.m -d %s -a %sfiles -a %slib -a %ssrc -a %sversion.txt -r '%s'";
mccCommand = sprintf(mccCommand, wOption, saFolder, deployFolder, saFolder, saFolder, saFolder, saFolder, [saFolder 'files' filesep 'SA_icon_256.ico']) %'C:\Program Files\MATLAB\R2020a\toolbox\compiler\resources\default_icon.ico')%

eval(mccCommand);

if ispc
defaultInstallDir = 'C:\Program Files\SpectralAnalysis';
elseif isunix
defaultInstallDir = '/usr/local/SpectralAnalysis';
end

matlabVersion = version('-release');
matlabYear = str2num(matlabVersion(1:end-1));

if matlabYear >= 2020
installerOpts = compiler.package.InstallerOptions('ApplicationName', 'SpectralAnalysis',...
'Version', saversion(false), ...
'AuthorCompany', 'Alan Race',...
'AuthorName', 'Alan Race',...
'AuthorEmail', '[email protected]',...
'InstallerName', 'SpectralAnalysis_Installer',...
'InstallerIcon', [deployFolder filesep 'SpectralAnalysis_resources' filesep 'icon_48.png'], ...
'InstallerLogo', [deployFolder filesep 'SpectralAnalysis_resources' filesep 'installerLogo.png'], ...
'InstallerSplash', [deployFolder filesep 'SpectralAnalysis_resources' filesep 'installerSplash.png'], ...
'OutputDir', deployFolder, ...
'DefaultInstallationDir', defaultInstallDir, ...
'Summary', 'Software for the analysis and interactive exploration of spectral imaging data.', ...
'Description', 'Software for the analysis and interactive exploration of spectral imaging data (such as mass spectrometry imaging and Raman spectroscopy mapping), including visualisation of both images and spectra, preprocessing, multivariate analysis and machine learning.');

compiler.package.installer([deployFolder filesep 'SpectralAnalysis.exe'], [deployFolder filesep 'requiredMCRProducts.txt'], 'Options', installerOpts);
end


if ispc
movefile([deployFolder filesep 'SpectralAnalysis.exe'], [deployFolder filesep 'SpectralAnalysis-' saversion(false) '-' osText '.exe']);

if matlabYear >= 2020
movefile([deployFolder filesep 'SpectralAnalysis_Installer.exe'], [deployFolder filesep 'SpectralAnalysis-' saversion(false) '-' osText '-installer-web.exe']);
end
end
Binary file added files/SA_icon_256.ico
Binary file not shown.
6 changes: 6 additions & 0 deletions src/util/getSpectralAnalysisFolder.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
else
pathstr = fileparts(mfilename('fullpath'));

curFolder = pwd;

% lib folder is ../../lib compared to current location of ./util
pathstr = [pathstr filesep '..' filesep '..'];

cd(pathstr);
pathstr = pwd;
cd(curFolder);
end

8 changes: 6 additions & 2 deletions src/util/saversion.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
function version = saversion()
function version = saversion(includeCommit)

if nargin == 0
includeCommit = true;
end

version = '1.4.0';

if(isdeployed())
if(isdeployed() || ~includeCommit)
return
end

Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.0-7457530
1.4.0-38ce932

0 comments on commit 31d6b7c

Please sign in to comment.