zandztrom Posted September 30, 2005 Share Posted September 30, 2005 Hi I'm curious about how i should write the code for checking for the unique applicationkey in uninstall, and if it exist remove it by running msiexec /x. Does someone know how to do this? I was thinkig something like the simplified example below(I understand I have to use RegRead() or something but I don't know how to practically do the whole thing) If exsist(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{E32FC3D8-D106-425E-9F9E-8BE6E2E79AC9}) then RunWait('msiexec.exe /i "{E32FC3D8-D106-425E-9F9E-8BE6E2E79AC9}" /qb', @SystemDir)End IfRunWait('msiexec.exe /i "Appl.msi" transforms="appl.mst" /qb', @SystemDir)And son Link to comment Share on other sites More sharing options...
GaryFrost Posted September 30, 2005 Share Posted September 30, 2005 (edited) one example would be: $key = ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{E32FC3D8-D106-425E-9F9E-8BE6E2E79AC9}","DisplayName") If Not @error Then RunWait('msiexec.exe /i "{E32FC3D8-D106-425E-9F9E-8BE6E2E79AC9}" /qb', @SystemDir) EndIf RunWait('msiexec.exe /i "Appl.msi" transforms="appl.mst" /qb', @SystemDir) or if you prefer you check the length of $key for example if StringLen($key) > 0 then Edited September 30, 2005 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
zandztrom Posted September 30, 2005 Author Share Posted September 30, 2005 one example would be:$key = ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{E32FC3D8-D106-425E-9F9E-8BE6E2E79AC9}","DisplayName")If Not @error Then RunWait('msiexec.exe /i "{E32FC3D8-D106-425E-9F9E-8BE6E2E79AC9}" /qb', @SystemDir)EndIfRunWait('msiexec.exe /i "Appl.msi" transforms="appl.mst" /qb', @SystemDir)or if you prefer you check the length of $key for exampleif StringLen($key) > 0 thenThank's a lot for the reply, I will try that asap...Best Regards/Fred Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now