[cheetah] [PATCH] Add ability to install for the current user only

33 views
Skip to first unread message

Kirill

unread,
Jan 24, 2008, 10:42:12 PM1/24/08
to msysGit
They may be useful if the installation is allowed for users without
Administrator privileges.

In addition, the following two might be interesting as per "Debugging
with the Shell" on MSDN:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
DesktopProcess= 1

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\
AlwaysUnloadDll]
---
Makefile | 13 +++++++++++
install-user.reg.in | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++
systeminfo.c | 6 +++++
uninstall-user.reg | 27 +++++++++++++++++++++++
4 files changed, 104 insertions(+), 0 deletions(-)
create mode 100644 install-user.reg.in
create mode 100644 uninstall-user.reg

diff --git a/Makefile b/Makefile
index 6c5d576..0513fec 100644
--- a/Makefile
+++ b/Makefile
@@ -27,14 +27,27 @@ install: all install.reg
regsvr32 -s git_shell_ext.dll
regedit -s install.reg

+install-user: all install-user.reg
+ regsvr32 -s git_shell_ext.dll
+ regedit -s install.reg
+
uninstall:
regsvr32 -u -s git_shell_ext.dll
regedit -s uninstall.reg

+uninstall-user:
+ regsvr32 -u -s git_shell_ext.dll
+ regedit -s uninstall-user.reg
+
install.reg: install.reg.in Makefile
sed < $< > $@ \
-e 's|@@MSYSGIT_PATH@@|$(MSYSGIT_PATH)|' \
-e 's|@@DLL_PATH@@|$(DLL_PATH)|'

+install-user.reg: install-user.reg.in Makefile
+ sed < $< > $@ \
+ -e 's|@@MSYSGIT_PATH@@|$(MSYSGIT_PATH)|' \
+ -e 's|@@DLL_PATH@@|$(DLL_PATH)|'
+
clean:
-rm -f $(OBJECTS) $(TARGET)
diff --git a/install-user.reg.in b/install-user.reg.in
new file mode 100644
index 0000000..8231510
--- /dev/null
+++ b/install-user.reg.in
@@ -0,0 +1,58 @@
+Windows Registry Editor Version 5.00
+
+; This registry file creates neccessary entries for installation.
+; **** If you change this file, keep uninstall.reg in sync! ****
+;
+; This file is slated for being generated and not hard-coded.
+
+[HKEY_CURRENT_USER\SOFTWARE\Git-Cheetah]
+
+[HKEY_CURRENT_USER\SOFTWARE\Git-Cheetah]
+"PathToMsys"="@@MSYSGIT_PATH@@"
+
+[HKEY_CURRENT_USER\Software\Classes\CLSID\{ca586c80-7c84-4b88-8537-726724df6929}]
+
+[HKEY_CURRENT_USER\Software\Classes\CLSID\{ca586c80-7c84-4b88-8537-726724df6929}]
+@="Git-Cheetah"
+
+[HKEY_CURRENT_USER\Software\Classes\CLSID\{ca586c80-7c84-4b88-8537-726724df6929}\InProcServer32]
+@="@@DLL_PATH@@"
+
+[HKEY_CURRENT_USER\Software\Classes\CLSID\{ca586c80-7c84-4b88-8537-726724df6929}\InProcServer32]
+"ThreadingModel"="Apartment"
+
+[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell
Extensions\Approved]
+"{ca586c80-7c84-4b88-8537-726724df6929}"="Git-Cheetah"
+
+[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell
Extensions\Approved\{ca586c80-7c84-4b88-8537-726724df6929}]
+@="Git-Cheetah"
+
+[HKEY_CURRENT_USER\Software\Classes\*\shellex\ContextMenuHandlers\Git-Cheetah]
+
+[HKEY_CURRENT_USER\Software\Classes\*\shellex\ContextMenuHandlers\Git-Cheetah]
+@="{ca586c80-7c84-4b88-8537-726724df6929}"
+
+[HKEY_CURRENT_USER\Software\Classes\Directory\shellex\ContextMenuHandlers\Git-Cheetah]
+
+[HKEY_CURRENT_USER\Software\Classes\Directory\shellex\ContextMenuHandlers\Git-Cheetah]
+@="{ca586c80-7c84-4b88-8537-726724df6929}"
+
+[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shellex\ContextMenuHandlers\Git-Cheetah]
+
+[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shellex\ContextMenuHandlers\Git-Cheetah]
+@="{ca586c80-7c84-4b88-8537-726724df6929}"
+
+[HKEY_CURRENT_USER\Software\Classes\Drive\shellex\ContextMenuHandlers\Git-Cheetah]
+
+[HKEY_CURRENT_USER\Software\Classes\Drive\shellex\ContextMenuHandlers\Git-Cheetah]
+@="{ca586c80-7c84-4b88-8537-726724df6929}"
+
+[HKEY_CURRENT_USER\Software\Classes\Folder\shellex\ContextMenuHandlers\Git-Cheetah]
+
+[HKEY_CURRENT_USER\Software\Classes\Folder\shellex\ContextMenuHandlers\Git-Cheetah]
+@="{ca586c80-7c84-4b88-8537-726724df6929}"
+
+[HKEY_CURRENT_USER\Software\Classes\InternetShortcut\shellex\ContextMenuHandlers\Git-Cheetah]
+
+[HKEY_CURRENT_USER\Software\Classes\InternetShortcut\shellex\ContextMenuHandlers\Git-Cheetah]
+@="{ca586c80-7c84-4b88-8537-726724df6929}"
diff --git a/systeminfo.c b/systeminfo.c
index 08429bf..388faf3 100644
--- a/systeminfo.c
+++ b/systeminfo.c
@@ -16,6 +16,12 @@ TCHAR * msys_path(void)
lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
TEXT(GIT_CHEETAH_REG_PATH),
0, KEY_QUERY_VALUE, &hKey);
+
+ /* If we failed to find it in the machine-wide, try current user */
+ if (ERROR_SUCCESS != lRet)
+ lRet = RegOpenKeyEx(HKEY_CURRENT_USER,
+ TEXT(GIT_CHEETAH_REG_PATH),
+ 0, KEY_QUERY_VALUE, &hKey);

