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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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.
Answered 02/10/2011 by: VBScab
Red Belt

Please log in to comment
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.
Answered 02/10/2011 by: cowley
Orange Belt

Please log in to comment
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.
Answered 02/10/2011 by: VBScab
Red Belt

Please log in to comment
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?
Answered 02/10/2011 by: cowley
Orange Belt

Please log in to comment
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?
Answered 02/10/2011 by: cowley
Orange Belt

Please log in to comment
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!
Answered 02/10/2011 by: VBScab
Red Belt

Please log in to comment
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.
Answered 02/10/2011 by: cowley
Orange Belt

Please log in to comment
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
Answered 02/10/2011 by: VBScab
Red Belt

Please log in to comment
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.
Answered 08/08/2011 by: Tof95
Yellow Belt

Please log in to comment
0
it is entirely possible to remove applications that are installed per user its just not easy.
Answered 08/08/2011 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment
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.
Answered 08/09/2011 by: AngelD
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity