diff --git a/deploy/SpectralAnalysis_Linux.prj b/deploy/SpectralAnalysis_Linux.prj
deleted file mode 100644
index e001d92..0000000
--- a/deploy/SpectralAnalysis_Linux.prj
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
- SpectralAnalysis
- Alan Race
- alan.race@uni-marburg.de
- AlanRace
- ${PROJECT_ROOT}/SpectralAnalysis_resources/icon_24.png
-
- ${PROJECT_ROOT}/SpectralAnalysis_resources/icon_48.png
- ${PROJECT_ROOT}/SpectralAnalysis_resources/icon_24.png
- ${PROJECT_ROOT}/SpectralAnalysis_resources/icon_16.png
-
- Software for the analysis and interactive exploration of spectral imaging data.
- 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.
- ${PROJECT_ROOT}/../docs-src/static/images/SpectralAnalysis-interface-1.3.0.png
- 1.4
-
- - MATLAB
- - Image Processing Toolbox
-
-
- - 1
- - 17
-
-
- - 9.8
- - 11.1
-
-
- ${PROJECT_ROOT}
- 1e1cc4fe-d019-4cfe-9bed-9bc2c1f22d7e
-
-
-
-
-
-
-
-
- /home/alan/Documents/GitProjects/SpectralAnalysis/SpectralAnalysis.m
-
-
-
- /home/alan/Documents/GitProjects/SpectralAnalysis/files
- /home/alan/Documents/GitProjects/SpectralAnalysis/lib
- /home/alan/Documents/GitProjects/SpectralAnalysis/src
- /home/alan/Documents/GitProjects/SpectralAnalysis/version.txt
-
-
-
- /home/alan/Documents/GitProjects/SpectralAnalysis/deploy
-
-
-
- /usr/local/MATLAB/R2020a
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
- true
-
-
-
-
- true
-
-
-
-
- true
-
-
-
-
- true
-
-
-
-
- true
-
-
-
-
- true
- false
- false
- false
- false
- false
- true
- false
- 5.4.0-42-generic
- false
- true
- glnxa64
- true
-
-
-
\ No newline at end of file
diff --git a/deploy/SpectralAnalysis_Linux_StandaloneWithInstaller.prj b/deploy/SpectralAnalysis_Linux_StandaloneWithInstaller.prj
deleted file mode 100644
index 28318f8..0000000
--- a/deploy/SpectralAnalysis_Linux_StandaloneWithInstaller.prj
+++ /dev/null
@@ -1,160 +0,0 @@
-
-
- SpectralAnalysis
-
-
- 1.4
- Alan Race
- alan.race@uni-marburg.de
- Alan Race
- Software for the analysis and interactive exploration of spectral imaging data.
- 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.
-
-
- /SpectralAnalysis/
- option.installpath.userlocal
- /home/alan/Documents/GitProjects/SpectralAnalysis/docs-src/static/images/SpectralAnalysis_logo_nobg.png
-
- In the following directions, replace MR/v98 by the directory on the target machine where MATLAB is installed, or MR by the directory where the MATLAB Runtime is installed.
-
-(1) Set the environment variable XAPPLRESDIR to this value:
-
-MR/v98/X11/app-defaults
-
-
-(2) If the environment variable LD_LIBRARY_PATH is undefined, set it to the following:
-
-MR/v98/runtime/glnxa64:MR/v98/bin/glnxa64:MR/v98/sys/os/glnxa64:MR/v98/sys/opengl/lib/glnxa64
-
-If it is defined, set it to the following:
-
-${LD_LIBRARY_PATH}:MR/v98/runtime/glnxa64:MR/v98/bin/glnxa64:MR/v98/sys/os/glnxa64:MR/v98/sys/opengl/lib/glnxa64
- ${PROJECT_ROOT}/SpectralAnalysis_Linux_StandaloneWithInstaller/for_testing
- ${PROJECT_ROOT}/SpectralAnalysis_Linux_StandaloneWithInstaller/for_redistribution_files_only
- ${PROJECT_ROOT}/SpectralAnalysis_Linux_StandaloneWithInstaller/for_redistribution
- ${PROJECT_ROOT}/SpectralAnalysis_Linux_StandaloneWithInstaller
- false
-
- subtarget.standalone
-
- true
- false
- false
- SpectralAnalysisInstaller_web
- MyAppInstaller_mcr
- MyAppInstaller_app
- false
- false
-
- false
- false
-
- Syntax
- -?
-
- Input Arguments
- -? print help on how to use the application
- input arguments
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- /home/alan/Documents/GitProjects/SpectralAnalysis/SpectralAnalysis.m
-
-
- /home/alan/Documents/GitProjects/SpectralAnalysis/files
- /home/alan/Documents/GitProjects/SpectralAnalysis/lib
- /home/alan/Documents/GitProjects/SpectralAnalysis/src
- /home/alan/Documents/GitProjects/SpectralAnalysis/version.txt
-
-
-
- ${MATLAB_ROOT}/examples/slcheck/data/data.mat
-
-
- /home/alan/Documents/GitProjects/SpectralAnalysis/deploy/SpectralAnalysis_Linux_StandaloneWithInstaller/for_testing/run_SpectralAnalysis.sh
- /home/alan/Documents/GitProjects/SpectralAnalysis/deploy/SpectralAnalysis_Linux_StandaloneWithInstaller/for_testing/readme.txt
- /home/alan/Documents/GitProjects/SpectralAnalysis/deploy/SpectralAnalysis_Linux_StandaloneWithInstaller/for_testing/SpectralAnalysis
- /home/alan/Documents/GitProjects/SpectralAnalysis/deploy/SpectralAnalysis_Linux_StandaloneWithInstaller/for_testing/splash.png
-
-
-
- /usr/local/MATLAB/R2020a
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
- true
-
-
-
-
- true
-
-
-
-
- true
-
-
-
-
- true
-
-
-
-
- true
-
-
-
-
- true
- false
- false
- false
- false
- false
- true
- false
- 5.4.0-42-generic
- false
- true
- glnxa64
- true
-
-
-
\ No newline at end of file
diff --git a/deploy/SpectralAnalysis_resources/installerLogo.png b/deploy/SpectralAnalysis_resources/installerLogo.png
new file mode 100644
index 0000000..f02f9b0
Binary files /dev/null and b/deploy/SpectralAnalysis_resources/installerLogo.png differ
diff --git a/deploy/SpectralAnalysis_resources/installerSplash.png b/deploy/SpectralAnalysis_resources/installerSplash.png
new file mode 100644
index 0000000..c7ead76
Binary files /dev/null and b/deploy/SpectralAnalysis_resources/installerSplash.png differ
diff --git a/deploy/deploy.m b/deploy/deploy.m
index 67c3763..a9f38d1 100644
--- a/deploy/deploy.m
+++ b/deploy/deploy.m
@@ -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', 'alan.race@uni-marburg.de',...
+ '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
\ No newline at end of file
diff --git a/files/SA_icon_256.ico b/files/SA_icon_256.ico
new file mode 100644
index 0000000..a8d8fc1
Binary files /dev/null and b/files/SA_icon_256.ico differ
diff --git a/src/util/getSpectralAnalysisFolder.m b/src/util/getSpectralAnalysisFolder.m
index f8bf508..baabd7d 100644
--- a/src/util/getSpectralAnalysisFolder.m
+++ b/src/util/getSpectralAnalysisFolder.m
@@ -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
diff --git a/src/util/saversion.m b/src/util/saversion.m
index a9713c9..da87317 100644
--- a/src/util/saversion.m
+++ b/src/util/saversion.m
@@ -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
diff --git a/version.txt b/version.txt
index 9080f64..5ddde6d 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-1.4.0-7457530
\ No newline at end of file
+1.4.0-38ce932
\ No newline at end of file