if (lRet == ERROR_SUCCESS)
{
diff --git a/uninstall-user.reg b/uninstall-user.reg
new file mode 100644
index 0000000..4d69f3f
--- /dev/null
+++ b/uninstall-user.reg
@@ -0,0 +1,27 @@
+Windows Registry Editor Version 5.00
+
+; This registry file creates neccessary entries for uninstallation.
+; **** If you change this file, keep install.reg in sync! ****
+;
+; This file is slated for being generated and not hard-coded.
+
+[-HKEY_CURRENT_USER\SOFTWARE\Git-Cheetah]
+
+[-HKEY_CURRENT_USER\Software\Classes\CLSID\{ca586c80-7c84-4b88-8537-726724df6929}]
+
+[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell
Extensions\Approved]
+"{ca586c80-7c84-4b88-8537-726724df6929}"=-
+
+[-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell
Extensions\Approved\{ca586c80-7c84-4b88-8537-726724df6929}]
+
+[-HKEY_CURRENT_USER\Software\Classes\*\shellex\ContextMenuHandlers\Git-Cheetah]
+
+[-HKEY_CURRENT_USER\Software\Classes\Directory\shellex\ContextMenuHandlers\Git-Cheetah]
+
+[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shellex\ContextMenuHandlers\Git-Cheetah]
+
+[-HKEY_CURRENT_USER\Software\Classes\Drive\shellex\ContextMenuHandlers\Git-Cheetah]
+
+[-HKEY_CURRENT_USER\Software\Classes\Folder\shellex\ContextMenuHandlers\Git-Cheetah]
+
+[-HKEY_CURRENT_USER\Software\Classes\InternetShortcut\shellex\ContextMenuHandlers\Git-Cheetah]
--
1.5.4.rc0.929.g50e2

Johannes Schindelin

unread,
Jan 25, 2008, 6:32:18 AM1/25/08
to Kirill, msysGit
Hi,

On Thu, 24 Jan 2008, Kirill wrote:

> They may be useful if the installation is allowed for users without
> Administrator privileges.

Nice.

> In addition, the following two might be interesting as per "Debugging
> with the Shell" on MSDN:
> [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
> DesktopProcess= 1
>
> [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\
> AlwaysUnloadDll]

Could you just implement that as a follow-up patch (and not put it into
this commit message)?

> +install-user: all install-user.reg
> + regsvr32 -s git_shell_ext.dll
> + regedit -s install.reg

Certainly, you meant "install-user.reg" here, right? It would be even
easier if you wrote it like this:

install-user: install-user.reg all
regsvr32 -s $(TARGET)
regedit -s $<

> install.reg: install.reg.in Makefile
> sed < $< > $@ \
> -e 's|@@MSYSGIT_PATH@@|$(MSYSGIT_PATH)|' \
> -e 's|@@DLL_PATH@@|$(DLL_PATH)|'
>
> +install-user.reg: install-user.reg.in Makefile
> + sed < $< > $@ \
> + -e 's|@@MSYSGIT_PATH@@|$(MSYSGIT_PATH)|' \
> + -e 's|@@DLL_PATH@@|$(DLL_PATH)|'

How about just unifying them?

%.reg: %.reg.in Makefile


sed < $< > $@ \
-e 's|@@MSYSGIT_PATH@@|$(MSYSGIT_PATH)|' \
-e 's|@@DLL_PATH@@|$(DLL_PATH)|'

> diff --git a/systeminfo.c b/systeminfo.c


> index 08429bf..388faf3 100644
> --- a/systeminfo.c
> +++ b/systeminfo.c
> @@ -16,6 +16,12 @@ TCHAR * msys_path(void)
> lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
> TEXT(GIT_CHEETAH_REG_PATH),
> 0, KEY_QUERY_VALUE, &hKey);
> +
> + /* If we failed to find it in the machine-wide, try current user */
> + if (ERROR_SUCCESS != lRet)
> + lRet = RegOpenKeyEx(HKEY_CURRENT_USER,
> + TEXT(GIT_CHEETAH_REG_PATH),
> + 0, KEY_QUERY_VALUE, &hKey);

Hmm. I could imagine that the user-specific setting should override the
system-wide setting, i.e. the order should be switched around...

Thanks,
Dscho

Kirill

unread,
Jan 25, 2008, 7:52:54 AM1/25/08
to Johannes Schindelin, msysGit
Dscho,

On Jan 25, 2008 6:32 AM, Johannes Schindelin <Johannes....@gmx.de> wrote:
> On Thu, 24 Jan 2008, Kirill wrote:
> > In addition, the following two might be interesting as per "Debugging
> > with the Shell" on MSDN:
> > [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
> > DesktopProcess= 1
> >
> > [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\
> > AlwaysUnloadDll]
>
> Could you just implement that as a follow-up patch (and not put it into
> this commit message)?

I've removed them from this commit message, but not sure how to add
them as a separate patch. The problem is they are useful only for
developers while debugging. You don't want to add them as part of the
production installation. It feels weird to have yet another pair of
targets, e.g. ease-debugging and ease-debugging-user (the
AlwaysUnloadDll works in the user space as well).

--
Kirill.

Johannes Schindelin

unread,
Jan 25, 2008, 8:42:54 AM1/25/08
to Kirill, msysGit
Hi,

On Fri, 25 Jan 2008, Kirill wrote:

> On Jan 25, 2008 6:32 AM, Johannes Schindelin
> <Johannes....@gmx.de> wrote:
>
> > On Thu, 24 Jan 2008, Kirill wrote:
> >
> > > In addition, the following two might be interesting as per
> > > "Debugging with the Shell" on MSDN:
> > >
> > > [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
> > > DesktopProcess= 1
> > >
> > > [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\
> > > AlwaysUnloadDll]
> >
> > Could you just implement that as a follow-up patch (and not put it
> > into this commit message)?
>
> I've removed them from this commit message, but not sure how to add them
> as a separate patch. The problem is they are useful only for developers
> while debugging.

Exactly. And as we are catering for developers ATM, that should be an
important detail. IIUC this patch would make 89383fe8(Add a simple script
to kill and restart explorer and task manager) obsolete? If it does, we
might revert that commit, mentioning that your patch is the reason.

> You don't want to add them as part of the production installation. It
> feels weird to have yet another pair of targets, e.g. ease-debugging and
> ease-debugging-user (the AlwaysUnloadDll works in the user space as
> well).

How about a new target "load":

load: load.reg
regsvr32 -s $(TARGET)
regedit -s $@

load.reg: install-user.reg WINREG=HKEY_CURRENT_USER\Software\Microsoft\Windows
cp $< $@
echo '' >> $@
echo '[$(WINREG)\CurrentVersion\Explorer]' >> $@
echo '"DesktopProcess"="1"' >> $@
echo '' >> $@
echo '[$(WINREG)\CurrentVersion\Explorer\AlwaysUnloadDll]' >> $@

And a similar one for "unload"?

Ciao,
Dscho

Kirill

unread,
Jan 27, 2008, 10:07:50 AM1/27/08
to Johannes Schindelin, msysGit
They may be useful if the installation is allowed for users without
Administrator privileges.
---
Makefile | 21 +++++++++++++++++----
install.reg.in | 23 ++++++++---------------
systeminfo.c | 33 +++++++++++++++++++++++----------
uninstall-user.reg | 27 +++++++++++++++++++++++++++
4 files changed, 75 insertions(+), 29 deletions(-)
create mode 100644 uninstall-user.reg

diff --git a/Makefile b/Makefile
index 6c5d576..e24989a 100644
--- a/Makefile
+++ b/Makefile
@@ -23,18 +23,31 @@ factory.o: factory.h ext.h menu.h
menu.o: menu.h ext.h debug.h systeminfo.h
systeminfo.o: systeminfo.h

-install: all install.reg
- regsvr32 -s git_shell_ext.dll
- regedit -s install.reg
+install: install.reg all
+ regsvr32 -s $(DLL_PATH)
+ regedit -s $<
+
+install-user: install-user.reg all
+ regsvr32 -s $(DLL_PATH)
+ regedit -s $<

uninstall:
- regsvr32 -u -s git_shell_ext.dll
+ regsvr32 -u -s $(DLL_PATH)
regedit -s uninstall.reg

+uninstall-user:
+ regsvr32 -u -s $(DLL_PATH)


+ regedit -s uninstall-user.reg
+

install.reg: install.reg.in Makefile
sed < $< > $@ \
-e 's|@@MSYSGIT_PATH@@|$(MSYSGIT_PATH)|' \
-e 's|@@DLL_PATH@@|$(DLL_PATH)|'

+install-user.reg: install.reg
+ sed < $< > $@ \
+ -e 's|\[HKEY_LOCAL_MACHINE\\|\[HKEY_CURRENT_USER\\|' \
+ -e 's|\[HKEY_CLASSES_ROOT\\|\[HKEY_CURRENT_USER\\Software\\Classes\\|'


+
clean:
-rm -f $(OBJECTS) $(TARGET)

diff --git a/install.reg.in b/install.reg.in
index 79195f4..2eb8f13 100644
--- a/install.reg.in
+++ b/install.reg.in
@@ -10,6 +10,12 @@ Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Git-Cheetah]
"PathToMsys"="@@MSYSGIT_PATH@@"

+[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell


Extensions\Approved]
+"{ca586c80-7c84-4b88-8537-726724df6929}"="Git-Cheetah"
+

+[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell


Extensions\Approved\{ca586c80-7c84-4b88-8537-726724df6929}]
+@="Git-Cheetah"
+

[HKEY_CLASSES_ROOT\CLSID\{ca586c80-7c84-4b88-8537-726724df6929}]

[HKEY_CLASSES_ROOT\CLSID\{ca586c80-7c84-4b88-8537-726724df6929}]
@@ -21,12 +27,9 @@ Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{ca586c80-7c84-4b88-8537-726724df6929}\InProcServer32]
"ThreadingModel"="Apartment"

-[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell
Extensions\Approved]
-"{ca586c80-7c84-4b88-8537-726724df6929}"="Git-Cheetah"
-
-[HKEY_CLASSES_ROOT\txtfile\shellex\ContextMenuHandlers\Git-Cheetah]
+[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Git-Cheetah]

-[HKEY_CLASSES_ROOT\txtfile\shellex\ContextMenuHandlers\Git-Cheetah]
+[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Git-Cheetah]
@="{ca586c80-7c84-4b88-8537-726724df6929}"

[HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\Git-Cheetah]
@@ -49,17 +52,7 @@ Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers\Git-Cheetah]
@="{ca586c80-7c84-4b88-8537-726724df6929}"

