When I am attempting to add a new active-setup, the function fails. Tested the same, it works in 3.8.2.
Error output in log:
[Installation] :: Set registry key value: [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\User_TeamsBackgrounds] [(Default) = User_TeamsBackgrounds]. Set-RegistryKey 9/20/2021 5:36:20 PM 17580 (0x44AC)
[Installation] :: Set registry key value: [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\User_TeamsBackgrounds] [StubPath = C:\WINDOWS\system32\wscript.exe /b /nologo C:\ProgramData\TeamsBackgrounds\_SetTeamsBackgrounds.vbs]. Set-RegistryKey 9/20/2021 5:36:20 PM 17580 (0x44AC)
[Installation] :: Set registry key value: [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\User_TeamsBackgrounds] [Version = 1,0,3,0]. Set-RegistryKey 9/20/2021 5:36:20 PM 17580 (0x44AC)
[Installation] :: Set registry key value: [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\User_TeamsBackgrounds] [IsInstalled = 1]. Set-RegistryKey 9/20/2021 5:36:20 PM 17580 (0x44AC)
[Installation] :: Failed to set Active Setup registry entry.
Error Record:
-------------At C:\WINDOWS\ccmcache\126\AppDeployToolkit\AppDeployToolkitMain.ps1:10768 char:58
+ ... et-RegistryKey -Key $HKCUActiveSetupKey -SID $UserProfile.SID -Value ...
+ ~~~~~~~~~~~~~~~~
Error Inner Exception(s):
------------------------- Set-ActiveSetup 9/20/2021 5:36:20 PM 17580 (0x44AC)
Lines of code used in 3.8.4 that causes the failure and works in 3.8.2. (Note, I tried both setting -ExecuteForCurrentUser to $false and $true, same result):
$strDestinationRegistry = "HKEY_LOCAL_MACHINE\SOFTWARE\TeamsBackgrounds"
$strActiveSetupName = "User_TeamsBackgrounds"
Set-ActiveSetup -StubExePath "%windir%\system32\wscript.exe" -Arguments "/b /nologo $($strDestinationFiles)\_SetTeamsBackgrounds.vbs" -Description $strActiveSetupName -Key $strActiveSetupName -Version "$($appVersion.Replace(".", ","))"