forked from lbf-ijs/DiffusiveDynamics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install.m
19 lines (15 loc) · 843 Bytes
/
Install.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
(* ::Package:: *)
(*This script copies the DiffusiveDynmaics subdirectory into $UserBaseDirectory/Applications.
If the directory with the same name allready exists a backup copy is made just in case,
and then the directory is deleted.*)
SetDirectory@NotebookDirectory[];
(*Get the target dir*)
targetDir=FileNameJoin[{$UserBaseDirectory,"Applications","DiffusiveDynamics"}];
(*Backup dir if it exists just in case*)
Quiet@CopyDirectory[targetDir,
FileNameJoin[{$UserBaseDirectory,"Applications",
"DiffusiveDynamics-Backup"<>DateString[{"Year","Month","Day"}]}]];
(*Delete the directory*)
DeleteDirectory[targetDir,DeleteContents->True];
result=CopyDirectory["DiffusiveDynamics",targetDir];
If[result=!=$Failed,Needs["DiffusiveDynamics`"];"Successfully installed package to:\n"<>targetDir]