diff --git a/pd/nw/dialog_search.html b/pd/nw/dialog_search.html
index b423bfbaffacacd5dda1332e7a3df4e63c852477..53d8e74abcf449940fe6dd2ab02914886d2a8771 100644
--- a/pd/nw/dialog_search.html
+++ b/pd/nw/dialog_search.html
@@ -516,6 +516,7 @@ function add_events() {
 }
 
 function register_window_id(id, attrs) {
+    var doc_path = path.join(pdgui.get_lib_dir(), "doc");
     translate_form();
     // Translate the placeholder for the search input:
     document.getElementById("search_text").placeholder =
@@ -526,7 +527,7 @@ function register_window_id(id, attrs) {
     document.getElementById("results").textContent = l("search.building_index");
     document.getElementById("search_text").disabled = true;
     document.getElementById("file_browser").setAttribute("nwworkingdir",
-        pdgui.get_gui_dir() + "/doc"); // Probably need a doc getter in pdgui
+        doc_path); // Probably need a doc getter in pdgui
     build_index();
 }
 
diff --git a/pd/nw/index.js b/pd/nw/index.js
index d17d6ba2f9ff979e6204ab77ef9fb591798452c8..fa929b0ff42e9a7fa1110f8fdf0f2d083774293b 100644
--- a/pd/nw/index.js
+++ b/pd/nw/index.js
@@ -25,30 +25,22 @@ function have_args() {
 }
 
 function set_vars(win) {
-    var port_no, gui_dir, font_engine_sanity, pd_engine_id;
+    var port_no, font_engine_sanity, pd_engine_id;
     // If the GUI was started by Pd, our port number is going to be
     // the first argument. If the GUI is supposed to start Pd, we won't
     // have any arguments and need to set it here.
     if (have_args() && gui.App.argv.length > 1) {
         port_no = gui.App.argv[0]; // fed to us by the Pd process
-        // looks like this is the same as pwd below
-        gui_dir = gui.App.argv[3];
         // address unique to the pd_engine
         pd_engine_id = gui.App.argv[4];
     } else {
         // If we're starting Pd, this is the first port number to try. (We'll
         // increment it if that port happens to be taken.
         port_no = 5400;
-        // This is confusing and needs to be rethought. OSX app bundle needs
-        // the gui_dir to be "bin", but the actual gui files reside in
-        // "bin/../" because of the structure of the nw.js app bundle we use.
-        // Anyway, this seems to get all the "doc" links to be found...
-        gui_dir = process.platform === "darwin" ? "bin" : pwd;
     }
     pdgui.set_port(port_no);
     pdgui.set_pd_engine_id(pd_engine_id);
     pdgui.set_pwd(pwd);
-    pdgui.set_gui_dir(gui_dir);
     pdgui.set_pd_window(win);
     font_engine_sanity = pdgui.set_font_engine_sanity(win);
     pdgui.set_app_quitfn(app_quit);
diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js
index a8c6ac30daf9e112baed221a11b4442a63e9296f..a90235bac994f58b372108603769a169fb2f36d1 100644
--- a/pd/nw/pdgui.js
+++ b/pd/nw/pdgui.js
@@ -1,7 +1,6 @@
 "use strict";
 
 var pwd;
-var gui_dir;
 var lib_dir;
 var pd_engine_id;
 
@@ -27,15 +26,6 @@ exports.set_pd_engine_id = function (id) {
 
 exports.defunkify_windows_path = defunkify_windows_path;
 
-exports.set_gui_dir = function(dir_string) {
-    gui_dir = path.normalize(path.join(dir_string, ".."));
-    gui_dir = defunkify_windows_path(gui_dir);
-}
-
-exports.get_gui_dir = function() {
-    return gui_dir;
-}
-
 function gui_set_lib_dir(dir) {
     lib_dir = dir;
 }