-[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Git-Cheetah]
-
-[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Git-Cheetah]
-@="{ca586c80-7c84-4b88-8537-726724df6929}"
-
[HKEY_CLASSES_ROOT\InternetShortcut\shellex\ContextMenuHandlers\Git-Cheetah]

[HKEY_CLASSES_ROOT\InternetShortcut\shellex\ContextMenuHandlers\Git-Cheetah]
@="{ca586c80-7c84-4b88-8537-726724df6929}"
-
-[HKEY_CLASSES_ROOT\lnkfile\shellex\ContextMenuHandlers\Git-Cheetah]
-
-[HKEY_CLASSES_ROOT\lnkfile\shellex\ContextMenuHandlers\Git-Cheetah]
-@="{ca586c80-7c84-4b88-8537-726724df6929}"
diff --git a/systeminfo.c b/systeminfo.c
index 08429bf..07444d6 100644
--- a/systeminfo.c
+++ b/systeminfo.c
@@ -8,32 +8,45 @@ TCHAR * msys_path(void)
static int found_path = 0;
HKEY hKey;
LONG lRet;
+ DWORD msysPathLen = MAX_PATH * sizeof(TCHAR);

/* Only bother to get it once. */
if (found_path)
return msysPath;

- lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+ /* try to find user-specific settings first */
+ lRet = RegOpenKeyEx(HKEY_CURRENT_USER,
TEXT(GIT_CHEETAH_REG_PATH),
0, KEY_QUERY_VALUE, &hKey);
-
- if (lRet == ERROR_SUCCESS)
- {
- DWORD msysPathLen = MAX_PATH * sizeof(TCHAR);
-
+ if (ERROR_SUCCESS == lRet) {
lRet = RegQueryValueEx(hKey,
TEXT(GIT_CHEETAH_REG_PATHTOMSYS),
NULL, NULL,
(LPBYTE)msysPath,
&msysPathLen);
RegCloseKey(hKey);
+ }

- if (lRet == ERROR_SUCCESS)
- {
- found_path = 1;
- return msysPath;
+ /* if current user does not have the path, try machine-wide */


+ if (ERROR_SUCCESS != lRet) {

+ lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE,


+ TEXT(GIT_CHEETAH_REG_PATH),
+ 0, KEY_QUERY_VALUE, &hKey);

+ if (ERROR_SUCCESS == lRet) {
+ lRet = RegQueryValueEx(hKey,
+ TEXT(GIT_CHEETAH_REG_PATHTOMSYS),
+ NULL, NULL,
+ (LPBYTE)msysPath,
+ &msysPathLen);
+ RegCloseKey(hKey);
}
}
+
+ if (lRet == ERROR_SUCCESS)
+ {
+ found_path = 1;
+ return msysPath;
+ }

return NULL;

Johannes Schindelin

unread,
Jan 27, 2008, 10:40:02 AM1/27/08
to Kirill, msysGit
Hi,

Except for this part (like I said, I'd like it refactored into a helper
function), I like your patch.

Ciao,
Dscho

Kirill

unread,
Jan 27, 2008, 2:28:52 PM1/27/08
to Johannes Schindelin, msysGit
They may be useful if the installation is allowed for users without
Administrator privileges.
---
Makefile | 17 +++++++++++------
install.reg.in | 23 ++++++++---------------
systeminfo.c | 50 +++++++++++++++++++++++++++-----------------------
uninstall.reg | 12 +++++-------
4 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/Makefile b/Makefile
index 6c5d576..4042879 100644
--- a/Makefile
+++ b/Makefile
@@ -23,18 +23,23 @@ factory.o: factory.h ext.h menu.h


menu.o: menu.h ext.h debug.h systeminfo.h
systeminfo.o: systeminfo.h

-install: all install.reg
- regsvr32 -s git_shell_ext.dll
- regedit -s install.reg

+inst%: inst%.reg all


+ regsvr32 -s $(DLL_PATH)
+ regedit -s $<

-uninstall:


- regsvr32 -u -s git_shell_ext.dll

- regedit -s uninstall.reg
+uninst%: uninst%.reg


+ regsvr32 -u -s $(DLL_PATH)

+ regedit -s $<



install.reg: install.reg.in Makefile
sed < $< > $@ \
-e 's|@@MSYSGIT_PATH@@|$(MSYSGIT_PATH)|' \
-e 's|@@DLL_PATH@@|$(DLL_PATH)|'

+%-user.reg: %.reg

diff --git a/systeminfo.c b/systeminfo.c
index 08429bf..2b046df 100644
--- a/systeminfo.c
+++ b/systeminfo.c
@@ -3,37 +3,41 @@

static TCHAR msysPath[MAX_PATH];

+static int get_msys_path_from_registry (HKEY root) {
+ HKEY key;
+ DWORD path_len = sizeof (msysPath);
+
+ LONG result = RegOpenKeyEx(root, GIT_CHEETAH_REG_PATH,
+ 0, KEY_QUERY_VALUE, &key);
+ if (ERROR_SUCCESS != result)
+ return 0;
+
+ result = RegQueryValueEx(key,
+ GIT_CHEETAH_REG_PATHTOMSYS,
+ NULL, NULL, (LPBYTE)msysPath, &path_len);
+
+ RegCloseKey(key);
+
+ return ERROR_SUCCESS == result;
+}
+


TCHAR * msys_path(void)
{
static int found_path = 0;

- HKEY hKey;
- LONG lRet;



/* Only bother to get it once. */
if (found_path)
return msysPath;

- lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE,

- TEXT(GIT_CHEETAH_REG_PATH),
- 0, KEY_QUERY_VALUE, &hKey);


-
- if (lRet == ERROR_SUCCESS)
- {
- DWORD msysPathLen = MAX_PATH * sizeof(TCHAR);
-

- lRet = RegQueryValueEx(hKey,
- TEXT(GIT_CHEETAH_REG_PATHTOMSYS),
- NULL, NULL,
- (LPBYTE)msysPath,
- &msysPathLen);
- RegCloseKey(hKey);


-
- if (lRet == ERROR_SUCCESS)
- {

- found_path = 1;
- return msysPath;

- }
- }


+ /* try to find user-specific settings first */

+ found_path = get_msys_path_from_registry (HKEY_CURRENT_USER);
+
+ /* if not found in user settings, try machine-wide */
+ if (! found_path)
+ found_path = get_msys_path_from_registry
(HKEY_LOCAL_MACHINE);
+
+ if (found_path)
+ return msysPath;

return NULL;
}
diff --git a/uninstall.reg b/uninstall.reg
index 20100a8..bd33685 100644
--- a/uninstall.reg
+++ b/uninstall.reg
@@ -7,12 +7,14 @@ Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINE\SOFTWARE\Git-Cheetah]

