all im trying to do is check if the registry key {F060A75A-9D6E-46F5-AAAA-7B513F4F44FB} is present then delete it
the action fails instantly after running nothing, the lines below are half way through the action script and the line that fails is the if{… line
Failed
if {exists value “UninstallString” of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{{F060A75A-9D6E-46F5-AAAA-7B513F4F44FB}” of registry}
if {exists value “UninstallString” of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{F060A75A-9D6E-46F5-AAAA-7B513F4F44FB}}” of native registry}
if {exists value “UninstallString” of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{F060A75A-9D6E-46F5-AAAA-7B513F4F44FB}}” of native registry}
wait REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{F060A75A-9D6E-46F5-AAAA-7B513F4F44FB} /f
endif
I’m not sure if there needs to be a second } before the /f
Still fails on the IF{… LINE ??
Failed if {exists value “UninstallString” of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{F060A75A-9D6E-46F5-AAAA-7B513F4F44FB}}” of native registry}
You have to use double “{{” at the start of the GUID (single “}” at the end).
if {exists value "UninstallString" of key "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{{F060A75A-9D6E-46F5-AAAA-7B513F4F44FB}}" of native registry}
wait REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{{F060A75A-9D6E-46F5-AAAA-7B513F4F44FB} /f
endif
This is part of how i’m uninstalling Patchlink, since the uninstall cant be run silently I have to rip it out manually
this is the whole thing,
wait sc config
"Patchlink Update" start= demand wait instsrv
"Patchlink Update" REMOVE
if
{exists key
"HKLM\SOFTWARE\PatchLink" of registry
} wait REG DELETE HKLM\SOFTWARE\PatchLink /f endif
if
{exists key
"HKLM\SOFTWARE\PatchLink.com" of registry
} wait REG DELETE HKLM\SOFTWARE\PatchLink.com /f endif
if
{exists key
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{{F060A75A-9D6E-46F5-A9E6-7B513F4F44FB}" of
native registry
} wait REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
{
{F060A75A-9D6E-46F5-A9E6-7B513F4F44FB
} /f endif
if
{exists value
"PDDM" of key
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" of registry
} REGDELETE
"[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]"
"PDDM" endif wait
{(pathname of client folder of site
"BESSupport" &
"\taskkill.exe /f ") & (
if (name of operating system =
"WinXP" OR name of operating system =
"Win2003") then
" /im PDDM.EXE"
else
"PDDM.EXE")
} DOS rmdir /S /Q
{name of drive of windows folder
}\Program Files\PatchLink
In order to get the {} that enclose the Relevance to operate correctly, you might want to try replacing the {} that are part of the GUID with %7B and %7D. The statement would look like this:
if {exists key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall%7BF060A75A-9D6E-46F5-A9E6-7B513F4F44FB%7D” of native registry}
I rewrote it to write a .reg file and it worked fine
and of cource before this I check and depoy if nessessary “SC.EXE” on windows 2000 and “instsrv”
Here is the Finished Task to uninstall (rip out) Patchlink
if
{exists service
"Patchlink Update"
} wait sc config
"Patchlink Update" start= demand wait instsrv
"Patchlink Update" REMOVE endif delete __createfile delete CleanPatchlink.reg createfile until __EOF Windows Registry Editor Version 5.00 [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
{
{F060A75A-9D6E-46F5-A9E6-7B513F4F44FB
}] [-HKEY_LOCAL_MACHINE\SOFTWARE\PatchLink.com] [-HKEY_LOCAL_MACHINE\SOFTWARE\PatchLink] __EOF move __createfile CleanPatchlink.reg waithidden regedit /s CleanPatchlink.reg
if
{exists value
"PDDM" of key
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" of registry
} REGDELETE
"[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]"
"PDDM" endif wait
{(pathname of client folder of site
"BESSupport" &
"\taskkill.exe /f ") & (
if (name of operating system =
"WinXP" OR name of operating system =
"Win2003") then
" /im pddm.exe"
else
"pddm.exe")
} dos cmd /c rd /q /s
"{name of drive of windows folder}\Program Files\PatchLink"
I was never able to silently uninstall Patchlink, I had to rip it out with this method
if
{exists service
"Patchlink Update"
} wait sc config
"Patchlink Update" start= demand wait instsrv
"Patchlink Update" REMOVE endif delete __createfile delete CleanPatchlink.reg createfile until __EOF Windows Registry Editor Version 5.00 [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
{
{F060A75A-9D6E-46F5-A9E6-7B513F4F44FB
}] [-HKEY_LOCAL_MACHINE\SOFTWARE\PatchLink.com] [-HKEY_LOCAL_MACHINE\SOFTWARE\PatchLink] __EOF move __createfile CleanPatchlink.reg waithidden regedit /s CleanPatchlink.reg
if
{exists value
"PDDM" of key
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" of registry
} REGDELETE
"[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]"
"PDDM" endif wait
{(pathname of client folder of site
"BESSupport" &
"\taskkill.exe /f ") & (
if (name of operating system =
"WinXP" OR name of operating system =
"Win2003") then
" /im pddm.exe"
else
"pddm.exe")
} dos cmd /c rd /q /s
"{name of drive of windows folder}\Program Files\PatchLink"