Hi all,

Is there someone around here who can give me a clue or two how I can
get further with my code?
After I made a batch file that cleans up after BOINC its uninstaller
(see http://boincfaq.mundayweb.com/resources/clean_util/BOINC_Cleaner_V1.zip),
I am now trying to upgrade it so it also uninstalls BOINC.

For this I need to find the correct ModifyPath value in one of the
subkeys of 
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall,
subtract the path therein and then I can use that to start the
uninstaller. I know how to do all that, but I cannot figure out how to
extract the ModifyPath value from the correct registry key.

Here's what I have so far which does half of what I want. Remember,
for the moment I only want it to store the value of the ModifyPath
key.

rem @ECHO OFF

setlocal ENABLEEXTENSIONS
set 
KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
set VNAME=DisplayName
set NEED=BOINC
set VS=ModifyPath

:MAIN
FOR /F "tokens=1-5 delims=       " %%A IN ('REG QUERY
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\')
DO (
Set TVAL=%%A

FOR /F "tokens=1-3 delims=       " %%A IN ('REG QUERY %TVAL% /v ModifyPath') DO 
(
Set NVAL=%%A
Set PVAL=%%B
Set VVAL=%%C

)
)

Preferably I only want to store the subkeys of
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
first and search them individually for the string and value I need. At
this moment it searches immediately within them as well, so for
instance

%%A = 
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1234-TYB}\
gets stored to TVAL, yet the moment I try to look in TVAL only, the
search is already checking
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AppPath
... and I get an invalid registry key error.

That error is correct, as the correct path would be
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1234-TYB}\
and then the string AppPath (not part of this actual key).

So, how do I store
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1234-TYB}
to TVAL and then search its contents, before going to the next subkey
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2345-TYB},
search through that... etc.  ??

I don't know the exact key in which I can find the path... plus it
changes with every BOINC installation.
I can't just forgo the correct path and just do MSIExec /uninstall
/quiet BOINC.msi, as I need the correct directory here as well. Plus
for a lot of us who update their BOINC regularly, there are a lot of
BOINC.msi instances on our drives. Only the last one used can be used
to uninstall the present BOINC with.

Reminds me... I'll have to edit the version 1 cleaner to delete the
BOINC.msi file as well. ;-)
-- 
-- Jord.
_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.

Reply via email to