How to stop the MSDeploy regKey provider from failing if the registry key doesn't exist
I am moving a lot of IIS websites using MSDeploy and I am running into an issue where I am trying to include 3 registry keys as part of the move, but all 3 registry keys don't always exist on each website.
So the question is: Is there a way to get MSDeploy to move the registry keys if they are there on the source and silently skip them if they don't exist?
I've tried both fo开发者_如何学JAVArcibly enabling and disabling the SkipInvalidSource rule, but it didn't seem to effect the issue either way.
Also one final note, I am using a manifest file for the source (which contains the entries for the 3 regKey providers).
Not quite enough information here:
- What is your windows version
- What does your manifest for the regkey provider look like
In general ... you need to be certain that you are using the regKey provider before it will work:
I'm certain you have seen this, but just in case here are 2 references that might help:
From Web Deploy Rules
SkipInvalidSource (Skip Invalid Source Rule) [0.50]
Skips the synchronization of data from a provider if the source of the data cannot be found (for example, you use the regKey provider and the registry key that you have specified does not exist). This rule is enabled by default.
Web Deploy regKey Provider
Caution: ACLs for registry keys and values are preserved in a synchronization operation, but certain paths in the registry can require administrator permissions. The provider will fail if it does not have the necessary permissions to access the registry keys that you specify.
Here is a sample of not deleting registry keys on the destination that do not exist in the source package.
msdeploy -verb:sync -source:package=C:\package.zip -dest:webServer,computerName=DestServer -skip:skipAction=Delete,objectName=regKey
精彩评论