Commit 68dd365e authored by Jay Dubb's avatar Jay Dubb
Browse files

-- Fix uninstalling process on Winodws of previous Homer3 installation which...

-- Fix uninstalling process on Winodws of previous Homer3 installation which didn't work in all cases
parent e28dc6cc
Loading
Loading
Loading
Loading

Install/README.txt

deleted100644 → 0
+0 −17
Original line number Original line Diff line number Diff line
Homer3 Build and Installation Procedure:

Building:

1. Download and install Matlab Runtime for the Matlab version you're using to build your installation package. 
2. In the Matlab command window, change current folder to the Homer3 root folder 
3. Run setpaths.m with no arguments
4. Run createInstallFile.m with no arguments.

Installation (same instructions as on the Homer3 github wiki: https://github.com/BUNPC/Homer3/wiki/Download-and-Installation)
 
5. Unzip homer3_install.zip
6. Under the unzipped homer3_install folder, there is a windows shell script setup.bat. Run it by double clicking 
on the file in File Explorer or typing the script name --> ENTER in a command prompt window. 
7. This should install Homer3 and create a Homer3 Desktop shortcut. 

+10 −0
Original line number Original line Diff line number Diff line
function createInstallFile(options)
function createInstallFile(options)


setNamespace('Homer3')

if ~exist('options','var') | isempty(options)
if ~exist('options','var') | isempty(options)
    options = 'all';
    options = 'all';
end
end
@@ -8,11 +10,13 @@ end
dirnameApp = getAppDir;
dirnameApp = getAppDir;
if isempty(dirnameApp)
if isempty(dirnameApp)
    MessageBox('Cannot create installation package. Could not find root application folder.');
    MessageBox('Cannot create installation package. Could not find root application folder.');
    deleteNamespace('Homer3')
    return;
    return;
end
end
dirnameInstall = filesepStandard(fileparts(which('createInstallFile.m')));
dirnameInstall = filesepStandard(fileparts(which('createInstallFile.m')));
if isempty(dirnameInstall)
if isempty(dirnameInstall)
    MessageBox('Cannot create installation package. Could not find root installation folder.');
    MessageBox('Cannot create installation package. Could not find root installation folder.');
    deleteNamespace('Homer3')
    return;
    return;
end
end
addpath(dirnameInstall, '-end')
addpath(dirnameInstall, '-end')
@@ -104,10 +108,16 @@ if exist([dirnameApp, 'FuncRegistry/UserFunctions'],'dir')
    copyfile([dirnameApp, 'FuncRegistry/UserFunctions'], [dirnameInstall, 'homer3_install/FuncRegistry/UserFunctions']);
    copyfile([dirnameApp, 'FuncRegistry/UserFunctions'], [dirnameInstall, 'homer3_install/FuncRegistry/UserFunctions']);
end
end


if ispathvalid([dirnameInstall, 'uninstall.bat'])
    copyfile([dirnameInstall, 'uninstall.bat'], [dirnameInstall, 'homer3_install/uninstall.bat']);
end

% Zip it all up into a single installation file
% Zip it all up into a single installation file
zip([dirnameInstall, 'homer3_install.zip'], [dirnameInstall, 'homer3_install']);
zip([dirnameInstall, 'homer3_install.zip'], [dirnameInstall, 'homer3_install']);


% Clean up 
% Clean up 
deleteNamespace('Homer3')
fclose all;
fclose all;
cleanup(dirnameInstall, dirnameApp);
cleanup(dirnameInstall, dirnameApp);


+1 −0
Original line number Original line Diff line number Diff line
@@ -3,6 +3,7 @@
@echo.
@echo.
@echo   PLEASE WAIT ... INSTALLATION WILL START IN A FEW MINUTES ...
@echo   PLEASE WAIT ... INSTALLATION WILL START IN A FEW MINUTES ...
@echo.
@echo.
@call .\uninstall.bat
@move .\installtemp .\setup.exe
@move .\installtemp .\setup.exe
@echo.
@echo.
@echo   NOTE: In case of installation failure, refer to log file setup.log .
@echo   NOTE: In case of installation failure, refer to log file setup.log .
+5 −16
Original line number Original line Diff line number Diff line
@@ -2,6 +2,8 @@ function setup()
global h
global h
global nSteps
global nSteps


setNamespace('Homer3')

h = waitbar(0,'Installation Progress ...');
h = waitbar(0,'Installation Progress ...');


main();
main();
@@ -14,6 +16,9 @@ close(h);


cleanup();
cleanup();


deleteNamespace('Homer3')






% ------------------------------------------------------------
% ------------------------------------------------------------
@@ -33,22 +38,6 @@ else
end
end
dirnameDst = getAppDir('isdeployed');
dirnameDst = getAppDir('isdeployed');


% Uninstall
try
    if exist(dirnameDst,'dir')
        rmdir(dirnameDst, 's');
    end
catch ME
    close(h);
    printStack();
    msg{1} = sprintf('Error: Could not remove old installation folder %s. It might be in use by other applications.\n', dirnameDst);
    msg{2} = sprintf('Try closing and reopening file browsers or any other applications that might be using the\n');
    msg{3} = sprintf('installation folder and then retry installation.');
    menu([msg{:}], 'OK');
    pause(5);
    rethrow(ME)
end

platform = setplatformparams();
platform = setplatformparams();


v = getVernum();
v = getVernum();
+2 −1
Original line number Original line Diff line number Diff line


@echo off

set dirnameSrc=%cd%
set dirnameSrc=%cd%
set dirnameDst=c:\users\public
set dirnameDst=c:\users\public


IF EXIST %userprofile%\desktop\Homer3.exe.lnk (del /Q /F %userprofile%\desktop\Homer3.exe.lnk)
IF EXIST %userprofile%\desktop\Homer3.exe.lnk (del /Q /F %userprofile%\desktop\Homer3.exe.lnk)
IF EXIST %dirnameDst%\homer3 (del /F /Q %dirnameDst%\homer3\*)
IF EXIST %dirnameDst%\homer3 (rmdir /S /Q %dirnameDst%\homer3)
IF EXIST %dirnameDst%\homer3 (rmdir /S /Q %dirnameDst%\homer3)