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
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)
Please log in to answer
Posted by:
anonymous_9363
13 years ago
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):
IIRC, later versions of MSIZap (part of the WI SDK) handle GP-deployed packages.
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
Posted by:
anonymous_9363
13 years ago
Posted by:
cowley
13 years ago
Posted by:
cowley
13 years ago
Posted by:
anonymous_9363
13 years ago
Posted by:
cowley
13 years ago
Posted by:
anonymous_9363
13 years ago
Posted by:
Tof95
13 years ago
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.
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
13 years ago
Posted by:
AngelD
13 years ago
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.
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.
so that the conversation will remain readable.