Signed-off-by: Heiko Voigt <heiko...@mahr.de>
---
What do you think? I have also pushed this to msysgit onto hv/assoc_sh.
Cheers Heiko
share/WinGit/install.iss | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/share/WinGit/install.iss b/share/WinGit/install.iss
index 05d1d4b..a9162ec 100644
--- a/share/WinGit/install.iss
+++ b/share/WinGit/install.iss
@@ -48,6 +48,8 @@ Name: ext\reg\shellhere; Description: Git Bash Here; Types: custom
Name: ext\reg\guihere; Description: Git GUI Here; Types: custom
Name: ext\cheetah; Description: Use Context Menu Plugin (git-cheetah) ; Flags: exclusive; Types: custom
Name: assoc; Description: Associate .git* configuration files with the default text editor; Types: custom
+Name: assoc_sh; Description: Associate .sh files to be run with bash; Types: custom
+
Name: consolefont; Description: Use a TrueType font in the console (required for proper character encoding); Types: custom
[Files]
@@ -101,6 +103,15 @@ Root: HKCU; Subkey: Software\Classes\.gitmodules; ValueType: string; ValueData:
Root: HKCU; Subkey: Software\Classes\.gitmodules; ValueType: string; ValueName: Content Type; ValueData: text/plain; Flags: createvalueifdoesntexist; Check: not IsAdminLoggedOn; Components: assoc
Root: HKCU; Subkey: Software\Classes\.gitmodules; ValueType: string; ValueName: PerceivedType; ValueData: text; Flags: createvalueifdoesntexist; Check: not IsAdminLoggedOn; Components: assoc
+Root: HKCR; Subkey: .sh; ValueType: string; ValueData: sh_auto_file; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
+Root: HKCR; Subkey: sh_auto_file; ValueType: string; ValueData: "Shell Script"; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
+Root: HKCR; Subkey: sh_auto_file\shell; ValueType: string; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
+Root: HKCR; Subkey: sh_auto_file\shell\open; ValueType: string; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
+Root: HKCR; Subkey: sh_auto_file\shell\open\command; ValueType: string; ValueData: """{app}\bin\sh.exe"" ""--login"" ""%1"" %*"; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
+Root: HKCR; Subkey: sh_auto_file\DefaultIcon; ValueType: string; ValueData: "%SystemRoot%\System32\shell32.dll,-153"; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
+Root: HKCR; Subkey: sh_auto_file\ShellEx; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
+Root: HKCR; Subkey: sh_auto_file\ShellEx\DropHandler; ValueType: string; ValueData: "{86C86720-42A0-1069-A2E8-08002B30309D}"; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
+
[UninstallDelete]
; Delete the built-ins.
Type: files; Name: {app}\bin\git-*.exe
--
1.7.2.m5.2
On Wed, 10 Nov 2010, Heiko Voigt wrote:
> Having bash scripts automatically run by git bash is helpful because you
> can directly bash scripts from cmd.exe, via doubleclick in the explorer
> or use them directly in IDEs.
While in principle, I like the idea, I would like to caution against doing
this without an opt-out...
Ciao,
Johannes
There is an opt-out. Its a checkbox in the installer like with the
association of the .git* files. Its checked by default though.
Cheers Heiko
On Wed, 10 Nov 2010, Heiko Voigt wrote:
> On Wed, Nov 10, 2010 at 11:21:16PM +0100, Johannes Schindelin wrote:
> > On Wed, 10 Nov 2010, Heiko Voigt wrote:
> >
> > > Having bash scripts automatically run by git bash is helpful because
> > > you can directly bash scripts from cmd.exe, via doubleclick in the
> > > explorer or use them directly in IDEs.
> >
> > While in principle, I like the idea, I would like to caution against
> > doing this without an opt-out...
>
> There is an opt-out. Its a checkbox in the installer like with the
> association of the .git* files. Its checked by default though.
Ah, thanks. Maybe you can add that comment to the commit message, then,
for the ISS-illiterate like me?
Thanks,
Dscho
> diff --git a/share/WinGit/install.iss b/share/WinGit/install.iss
> index 05d1d4b..a9162ec 100644
> --- a/share/WinGit/install.iss
> +++ b/share/WinGit/install.iss
> @@ -48,6 +48,8 @@ Name: ext\reg\shellhere; Description: Git Bash Here; Types: custom
> Name: ext\reg\guihere; Description: Git GUI Here; Types: custom
> Name: ext\cheetah; Description: Use Context Menu Plugin (git-cheetah) ; Flags: exclusive; Types: custom
> Name: assoc; Description: Associate .git* configuration files with the default text editor; Types: custom
> +Name: assoc_sh; Description: Associate .sh files to be run with bash; Types: custom
> +
I think for consistency with "Git Bash Here" an the like we should
write "Bash" strating with an upper case letter here, too.
> [Files]
> @@ -101,6 +103,15 @@ Root: HKCU; Subkey: Software\Classes\.gitmodules; ValueType: string; ValueData:
> Root: HKCU; Subkey: Software\Classes\.gitmodules; ValueType: string; ValueName: Content Type; ValueData: text/plain; Flags: createvalueifdoesntexist; Check: not IsAdminLoggedOn; Components: assoc
> Root: HKCU; Subkey: Software\Classes\.gitmodules; ValueType: string; ValueName: PerceivedType; ValueData: text; Flags: createvalueifdoesntexist; Check: not IsAdminLoggedOn; Components: assoc
>
> +Root: HKCR; Subkey: .sh; ValueType: string; ValueData: sh_auto_file; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
> +Root: HKCR; Subkey: sh_auto_file; ValueType: string; ValueData: "Shell Script"; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
> +Root: HKCR; Subkey: sh_auto_file\shell; ValueType: string; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
> +Root: HKCR; Subkey: sh_auto_file\shell\open; ValueType: string; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
> +Root: HKCR; Subkey: sh_auto_file\shell\open\command; ValueType: string; ValueData: """{app}\bin\sh.exe"" ""--login"" ""%1"" %*"; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
> +Root: HKCR; Subkey: sh_auto_file\DefaultIcon; ValueType: string; ValueData: "%SystemRoot%\System32\shell32.dll,-153"; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
> +Root: HKCR; Subkey: sh_auto_file\ShellEx; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
> +Root: HKCR; Subkey: sh_auto_file\ShellEx\DropHandler; ValueType: string; ValueData: "{86C86720-42A0-1069-A2E8-08002B30309D}"; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
> +
Hmm, several things: You're using HKCR here, which is a merged view of
"HKEY_LOCAL_MACHINE\Software\Classes" and
"HKEY_CURRENT_USER\Software\Classes". Using HKCR usually only makes
sense for read operations. For write operations, the behavior is not
so straight-forward, see [1].
The general problem with local machine vs. current user registry
settings is this: If a (power-)user installs Git for herself, it's OK
to just write to HKCU. But in a scenario where the system
administrator installs Git for all users, we need to write to HKLM.
This is why the other registry settings are all present twice: HKLM is
only written if "IsAdminLoggedOn", and HKCU is only written if "not
IsAdminLoggedOn" (see the "Check" statement). I think we should do it
the same way for the .sh association.
Moreover, you're adding a bunch unneeded stuff like the DefaultIcon
and DropHandler. IMHO the open command should be enough.
I'm about to merge ssh/uninstaller-console-font today, which makes
some improvements to the registry stuff. I'll add another commit with
comments about HKML vs. HKCU to that branch. I'd suggest to rebase
your work on devel when my branch merged.
[1] http://msdn.microsoft.com/en-us/library/ms724475%28VS.85%29.aspx
--
Sebastian Schuberth
On Thu, Nov 11, 2010 at 09:18:38AM +0100, Sebastian Schuberth wrote:
> On Wed, Nov 10, 2010 at 22:50, Heiko Voigt <hvo...@hvoigt.net> wrote:
>
> > diff --git a/share/WinGit/install.iss b/share/WinGit/install.iss
> > index 05d1d4b..a9162ec 100644
> > --- a/share/WinGit/install.iss
> > +++ b/share/WinGit/install.iss
> > @@ -48,6 +48,8 @@ Name: ext\reg\shellhere; Description: Git Bash Here; Types: custom
> > �ソスName: ext\reg\guihere; Description: Git GUI Here; Types: custom
> > �ソスName: ext\cheetah; Description: Use Context Menu Plugin (git-cheetah) ; Flags: exclusive; Types: custom
> > �ソスName: assoc; Description: Associate .git* configuration files with the default text editor; Types: custom
> > +Name: assoc_sh; Description: Associate .sh files to be run with bash; Types: custom
> > +
>
> I think for consistency with "Git Bash Here" an the like we should
> write "Bash" strating with an upper case letter here, too.
Ok will do.
> > �ソス[Files]
> > @@ -101,6 +103,15 @@ Root: HKCU; Subkey: Software\Classes\.gitmodules; ValueType: string; ValueData:
> > �ソスRoot: HKCU; Subkey: Software\Classes\.gitmodules; ValueType: string; ValueName: Content Type; ValueData: text/plain; Flags: createvalueifdoesntexist; Check: not IsAdminLoggedOn; Components: assoc
> > �ソスRoot: HKCU; Subkey: Software\Classes\.gitmodules; ValueType: string; ValueName: PerceivedType; ValueData: text; Flags: createvalueifdoesntexist; Check: not IsAdminLoggedOn; Components: assoc
> >
> > +Root: HKCR; Subkey: .sh; ValueType: string; ValueData: sh_auto_file; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
> > +Root: HKCR; Subkey: sh_auto_file; ValueType: string; ValueData: "Shell Script"; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
> > +Root: HKCR; Subkey: sh_auto_file\shell; ValueType: string; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
> > +Root: HKCR; Subkey: sh_auto_file\shell\open; ValueType: string; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
> > +Root: HKCR; Subkey: sh_auto_file\shell\open\command; ValueType: string; ValueData: """{app}\bin\sh.exe"" ""--login"" ""%1"" %*"; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
> > +Root: HKCR; Subkey: sh_auto_file\DefaultIcon; ValueType: string; ValueData: "%SystemRoot%\System32\shell32.dll,-153"; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
> > +Root: HKCR; Subkey: sh_auto_file\ShellEx; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
> > +Root: HKCR; Subkey: sh_auto_file\ShellEx\DropHandler; ValueType: string; ValueData: "{86C86720-42A0-1069-A2E8-08002B30309D}"; Flags: createvalueifdoesntexist uninsdeletekeyifempty uninsdeletevalue; Check: IsAdminLoggedOn; Components: assoc_sh
> > +
>
> Hmm, several things: You're using HKCR here, which is a merged view of
> "HKEY_LOCAL_MACHINE\Software\Classes" and
> "HKEY_CURRENT_USER\Software\Classes". Using HKCR usually only makes
> sense for read operations. For write operations, the behavior is not
> so straight-forward, see [1].
I did not know that. Working on msysGit teaches me so much about windows ;)
> The general problem with local machine vs. current user registry
> settings is this: If a (power-)user installs Git for herself, it's OK
> to just write to HKCU. But in a scenario where the system
> administrator installs Git for all users, we need to write to HKLM.
> This is why the other registry settings are all present twice: HKLM is
> only written if "IsAdminLoggedOn", and HKCU is only written if "not
> IsAdminLoggedOn" (see the "Check" statement). I think we should do it
> the same way for the .sh association.
Will change that in the next iteration.
> Moreover, you're adding a bunch unneeded stuff like the DefaultIcon
> and DropHandler. IMHO the open command should be enough.
The DropHandler is needed so you can drop files on the bash script and
they will be passed as arguments. My final goal is to make bash scripts
behave like bat scripts thats why I added the COM object of shell32.dll
which will dispatch to the open command. Its still not working perfectly
since currently the short name is passed. If you have an idea how to fix
this without the need to write our own DropHandler COM object I would be
greatful.
Same goes for the icon I added this so a bash script will show up with
the same icon as a bat script. I think this helps the user to see that
its an executable script.
I probably should extend my commit message with this information.
> I'm about to merge ssh/uninstaller-console-font today, which makes
> some improvements to the registry stuff. I'll add another commit with
> comments about HKML vs. HKCU to that branch. I'd suggest to rebase
> your work on devel when my branch merged.
Ok I will do that.
Cheers Heiko
On Thu, Nov 11, 2010 at 12:38:43AM +0100, Johannes Schindelin wrote:
> On Wed, 10 Nov 2010, Heiko Voigt wrote:
>
> > On Wed, Nov 10, 2010 at 11:21:16PM +0100, Johannes Schindelin wrote:
> > > On Wed, 10 Nov 2010, Heiko Voigt wrote:
> > >
> > > > Having bash scripts automatically run by git bash is helpful because
> > > > you can directly bash scripts from cmd.exe, via doubleclick in the
> > > > explorer or use them directly in IDEs.
> > >
> > > While in principle, I like the idea, I would like to caution against
> > > doing this without an opt-out...
> >
> > There is an opt-out. Its a checkbox in the installer like with the
> > association of the .git* files. Its checked by default though.
>
> Ah, thanks. Maybe you can add that comment to the commit message, then,
> for the ISS-illiterate like me?
Of course, I will.
Cheers Heiko
P.S.: BTW, nice to read you again.