This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: setup and mintty (was Re: New setup.exe release?)


On May 24 11:15, Corinna Vinschen wrote:
> On May 23 21:14, Andy Koppe wrote:
> > On 23 May 2011 12:50, Corinna Vinschen wrote:
> > > And who's going to create the patches?
> > 
> > I suppose that should be me, but my spare time is rather limited at
> > the moment and I still owe a patch or two for other things.
> 
> I'm just trying a setup.exe patch which creates "Cygwin Terminal"
> desktop and start menu entries which point to "mintty -".  I just
> have to get rid of my build environment problems...

Ok, here's my patch.  It just replaces the Desktop and Start Menu
entries with "Cygwin Terminal" entries pointing to "mintty -" and
leaves Cygwin.bat untouched.  Is that ok with everyone?

Index: desktop.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/desktop.cc,v
retrieving revision 2.55
diff -u -p -r2.55 desktop.cc
--- desktop.cc	19 Nov 2010 15:49:54 -0000	2.55
+++ desktop.cc	24 May 2011 09:47:51 -0000
@@ -78,7 +78,8 @@ DesktopSetupPage::DesktopSetupPage ()
 static void
 make_link (const std::string& linkpath,
            const std::string& title,
-           const std::string& target)
+           const std::string& target,
+           const std::string& arg)
 {
   std::string fname = linkpath + "/" + title + ".lnk";
 
@@ -93,10 +94,10 @@ make_link (const std::string& linkpath,
   std::string exepath;
   std::string argbuf;
 
-  if (!is_legacy)
+  if (IsWindowsNT ())
     {
       exepath = target;
-      argbuf = " ";
+      argbuf = arg;
     }
   else
     {
@@ -105,6 +106,8 @@ make_link (const std::string& linkpath,
       GetWindowsDirectory (windir, sizeof (windir));
       exepath = std::string(windir) + "\\command.com";
       argbuf = "/E:4096 /c " + target;
+      if (arg.size ())
+	argbuf += " " + arg;
     }
 
   msg ("make_link_2 (%s, %s, %s, %s)",
@@ -115,7 +118,8 @@ make_link (const std::string& linkpath,
 }
 
 static void
-start_menu (const std::string& title, const std::string& target)
+start_menu (const std::string& title, const std::string& target,
+	    const std::string& arg)
 {
   LPITEMIDLIST id;
   int issystem = (root_scope == IDC_ROOT_SYSTEM) ? 1 : 0;
@@ -137,11 +141,12 @@ start_menu (const std::string& title, co
     }
 // end of Win95 addition
   path += "/Cygwin";
-  make_link (path, title, target);
+  make_link (path, title, target, arg);
 }
 
 static void
-desktop_icon (const std::string& title, const std::string& target)
+desktop_icon (const std::string& title, const std::string& target,
+	      const std::string& arg)
 {
   char path[MAX_PATH];
   LPITEMIDLIST id;
@@ -161,7 +166,7 @@ desktop_icon (const std::string& title, 
       msg ("Desktop directory for deskop link changed to: %s", path);
     }
 // end of Win95 addition
-  make_link (path, title, target);
+  make_link (path, title, target, arg);
 }
 
 static void
@@ -243,15 +248,17 @@ do_desktop_setup ()
 
   make_cygwin_bat ();
 
+  std::string target;
+
+  target = is_legacy ? batname : backslash (cygpath ("/bin/mintty"));
+
   if (root_menu)
-    {
-      start_menu ("Cygwin Bash Shell", batname);
-    }
+    start_menu (is_legacy ? "Cygwin Bash Shell" : "Cygwin Terminal", target,
+    		is_legacy ? "" : "-");
 
   if (root_desktop)
-    {
-      desktop_icon ("Cygwin", batname);
-    }
+    desktop_icon (is_legacy ? "Cygwin" : "Cygwin Terminal", target,
+		  is_legacy ? "" : "-");
 }
 
 static int da[] = { IDC_ROOT_DESKTOP, 0 };
@@ -425,8 +432,11 @@ DesktopSetupPage::OnActivate ()
       else
 	{
 	  root_menu =
-	    check_startmenu ("Cygwin Bash Shell",
-			     backslash (cygpath ("/cygwin.bat")));
+	    is_legacy
+	    ? check_startmenu ("Cygwin Bash Shell",
+			       backslash (cygpath ("/cygwin.bat")))
+	    : check_startmenu ("Cygwin Terminal",
+			       backslash (cygpath ("/bin/mintty")));
 	}
 
       if (NoDesktopOption) 
@@ -436,7 +446,10 @@ DesktopSetupPage::OnActivate ()
       else
 	{
 	  root_desktop =
-	    check_desktop ("Cygwin", backslash (cygpath ("/cygwin.bat")));
+	    is_legacy
+	    ? check_desktop ("Cygwin", backslash (cygpath ("/cygwin.bat")))
+	    : check_desktop ("Cygwin Terminal",
+			     backslash (cygpath ("/bin/mintty")));
 	}
     }
 

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]