====== Uninstall one or more versions of a msi-package/-product ====== //scripts and guide by [[marten-marcus@t-online.de | M.Marten]] 2014/10/27 18:18// ==== Information ==== === deutsch === Dies ist ein Beispiel dafür, wie alle Versionen eines Programmes, die via msiexec installiert wurden mit einer einzigen Anweisung deinstalliert werden können.\\ Hierzu wird das von mir erstellte Tool "UninstMsi.exe" verwendet. Die entsprechenden Scripte werden via 'include_insert' eingebunden.\\ Es ist nicht notwendig entsprechende Produkt GUIDs für die einzelnen Versionen zu kennen.\\ Es wird automatisch für jedes einzelne deinstallierte Produkt der ExitCode überprüft.\\ Ein "Simulationsmodus" erlaubt es, eine Deinstallationsanweisung zu testen, ohne das eine tatsächliche Deinstallation durchgeführt wird.\\ === english === This is an example of how all versions of a program that was installed via msiexec can be uninstalled with a single statement.\\ For this purpose, the tool I created "UninstMsi.exe" is used. The corresponding scripts are integrated via 'include_insert'.\\ It is not necessary to know the corresponding product guids for each version.\\ It is automatically checked for every single uninstalled the product exit code.\\ A "simulation mode" allows to test a statement uninstall without having an actual uninstallation is performed.\\ ==== Download ==== Ein Zip-File mit allen benötigten Dateien kann [[http://goo.gl/ewobdX | hier]] herunter geladen werden.\\ Alle Interessierten am Quellcode vom Tool "UninstMsi" finden diesen [[http://goo.gl/HtshWu | hier]]. A zip file containing all necessary files can be downloaded [[http://goo.gl/ewobdX | here]].\\ All those interested in the source code by the tool "UninstMsi" find it [[http://goo.gl/HtshWu | here]]. \\ \\ ==== Tree ==== CLIENT_DATA ├ delsub.ins ├ insert_uninstmsi.opsiinc ├ sections_uninstmsi.opsiinc ├ uninstall.ins └ UninstMsi.exe ==== uninstall.ins ==== [Initial] SetLogLevel=6 ExitOnError=false ScriptErrorMessages=true TraceMode=false StayOnTop=false [Actions] requiredWinstVersion >= "4.11.3" ;include the required UninstMsi Sections include_insert "insert_uninstmsi.opsiinc" ShowBitmap "%scriptpath%\java.png" "Java JRE" if FileExists("%ScriptPath%\delsub.ins") comment "start uninstall" sub "%ScriptPath%\delsub.ins" endif ==== delsub.ins ==== ; only for fully silent uninstall ;set $UninstMsi_Options$ = "/silent" ; only for the testing without real uninstall ;set $UninstMsi_Options$ = "/simulate" ; $UninstMsi_SearchString$ = the name of the product / products that you want to uninstall ; Use SQL wildcards ( "%" "_" "[abc]" "[a-c]" ) if you want to uninstall a number of similar products (-versions), ; or if you do not know the exact product name. ; More information about using SQL wildcards under: http://www.w3schools.com/sql/sql_wildcards.asp ; You can "UninstMsi.exe" also stand-alone start to test your search term first Message "remove all Java JRE 6/7/8 versions are found ..." set $UninstMsi_SearchString$ = "Java%[6-8] Update%" ; start uninstall & exitcode check Sub_Run_UninstMsi