/build/static/layout/Breadcrumb_cap_w.png

Uninstalling a Per User Install

Hi,

This kind of follows on from my previous post a week or so a go. Here's my issue...can anybody help?

1. We deploy our packages in user context via Active Directory. The software is deployed via Local/Global group security membership that are tied to User based group policies.

2. We're due to upgrade a particular piece of software. This issue I'm facing is this, a new user logs onto a machine with the new version of the software assigned but the machine has the old version of the software installed under a different users account. In the new version I have entries in the upgrade table to remove the old package but the issue I have is the upgrade code will only remove the package if it's previously been installed by the user or if it's been installed in machine context. Unfortunately for new users neither scenario is applicable.

Does anybody know how you can remove off a per user install when installing a new piece of software under a different per user account to what the current version is installed as? Any custom action? Any scripts? Any help would be greatly appreciated!

Thanks in advance,
Cowley

0 Comments   [ + ] Show comments

Answers (11)

Posted by: anonymous_9363 13 years ago
Red Belt
0
Ahhhhhhhhhh...the joys of per-user GP-deployed apps. Have you been audited by FAST at all? They *love* sites like yours...LOL

Anyway...Your only real recourse is to remove the registry flags which identify the app as having been installed that way. Some notes from a script I wrote which never got past the experimental stage (I leftthe client I built it for):'HKCU\Software\Classes\Installer\Features\[Packed GUID]
'HKCU\Software\Classes\Installer\Products\[Packed GUID]
'HKCU\Software\Microsoft\Installer\Features\[Packed GUID]
'HKCU\Software\Microsoft\Installer\Products\[Packed GUID]
'HKCU\Software\Microsoft\Installer\UpgradeCodes\[Packed GUID]
'HKCU\Software\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\ProductCode ?????????? (almost certainly, [Packed GUID])
'HKLM\Software\Classes\Installer\Features\[Packed GUID]
'HKLM\Software\Classes\Installer\Products\[Packed GUID]
'HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Features\[Packed GUID]
'HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Managed\{usersid}\Installer\Features\[Packed GUID]
'HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Managed\{usersid}\Installer\Products\[Packed GUID]
'HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Managed\{usersid}\Installer\UpgradeCodes\[Packed GUID], [Packed GUID]
'HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Products\[Packed GUID]
'HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\[Packed GUID]
'HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\{usersid}\Components
'HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\{usersid}\Products\[Packed GUID]
'HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\ProductCode -- if there are no longer any installations with the specified product code.
'// Poss start of machine-based policies?
'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\AppMgmt\{a0b0bc16-0149-4f79-af2f-f2ca53021ce1}
'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\[UserSID]\GroupMembership
'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\[UserSID]\History\{25537BA6-77A8-11D2-9B6C-0000F8080861} '// DomainGUID at end?
'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\[UserSID]\History\{c6dc5466-785a-11d2-84d0-00c04fb169f7}\0
The packed GUID is the munged product code. Code for munging/unmunging: Sub MungeProductCode(ByVal strProductCode, ByRef strPackedCode)
'// This routine munges the ProductCode into the Packed format
'// used by various registry entries for Windows Installer
'// For example: {D650B8A9-C547-42D3-A7DF-0FAD0AC6E9ED}
'// becomes
'// 9A8B056D745C3D247AFDF0DAA06C9EDE

Dim arrSortOrder
Dim strNewCode
Dim intIndex

arrSortOrder = Array(9,8,7,6,5,4,3,2,14,13,12,11,19,18,17,16,22,21,24,23,27,26,29,28,31,30,33,32,35,34,37,36)

'// Generate the Packed code
For intIndex = 0 To UBound(arrSortOrder)
strNewCode = strNewCode & Mid(strProductCode,arrSortOrder(intIndex),1)
Next

strPackedCode = strNewCode
End Sub

Sub UnMungeProductCode(ByVal strPackedCode, ByRef strProductCode)
'// This routine reconstructs a ProductCode from the Packed format
'// used by various registry entries for Windows Installer
'// For example: 9A8B056D745C3D247AFDF0DAA06C9EDE
'// becomes
'// {D650B8A9-C547-42D3-A7DF-0FAD0AC6E9ED}

Dim arrSortOrder
Dim intIndex
Dim strPartTemp
Dim strPart1
Dim strPart2
Dim strPart3
Dim strPart4
Dim strPart5

'// Part 1
strPartTemp = Left(strPackedCode, 8)
strPart1 = StrReverse(strPartTemp)

