Hi,
I just notice there is nothing in the documentation about Set-ActiveSetup. I believe it should be add.
Also when you run :
Set-ActiveSetup -StubExePath "$($var_ActiveSetupFolder)\ActiveSetup.ps1" `
-Description "Configuration de $var_PackageLongName" -Key "$var_PackageLongName" -Locale 'Fr' -PurgeActiveSetupKey $true
If the active setup was not run Under a specific profile, the set-active-setup will return an error.
```
[02-14-2015 22:03:34.218] [Pre-Installation] [Remove-RegistryKey] :: Delete registry key [Registry::HKEY_USERS\S-1-5-21-784494402-3717492740-3355713634-1001\Software\Microsoft\Active Setup\Installed Components\Vcredist2005_Frv1]
[02-14-2015 22:03:34.343] [Pre-Installation] [Remove-RegistryKey] :: Failed to delete registry key [Registry::HKEY_USERS\S-1-5-21-784494402-3717492740-3355713634-1001\Software\Microsoft\Active Setup\Installed Components\Vcredist2005_Frv1].
Error Record:
-------------
Message : Impossible de trouver le chemin d'accès «HKEY_USERS\S-1-5-21-784494402-3717492740-3355713634-1001\Software\Microsoft\Active Setup\Installed Components\Vcredist2005_Frv1», car il n'existe
pas.
InnerException :
FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
ScriptStackTrace : à Remove-RegistryKey<Process>, C:\Temp\Vcredist2005_Frv1\_Include\AppDeployToolkit\AppDeployToolkitMain.ps1 : ligne 3173
à <ScriptBlock>, C:\Temp\Vcredist2005_Frv1\_Include\AppDeployToolkit\AppDeployToolkitMain.ps1 : ligne 7675
à Invoke-HKCURegistrySettingsForAllUsers<Process>, C:\Temp\Vcredist2005_Frv1\_Include\AppDeployToolkit\AppDeployToolkitMain.ps1 : ligne 3278
à Set-ActiveSetup<Process>, C:\Temp\Vcredist2005_Frv1\_Include\AppDeployToolkit\AppDeployToolkitMain.ps1 : ligne 7676
à <ScriptBlock>, <Aucun fichier> : ligne 2
PositionMessage : Au caractère C:\Temp\Vcredist2005_Frv1\_Include\AppDeployToolkit\AppDeployToolkitMain.ps1:3173 : 6
+ Remove-Item -Path $Key -ErrorAction 'Stop' -Force | Out-Null
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
This error is saying "HKEY_USERS\S-1-5-21-784494402-3717492740-3355713634-1001\Software\Microsoft\Active Setup\Installed Components\Vcredist2005_Frv1», car il n'existe
pas." is not found.
I believe no error should be made if a key is not found in any profile. This is a big "mistake"
Thanks,
François
Comments: I did more test.
```
Set-ActiveSetup -StubExePath "$var_ActiveSetup83" `
-Description "Configuration de $var_PackageLongName" -Key "$var_PackageLongName" -Locale 'Fr'
```
This line will create a key Under hklm.
```
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\Vcredist2005_Frv1]
@="Configuration de Vcredist2005_Frv1"
"StubPath"=hex(2):43,00,3a,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,\
5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,57,00,69,00,6e,\
00,64,00,6f,00,77,00,73,00,50,00,6f,00,77,00,65,00,72,00,53,00,68,00,65,00,\
6c,00,6c,00,5c,00,76,00,31,00,2e,00,30,00,5c,00,70,00,6f,00,77,00,65,00,72,\
00,73,00,68,00,65,00,6c,00,6c,00,2e,00,65,00,78,00,65,00,20,00,2d,00,45,00,\
78,00,65,00,63,00,75,00,74,00,69,00,6f,00,6e,00,50,00,6f,00,6c,00,69,00,63,\
00,79,00,20,00,42,00,79,00,70,00,61,00,73,00,73,00,20,00,2d,00,4e,00,6f,00,\
50,00,72,00,6f,00,66,00,69,00,6c,00,65,00,20,00,2d,00,4e,00,6f,00,4c,00,6f,\
00,67,00,6f,00,20,00,2d,00,57,00,69,00,6e,00,64,00,6f,00,77,00,53,00,74,00,\
79,00,6c,00,65,00,20,00,48,00,69,00,64,00,64,00,65,00,6e,00,20,00,2d,00,43,\
00,6f,00,6d,00,6d,00,61,00,6e,00,64,00,20,00,22,00,43,00,3a,00,5c,00,50,00,\
52,00,4f,00,47,00,52,00,41,00,7e,00,31,00,5c,00,50,00,4e,00,47,00,5c,00,49,\
00,4e,00,53,00,54,00,54,00,52,00,7e,00,31,00,5c,00,54,00,72,00,6f,00,75,00,\
73,00,73,00,65,00,73,00,5c,00,56,00,43,00,52,00,45,00,44,00,49,00,7e,00,31,\
00,5c,00,41,00,43,00,54,00,49,00,56,00,45,00,7e,00,31,00,5c,00,41,00,43,00,\
54,00,49,00,56,00,45,00,7e,00,31,00,2e,00,50,00,53,00,31,00,22,00,00,00
"Version"="1502,1922,0326"
"Locale"="Fr"
"IsInstalled"=dword:00000001
```
But nothing Under HKEY_USer
This command
```
Set-ActiveSetup -StubExePath "$var_ActiveSetup83" `
-Description "Configuration de $var_PackageLongName" -Key "$var_PackageLongName" -Locale 'Fr' -PurgeActiveSetupKey $true
```
The command will remove entry Under HKLM but will fail Under HKEY_USer as the key is not existing. This is wrong.
```
[02-19-2015 22:08:21.990] [Initialization] [Remove-RegistryKey] :: Failed to delete registry key [Registry::HKEY_USERS\S-1-5-21-784494402-3717492740-3355713634-1001\Software\Microsoft\Active Setup\Installed Components\Vcredist2005_Frv1].
Error Record:
-------------
Message : Impossible de trouver le chemin d'accès «HKEY_USERS\S-1-5-21-784494402-3717492740-3355713634-1001\Software\Microsoft\Active Setup\Installed Components\Vcredist2005_Frv1
», car il n'existe pas.
InnerException :
FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
ScriptStackTrace : à Remove-RegistryKey<Process>, C:\Temp\Vcredist2005_Frv1\_Include\AppDeployToolkit\AppDeployToolkitMain.ps1 : ligne 3173
à <ScriptBlock>, C:\Temp\Vcredist2005_Frv1\_Include\AppDeployToolkit\AppDeployToolkitMain.ps1 : ligne 7675
à Invoke-HKCURegistrySettingsForAllUsers<Process>, C:\Temp\Vcredist2005_Frv1\_Include\AppDeployToolkit\AppDeployToolkitMain.ps1 : ligne 3278
à Set-ActiveSetup<Process>, C:\Temp\Vcredist2005_Frv1\_Include\AppDeployToolkit\AppDeployToolkitMain.ps1 : ligne 7676
à <ScriptBlock>, <Aucun fichier> : ligne 2
PositionMessage : Au caractère C:\Temp\Vcredist2005_Frv1\_Include\AppDeployToolkit\AppDeployToolkitMain.ps1:3173 : 6
+ Remove-Item -Path $Key -ErrorAction 'Stop' -Force | Out-Null
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Any workaround will be appreciate :)