Except for the fact that "AppName" is wrong and should be "UninstallString" it looks like the code should work.
You should inspect it with Process Monitor and see why the delete fails. My only guess at this point is that your real code has a typo...