我想为 Windows 和 MacOS 的 oob 应用程序创建自定义安装程序。
对于 Windows,我使用了以下方法 - https://www.codeproject.com/Articles/179756/Installing-Silverlight-OOB-Application-using-a-Set
对于 MacOS,以下解决方案 - https://www.blaize.net/2012/04/offline-oob-mac-installation/
这些方法运行良好并创建应用程序,但应用程序更新不适用于它们。
在Silverlight应用程序中,我使用以下代码进行更新:
private void CheckUpdateApplication()
{
if (Application.Current.IsRunningOutOfBrowser)
{
Application.Current.CheckAndDownloadUpdateAsync();
Application.Current.CheckAndDownloadUpdateCompleted += Application_CheckAndDownloadUpdateCompleted;
}
}
private void Application_CheckAndDownloadUpdateCompleted(object sender, CheckAndDownloadUpdateCompletedEventArgs e)
{
if (e.UpdateAvailable)
{
MessageBox.Show(CommonMethod.MessageUpdateApplication);
}
else if (e.Error != null)
{
MessageBox.Show(string.Format("{0} - {1}", e.Error.GetType().Name, e.Error.Message));
}
}
在浏览器外应用程序的设置中,我设置了复选框 - “在浏览器外运行时需要提升信任”。 XAP 文件使用自签名证书进行签名。
在 Windows 中安装后,更新时出现以下错误:
Exception - Error HRESULT E_FAIL has been returned from a call to a COM component.
在 MacOS 中安装后,我得到以下信息:
OutOfMemoryException - Error 0x1AA6.
最佳答案
将 /origin
命令行参数传递给 sllauncher.exe
来自https://www.codeproject.com/Articles/179756/Installing-Silverlight-OOB-Application-using-a-Set :
This option specifies the Uri where the XAP file have come from. This Uri is used for security purposes and auto-updates. For example: /origin: http://mywebsite.com/SampleOOB.xap
关于silverlight - 浏览器外 (oob) 应用程序的自定义安装程序。更新不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53228349/