The application in which I work downloads files from our server and then launches them. Although many files work fine, I have problems running files that Microsoft decided to be “unsafe”, these are ordinary files (.doc / .xml), but downloaded from our server and now with the Unknown publisher .
Code:
bool res = await Windows.System.Launcher.LaunchFileAsync(file, options); if (!res) { options.DisplayApplicationPicker = true; options.TreatAsUntrusted = true; res = await Windows.System.Launcher.LaunchFileAsync(file, options); if (!res) { await Util.ShowErrorMessage("Unable to open file"); } }
As you can see from the code, when the initial launch fails, I try to restart it this time using the “TreatAsUntrusted” flag so that Windows will warn the user and thus hope that I will get access to the file if the user is “OK” "with a warning. This also does not work.
Is there anyway to mark a file as reliable? or can i run it anyway?
source share