Removing MSI packages with MSI related functions: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
Dandaman32 (talk | contribs) (Updated strings to be a little more one-size-fits-all and not text-speak; recategorized page.) |
|||
Line 1: | Line 1: | ||
{{PageAuthor|MathiasSimmack}} | {{PageAuthor|MathiasSimmack}} | ||
== Description == | <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">== Description == This is an extension to [[Uninstalling a previous MSI (Windows installer package)]].</span> == ОпиÑание == Ðто раÑширение [[Удаление предыдущей MSI (Windows Installer пакет)]].</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">It's another version to remove an installed MSI product.</span> Ðто Ð´Ñ€ÑƒÐ³Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ Ð´Ð»Ñ ÑƒÐ´Ð°Ð»ÐµÐ½Ð¸Ñ ÑƒÑтановленных продуктов MSI.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">I wrote a simple function and a few symbols:</span> Я напиÑал проÑтую функцию и неÑколько Ñимволов:</span> | ||
This is an extension to [[Uninstalling a previous MSI (Windows installer package)]]. It's another version to remove an installed MSI product. I wrote a simple function and a few symbols: | |||
== How To Use == | == How To Use == |
Revision as of 09:19, 17 October 2009
Author: MathiasSimmack (talk, contrib) |
== Description == This is an extension to Uninstalling a previous MSI (Windows installer package). == ОпиÑание == Ðто раÑширение Удаление предыдущей MSI (Windows Installer пакет). It's another version to remove an installed MSI product. Ðто Ð´Ñ€ÑƒÐ³Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ Ð´Ð»Ñ ÑƒÐ´Ð°Ð»ÐµÐ½Ð¸Ñ ÑƒÑтановленных продуктов MSI. I wrote a simple function and a few symbols: Я напиÑал проÑтую функцию и неÑколько Ñимволов:
How To Use
What you need is the ProductID (ProductCode) of your previous MSI installation. Send it onto the stack and call the function
Push "{48E5A72D-whatever-xxxx}" call CallMsiDeinstaller
The Function
!define OLDVERSIONWARNING \ "An older version of $(^Name) was found on your system. It is recommended that you uninstall the old version before installing the new version.$\r$\n$\r$\nDo you want to uninstall the old version of $(^Name)?" !define OLDVERSIONREMOVEERROR \ "A problem was encountered while removing the old version of $(^Name). Please uninstall it manually using Programs and Features in Control Panel." !define INSTALLSTATE_DEFAULT "5" !define INSTALLLEVEL_MAXIMUM "0xFFFF" !define INSTALLSTATE_ABSENT "2" !define ERROR_SUCCESS "0" Function CallMsiDeinstaller Pop $R0 System::Call "msi::MsiQueryProductStateA(t '$R0') i.r0" StrCmp $0 "${INSTALLSTATE_DEFAULT}" 0 Done MessageBox MB_YESNO|MB_ICONQUESTION "${OLDVERSIONWARNING}" \ IDNO BreakMe System::Call "msi::MsiConfigureProductA(t '$R0', \ i ${INSTALLLEVEL_MAXIMUM}, i ${INSTALLSTATE_ABSENT}) i.r0" StrCmp $0 ${ERROR_SUCCESS} Done MessageBox MB_OK|MB_ICONEXCLAMATION \ "${OLDVERSIONREMOVEERROR}" BreakMe: Abort Done: FunctionEnd