]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
Rename Start Menu folder for 32-bit installs on WoW64
authorJon Turney <jon.turney@dronecode.org.uk>
Tue, 17 Mar 2020 13:54:16 +0000 (13:54 +0000)
committerJon Turney <jon.turney@dronecode.org.uk>
Wed, 18 Mar 2020 22:20:39 +0000 (22:20 +0000)
This is not totally straightforward: Since setup can install Cygwin with
either bitness (using the '--arch 32|64' option), we must do the right
thing if this is a 64-bit installer being used to install 32-bit Cygwin,
which will run under WoW, even if the installer isn't...

(Naming things like this makes things consistent with Cygwin-X, which
already names it's Start Menu folder 'Cygwin-X (32-bit)' on WoW64. It
also ensures that there aren't collisions between any setup created
shortcuts for 32-bit and 64-bits.)

The desktop icon is already named 'Cygwin Terminal' or 'Cygwin64
Terminal' so doesn't need attention.

Start menu links made in the 'Cygwin' folder by cygwin-doc, and possibly
other packages will also need adjusting.

desktop.cc

index eec8ca912247928963b5afd9125091b68abe5e35..29dbf635e0138e6ca83cb163f91e2ac58a4a20bb 100644 (file)
@@ -95,6 +95,14 @@ make_link (const std::string& linkpath,
               icon.c_str(), fname.c_str());
 }
 
+static const char *startmenudir()
+{
+  if (!is_64bit && (WowNativeMachine() != IMAGE_FILE_MACHINE_I386))
+    return "/Cygwin (32-bit)";
+  else
+    return "/Cygwin";
+}
+
 static void
 start_menu (const std::string& title, const std::string& target,
            const std::string& arg, const std::string& iconpath)
@@ -107,7 +115,7 @@ start_menu (const std::string& title, const std::string& target,
                              issystem ? CSIDL_COMMON_PROGRAMS :
                              CSIDL_PROGRAMS, &id);
   SHGetPathFromIDList (id, path);
-  strncat (path, "/Cygwin", MAX_PATH - strlen(path) - 1);
+  strncat (path, startmenudir(), MAX_PATH - strlen(path) - 1);
   LogBabblePrintf ("Program directory for program link: %s", path);
   make_link (path, title, target, arg, iconpath);
 }
@@ -194,7 +202,6 @@ save_icon (std::string &iconpath, const char *resource_name)
 #define TERMINALICON   "/Cygwin-Terminal.ico"
 #define TERMINALTITLE  (is_64bit ? "Cygwin64 Terminal" \
                                  : "Cygwin Terminal")
-#define STARTMENUDIR   "/Cygwin"
 
 static void
 do_desktop_setup ()
@@ -300,7 +307,7 @@ check_startmenu (const std::string title, const std::string target)
                              CSIDL_PROGRAMS, &id);
   SHGetPathFromIDList (id, path);
   LogBabblePrintf ("Program directory for program link: %s", path);
-  strcat (path, STARTMENUDIR);
+  strcat (path, startmenudir());
   std::string fname = std::string(path) + "/" + title + ".lnk";
 
   if (_access (fname.c_str(), 0) == 0)
This page took 0.037757 seconds and 5 git commands to generate.