Hello!
I have an application wich the last month have gotten a bug i have been unsucessfull in solving.
The application is a warehouse/production WPF application and is published to an non-internet connected LAN with around 100 Windows 7 Computers. The application is in rapid development cycle and have upto 100 update versions a year. The application also have an silent background updater which updates the app and notifies the user when finished with a restart prompt. The application is deployed to a network share wich have installtion and update folder set to the fully qualified path. However the user can chose to install the app from a Network station in his file explorer, since the same share also is mapped as this. This i have read should not be of any concern as long as the update location is set.
The bug is that we have been getting the message "The user has refused to grant required permissions to access to the application" when we perform the check for updated version. We have been trying both background and foreground update, and we also recently tried this:
ApplicationDeployment deployment = ApplicationDeployment.CurrentDeployment;
var appId = new ApplicationIdentity(deployment.UpdatedApplicationFullName);
var unrestrictedPerms = new PermissionSet(PermissionState.Unrestricted);
var appTrust = new ApplicationTrust(appId)
{
DefaultGrantSet = new PolicyStatement(unrestrictedPerms),
IsApplicationTrustedToRun = true,
Persist = true
};
ApplicationSecurityManager.UserApplicationTrusts.Add(appTrust);
without success.
Our update code is this:
if (ApplicationDeployment.IsNetworkDeployed)
{
ApplicationDeployment deployment = ApplicationDeployment.CurrentDeployment;
var appId = new ApplicationIdentity(deployment.UpdatedApplicationFullName);
var unrestrictedPerms = new PermissionSet(PermissionState.Unrestricted);
var appTrust = new ApplicationTrust(appId)
{
DefaultGrantSet = new PolicyStatement(unrestrictedPerms),
IsApplicationTrustedToRun = true,
Persist = true
};
ApplicationSecurityManager.UserApplicationTrusts.Add(appTrust);
try
{
info = deployment.CheckForDetailedUpdate();
}
......
and it always fails with a TrustNotGrantedException and the above message. Even if i publish an update without changes to the code base.