'// Part 2
strPartTemp = Mid(strPackedCode, 9, 4)
strPart2 = StrReverse(strPartTemp)

'// Part 3
strPartTemp = Mid(strPackedCode, 13, 4)
'// Excuse me! May I borrow these variables for a moment?
strPart3 = Left(strPartTemp, 2)
strPart4 = Right(strPartTemp, 2)
strPart3 = StrReverse(strPart4) & StrReverse(strPart3)

'// Now deal with part 4 properly
strPartTemp = Mid(strPackedCode, 17, 2)
strPart4 = Mid(strPackedCode, 19, 2)
strPart4 = StrReverse(strPartTemp) & StrReverse(strPart4)

strPartTemp = Mid(strPackedCode, 21, 12)

arrSortOrder = Array(2,1,4,3,6,5,8,7,10,9,12,11)

'// Generate the product code
For intIndex = 0 To UBound(arrSortOrder)
strPart5 = strPart5 & Mid(strPartTemp,arrSortOrder(intIndex),1)
Next

strProductCode = ""
strProductCode = strProductCode & "{"
strProductCode = strProductCode & strPart1
strProductCode = strProductCode & "-"
strProductCode = strProductCode & strPart2
strProductCode = strProductCode & "-"
strProductCode = strProductCode & strPart3
strProductCode = strProductCode & "-"
strProductCode = strProductCode & strPart4
strProductCode = strProductCode & "-"
strProductCode = strProductCode & strPart5
strProductCode = strProductCode & "}"
End Sub

IIRC, later versions of MSIZap (part of the WI SDK) handle GP-deployed packages.
Posted by: cowley 13 years ago
Orange Belt
0
LOL! Yes user based GPO Deployments are a complete nuisance from an audit & troubleshooting point of view.

Just so I'm clear, the product I want to remove has a product code of {7BEDCE5A-090E-4F15-8022-F7852C5244A8}, where do I place this in your example script...sorry I'm a bit confused.
Posted by: anonymous_9363 13 years ago
Red Belt
0
You need to "pack" the ProductCode using the code provided and then use the resulting string to locate the product's GP "registration" details in the registry. Rename the relevant keys where found (I normally add a prefix of an underscore) and then try re-installing.
Posted by: cowley 13 years ago
Orange Belt
0
Sorry VBSCab what do you mean by "pack" the Product Code? Maybe I'm getting confused but I thought all I would need to do is propogate the script with the product code of the package in question, I.E Fill in the strProductCode = "" parts of the script?
Posted by: cowley 13 years ago
Orange Belt
0
I forgot to ask, does this actually uninstall the app too...or just trick the system into thinking the app is no longer installed?
Posted by: anonymous_9363 13 years ago
Red Belt
0
The script will provide you with the packed code. You then search for the packed version in the registry, renaming keys as you go. That should fool the system into believing the product is installed per-machine.

Test on your VMs first before lettting fly in Production!
Posted by: cowley 13 years ago
Orange Belt
0
I'm still a bit unsure on what to do.

Do I run the script on the affected machine?

Assuming I do the above, what is my next step? Do I check in the registry for the keys you've listed above?

Sorry...I still don't understand what to do with this script or what I'm supposed to be looking for.
Posted by: anonymous_9363 13 years ago
Red Belt
0
- Find the ProductCode for the product which you want to remove
- Pack the ProductCode
- On the affected machine(s):
- find the packed Product Code in the registry keys I have outlined and rename them
- uninstall the old version
- install the new version per-machine
Posted by: Tof95 12 years ago
Yellow Belt
0
I had the same problem. The product was installed per-user and even with an admin account, you cannot uninstall the older version. You get this error message : "This action is only valid for products that are currently installed"
I resolved it by reinstalling the application "per machine", with the property ALLUSERS=1.
Then I could uninstall it and install the newer version.
Posted by: jmcfadyen 12 years ago
5th Degree Black Belt
0
it is entirely possible to remove applications that are installed per user its just not easy.
Posted by: AngelD 12 years ago
Red Belt
0
There exist an easy way to "switch" these however: that required two things
1. Remove application when fallout from GPO
2. advertised entrypoint(s) to trigger a repair for the per-machine install

Set-up the GPO as you normally would for a per-machine install.
For the existing per-user GPO install remove it and select to remove the application when prompted for fallout (can't recall the exact name for it).

Here is what will happen:
The computer starts and gets the per-machine install
The user logs on and the per-user install will be automatically removed

The per-user removal may remove resources installed by the per-machine install but will get repaired when the advertised entrypoint (added by this package) is triggered.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