Index: /issm/trunk-jpl/src/m/os/issmdir.m
===================================================================
--- /issm/trunk-jpl/src/m/os/issmdir.m	(revision 20376)
+++ /issm/trunk-jpl/src/m/os/issmdir.m	(revision 20377)
@@ -5,14 +5,22 @@
 %      ISSM_DIR=issmdir()
 
-if ~ispc(),
-	ISSM_DIR =getenv('ISSM_DIR');
+%Initialize output ISSM_DIR
+ISSM_DIR='';
+
+%Get ISSM_DIR from function path (we do not want to force users to edit their bashrc)
+path=which('issmdir');
+
+%issmdir might be in bin,
+pos=strfind(path,'bin/issmdir.m');
+if ~isempty(pos),
+	ISSM_DIR=path(1:pos-1);
 else
-	ISSM_DIR =getenv('ISSM_DIR_WIN');
-	if strcmpi(ISSM_DIR(end),'/') | strcmpi(ISSM_DIR(end),'\'),
-		ISSM_DIR = ISSM_DIR(1:end-1); %shave off the last '/'
+	pos=strfind(path,'src/m/os/issmdir.m');
+	if ~isempty(pos),
+		ISSM_DIR=path(1:pos-1);
 	end
 end
 
-if (isempty(ISSM_DIR)),
-	error('issmdir error message: ''ISSM_DIR'' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!');
+if isempty(ISSM_DIR),
+	error('Could not determine the location of ISSM...');
 end
