powershell - Uninstall script not performing correctly -
this simple script uninstalls application. here code:
$app = get-wmiobject -class win32_product -filter "name = 'alliance suite g5'" write-host $app $app.uninstall()
i put write-host in make sure grabbing correct application. here output.
\computername\root\cimv2:win32_product.identifyingnumber="{99b66721-7e75-487c-a0c8-a4f8c4325661}",name="alliance suite g5",version="2013.2.14226.1"
__genus : 2
__class : __parameters
__superclass :
__dynasty : __parameters
__relpath :
__property_count : 1
__derivation : {}
__server :
__namespace :
__path :
returnvalue : 0
pscomputername :
the return value 0, never uninstalls application. appreciated! run automated tests @ night , 1 of them installs application nice if make scheduled powershell script uninstall it.
event viewer (note: product "reconfigured several times before second message):
windows installer reconfigured product. product name: microsoft identity extensions. product version: 2.0.1459.0. product language: 1033. manufacturer: microsoft corporation. reconfiguration success or error status: 0. beginning windows installer transaction: {99b66721-7e75-487c-a0c8-a4f8c4325661}. client process id: 8664. product: alliance suite g5 -- removal completed successfully. windows installer removed product. product name: alliance suite g5. product version: 2013.2.14226.1. product language: 1033. manufacturer: united systems & software. removal success or error status: 0.
result when running command:
c:\windows\system32>msiexec.exe /x "c:\allianceinstall\g5\alliance.g5.exe" /qn / l*v "c:\msilog.log
=== verbose logging started: 8/18/2014 9:42:06 build type: ship unicode 5.00.9200.00 calling process: c:\windows\system32\msiexec.exe === msi (c) (5c:74)
[09:42:06:039]: resetting cached policy values msi (c) (5c:74)
[09:42:06:039]: machine policy value 'debug' 0 msi (c) (5c:74) [09:42:06:039]: * runengine: * product: c:\allianceinstall\g5\alliance.g5.exe * action: * commandline: ****** msi (c) (5c:74)
[09:42:06:039]: client-side , >ui none or basic: running entire
install on server. msi (c) (5c:74)
[09:42:06:039]: grabbed execution mutex. msi (c) (5c:74)
[09:42:06:061]: cloaking enabled. msi(c) (5c:74)
[09:42:06:061]: attempting enable disabled privileges before calling install on server msi (c) (5c:74)
[09:42:06:064]: incrementing counter disable shutdown. counter
after increment: 0 msi (s) (f8:48) [09:42:06:069]: running installation inside multi-package transaction c:\allianceinstall\g5\alliance.g5.exe msi (s) (f8:48) [09:42:06:069]: grabbed execution mutex. msi (s) (f8:64)
[09:42:06:071]: resetting cached policy values msi (s) (f8:64) [09:42:06:071]: machine policy value 'debug' 0 msi (s) (f8:64) [09:42:06:071]: * runengine:
******* product: c:\allianceinstall\g5\alliance.g5.exe ******* action: ******* commandline: ********** msi (s) (f8:64)
[09:42:06:072]: note: 1: 2203 2: c:\allianceinstall\g5\alliance.g5.exe
3: -2147286960 msi (s) (f8:64)
[09:42:06:073]: mainenginethread is
returning 1620 msi (s) (f8:48)
[09:42:06:074]: user policy value
'disablerollback' 0 msi (s) (f8:48)
[09:42:06:074]: machine policy
value 'disablerollback' 0 msi (s) (f8:48)
[09:42:06:074]:
incrementing counter disable shutdown. counter after increment: 0 msi (s) (f8:48)
[09:42:06:074]: note: 1: 1402 2:
hkey_local_machine\software\microsoft\windows\currentversion\installer\rollback\scripts 3: 2 msi (s) (f8:48)
[09:42:06:074]: note: 1: 1402 2:
hkey_local_machine\software\microsoft\windows\currentversion\installer\rollback\scripts 3: 2 msi (s) (f8:48)
[09:42:06:075]: decrementing counter disable
shutdown. if counter >= 0, shutdown denied. counter after decrement: -1 msi (c) (5c:74)
[09:42:06:076]: decrementing counter to
disable shutdown. if counter >= 0, shutdown denied. counter after decrement: -1 msi (c) (5c:74)
[09:42:06:076]: mainenginethread
is returning 1620
=== verbose logging stopped: 8/18/2014 9:42:06 ===
it appears installshield suite project - collection of msi files treated single product via custom installshield constructs. appears setup.exe type launcher registered handle arp repair / modify.
in chat jlott confirmed command worked:
alliance.g5.exe /remove /s
full command used jlott:
c:\windows\system32>start c:\allianceinstall\g5\alliance.g5.exe /remove /s
in addition above, should able uninstall each individual msi finding guid , uninstalling via msiexec.exe.
this simple powershell command provide list of installed products "identifying code". can pass code windows installer this: msiexec.exe /x {guid-here}
get-wmiobject -class win32_product
or select view in list form:
get-wmiobject win32_product | format-table identifyingnumber, name, version
Comments
Post a Comment