-[-HKEY_CLASSES_ROOT\CLSID\{ca586c80-7c84-4b88-8537-726724df6929}]


-
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell
Extensions\Approved]

"{ca586c80-7c84-4b88-8537-726724df6929}"=-

-[-HKEY_CLASSES_ROOT\txtfile\shellex\ContextMenuHandlers\Git-Cheetah]
+[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell
Extensions\Approved\{ca586c80-7c84-4b88-8537-726724df6929}]
+
+[-HKEY_CLASSES_ROOT\CLSID\{ca586c80-7c84-4b88-8537-726724df6929}]
+
+[-HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Git-Cheetah]

[-HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\Git-Cheetah]

@@ -22,8 +24,4 @@ Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers\Git-Cheetah]

-[-HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Git-Cheetah]
-

[-HKEY_CLASSES_ROOT\InternetShortcut\shellex\ContextMenuHandlers\Git-Cheetah
]
-
-[-HKEY_CLASSES_ROOT\lnkfile\shellex\ContextMenuHandlers\Git-Cheetah]
\ No newline at end of file
--
1.5.4.rc0.929.g50e2


Johannes Schindelin

unread,
Jan 27, 2008, 3:41:33 PM1/27/08
to Kirill, msysGit
Hi,

On Sun, 27 Jan 2008, Kirill wrote:

> They may be useful if the installation is allowed for users without
> Administrator privileges.

Thanks! Applied.

Ciao,
Dscho

Kirill

unread,
Jan 27, 2008, 4:20:45 PM1/27/08
to Johannes Schindelin, msysGit
Dscho,

in my humble opinion, we can just provide a reg file and don't incorporate
it into the Makefile. The main reason is that this change to the registry is
one-in-a-lifetime deal (unless we find an awful slow down of Explorer). So,
do you really want to modify the Makefile?

Thanks!

--
Kirill.

Johannes Schindelin

unread,
Jan 27, 2008, 5:57:42 PM1/27/08
to Kirill, msysGit
Hi,

On Sun, 27 Jan 2008, Kirill wrote:

> in my humble opinion, we can just provide a reg file and don't
> incorporate it into the Makefile. The main reason is that this change to
> the registry is one-in-a-lifetime deal (unless we find an awful slow
> down of Explorer). So, do you really want to modify the Makefile?

Well, from time to time I want to test the end result. Besides, having it
in the Makefile should make it much easier for other people to start
hacking on cheetah.

Ciao,
Dscho

Reply all
Reply to author
Forward
0 new messages