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 24 May 2011 10:50, Corinna Vinschen wrote:
> 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")));
> Â Â Â Â}
> Â Â }

Ah, sorry, I didn't realise that the desktop shortcut at the moment
was simply called "Cygwin" rather than "Cygwin Bash Shell". I suppose
that could just stay like that actually.

Also, since the start menu shortcut already is inside the "Cygwin"
folder, just "Terminal" rather than "Cygwin Terminal" would be nice
and crisp there.

Andy


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