 		       (if (stringp in-current-dir?)
 			   in-current-dir?
 			 default-directory)
-		     (concat (getenv "SPECWARE4") "/")))
-	 (dir (concat root-dir "Applications/Specware/Handwritten/Lisp"))
+		     (concat (getenv "SPECWARE4"))))
+	 (dir (concat root-dir "/Applications/Specware/Handwritten/Lisp"))
 	 (bin-dir (concat root-dir
-			     "Applications/Specware/bin/"
+			     "/Applications/Specware/bin/"
 			     (if (memq system-type '(ms-dos windows-nt windows-95
 						     ms-windows))
 				 "windows"
 			       (symbol-name system-type))))
 	 (world-name (concat bin-dir "/Specware4.dxl")))
-    (run-lisp-application)
+    (run-plain-lisp)
     (sw:eval-in-lisp (format "(setf (sys:getenv \"SWPATH:/\") %S)" root-dir))
     (sw:eval-in-lisp (format "(setf (sys:getenv \"SPECWARE4\") %S)" root-dir))
     (sw:eval-in-lisp (format "(top-level::do-command :cd %S)" dir))
     (sw:eval-in-lisp "(load \"Specware4.lisp\")")
 
-    (run-lisp-application)
+    (run-plain-lisp)
     (unless (inferior-lisp-running-p)
       (sleep-for 1))
     (sw:eval-in-lisp (format "(setf (sys:getenv \"SWPATH:/\") %S)" root-dir))

	     (sleep-for 5)
	     (while (inferior-lisp-running-p`)
	       (sleep-for 2))
	     (run-lisp-application)
	     (simulate-input-expression "(load \"load.lisp\")")
	     (simulate-input-expression "(Bootstrap-Spec::compileAll)")))))


(defun bootstrap-specware4 (in-current-dir?)
  (interactive "P")
  (let ((root-dir (if in-current-dir? default-directory
		    (concat (getenv "SPECWARE4")))))
    (run-specware4 root-dir)
    (sleep-for 2)
    (sw:eval-in-lisp (format "(top-level::do-command :cd %S)" root-dir))
