clickonce_Firefox,ClickOnce,XBAP和.NET 3.5 SP1

clickonce

clickonce

One of the things that I noticed immediately when I made the SmallestDotNet was that Firefox was reporting the version of the .NET Framework installed. There's a Firefox extension that is installed with .NET 3.5SP1. I was stoked about this because I'd like users of BabySmash to be able to use ClickOnce from Firefox to launch it.

制作SmallestDotNet时,我立即注意到的一件事是Firefox正在报告已安装的.NET Framework版本。 .NET 3.5SP1附带了一个Firefox扩展。 我对此感到很激动,因为我希望BabySmash的用户能够使用Firefox中的ClickOnce启动它。

ClickOnce和Firefox (ClickOnce and Firefox)

When you install .NET Framework 3.5SP1, there's a key written to the registry whether Firefox is installed or not. If Firefox is installed later, it will notice the key and use the plugin. If it's already installed, it'll just work. The registry key points to a Firefox Extension (XPI) that acts like the 3rd party FFClickOnce extension that a lot of us installed before.

当您安装.NET Framework 3.5SP1时,无论是否安装了Firefox,都有一个密钥写入注册表。 如果以后安装了Firefox,它将注意到该密钥并使用该插件。 如果已经安装,它将可以正常工作。 注册表项指向Firefox扩展(XPI),其作用类似于我们很多人之前安装的第三方FFClickOnce扩展。

The registry key is at HKLM:\Software\Mozilla\Firefox\Extensions This Firefox Addin helps ClickOnce applications work from inside of Firefox 2 or Firefox 3. It'll be installed with any installation of .NET 3.5 SP1, including the smaller Client Profile.

注册表项位于HKLM:\ Software \ Mozilla \ Firefox \ Extensions此Firefox插件可帮助ClickOnce应用程序从Firefox 2或Firefox 3内部运行。它将与任何.NET 3.5 SP1安装一起安装,包括较小的Client Profile。 。

The add-in looks like this...

加载项看起来像这样...

Picture of the Firefox Addins dialog

And its options dialog looks like this:

其选项对话框如下所示:

image

On my system the Firefox UserAgent now looks like this:

在我的系统上,Firefox UserAgent现在看起来像这样:

Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 (.NET CLR 3.5.30729)

Mozilla / 5.0(Windows; U; Windows NT 6.0; zh-CN; rv:1.9.0.1)Gecko / 2008070208 Firefox / 3.0.1(.NET CLR 3.5.30729)

By default, as you can see in the dialog, the browser will report just the most recent version of the .NET Framework unless you say otherwise.

默认情况下,如您在对话框中所见,除非另有说明,否则浏览器将仅报告.NET Framework的最新版本。

如果已经安装了FFClickOnce扩展会发生什么? (What happens if the FFClickOnce extension is already installed?)

In Firefox 3 the FFClickOnce add on will automatically get disabled as it has not been updated.

在Firefox 3中,FFClickOnce附加组件将自动禁用,因为尚未更新。

In Firefox 2 the FFClickOnce extension does not alter the user agent string due to a safeguard against creating a user agent greater than 128 characters.  What happens when the user clicks on a .application link is dependent on the user’s configuration.

在Firefox 2中,FFClickOnce扩展不会更改用户代理字符串,因为可以防止创建大于128个字符的用户代理。 用户单击.application链接时会发生什么取决于用户的配置。

For Firefox 2.0 this is the table of possible prompting/launching configurations.  The default for each add-on is marked in bold. 

对于Firefox 2.0,这是可能的提示/启动配置表。 每个加载项的默认设置均以粗体标记。

.NET AssistantFFClickOnceResult
No PromptPromptFFClickOnce prompts and handles the click
No PromptNo PromptFFClickOnce handles the click
PromptPrompt

.NET Assistant prompts and handles the click

PromptNo Prompt

FFClickOnce handles the click

.NET助手 FFClickOnce 结果
无提示提示FFClickOnce提示并处理点击
无提示无提示FFClickOnce处理点击
提示提示

.NET Assistant提示并处理单击

提示无提示

FFClickOnce处理点击

When both add-ons are in the default configuration the user will get the FFClickOnce prompt and click once activation will follow the FFClickOnce path which may bypass IE download policy.  In all cases the normal ClickOnce UI will be shown.

当两个加载项均处于默认配置时,用户将收到FFClickOnce提示,并单击一次激活将遵循FFClickOnce路径,这可能会绕过IE下载策略。 在所有情况下,都会显示正常的ClickOnce UI。

What this all means is that ClickOnce will work in FireFox 2 and 3, whether FFClickOnce is installed or not.

这一切都意味着无论是否安装了FFClickOnce,ClickOnce都能在FireFox 2和3中运行。

怎么样了 (How's it done?)

The plugin is written with standard XUL (pronounced zoo-el) via XML and JS.

该插件通过XML和JS用标准XUL(发音为zoo-el)编写。

As an aside, I think it's cool that the XML namespace for XUL is:http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul

顺便说一句,我认为XUL的XML名称空间很酷: http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul

You can go find the plugin yourself in:

您可以在以下位置自己找到插件:

C:\Windows\Microsoft.NET\Framework\v3.5\Windows Presentation Foundation\DotNetAssistantExtension

C:\ Windows \ Microsoft.NET \ Framework \ v3.5 \ Windows Presentation Foundation \ DotNetAssistantExtension

It's a .jar file, and you can copy it out and rename it .zip and open it up. The basic gist is that the plugin watches for a particular MIMEType and application, and if it matches, it launches the ClickOnce application using the the .NET Framework's PresentationHost.exe.

这是一个.jar文件,您可以将其复制出来并重命名为.zip并将其打开。 基本要点是,该插件将监视特定的MIMEType和应用程序,如果匹配,它将使用.NET Framework的PresentationHost.exe启动ClickOnce应用程序。

isClickOnce: function()
{
var mimeInfo = dialog.mLauncher.MIMEInfo;

// Checking the file extension may be second guessing the webserver
// but when 'prompt' is set the user will still have a save button.
if (mimeInfo.MIMEType == "application/x-ms-application" ||
mimeInfo.primaryExtension == "application")
{
return true;
}

return false;
},


launch_application: function()
{
this.execute(this.getSystem32Dir() + \\PresentationHost.exe,
"-LaunchApplication " + dialog.mLauncher.source.spec);

dialog.mDialog.close();
}

It's not too complex, and it's sure nice that BabySmash users can use ClickOnce to launch the smash.

它并不太复杂, BabySmash用户可以使用ClickOnce启动smash肯定很好。

XBAP (XBAP)

XBAPs, or XAML Browser Applications are also enabled in Firefox in .NET 3.5 using the standard NPAPI browser plugin API. The NPWPF.dll enables XBAPs under Firefox.

还可以使用标准NPAPI浏览器插件API在.NET 3.5的Firefox中启用XBAP或XAML浏览器应用程序。 NPWPF.dll在Firefox下启用XBAP。

Image of the NPWPF.dll that enables XBAPs

XBAPs are WPF applications that run inside the Browser's Chrome. They're good for Intranet applications where you want really easy deployment, the complete .NET Framework (as opposed to Silverlight) and a browser's navigational model.

XBAP的是浏览器的Chrome内部运行的WPF应用程序。 它们非常适合希望真正轻松部署的Intranet应用程序,完整的.NET Framework(与Silverlight相对)和浏览器的导航模型。

If you type in about:plugins in Firefox, you can get a list, including this one:

如果您在Firefox中输入about:plugins,则会获得一个列表,其中包括:

The about:plugins page in Firefox

Notice the MIME Types that this plugin has registered for and the extensions (suffixes) it handles. Each of these plugins are automatically installed and enabled when you install the .NET Framework 3.5SP1, so you can count on them.

请注意此插件已注册的MIME类型及其处理的扩展名(后缀)。 当您安装.NET Framework 3.5SP1时,将自动安装并启用这些插件中的每一个,因此您可以依靠它们。

Thanks to Eric Harding, Troy Martez and Jennifer Lee for helping me pull this information together. They're going to be adding more content to the Windows Client website very soon with more details how for developers to package and use the .NET Client Profile. They'll also be releasing lots of documentation and details on ClickOnce and deployment improvements in the framework. I'll point you to everything I can dig up, Dear Reader, as soon as I can.

感谢Eric Harding,Troy Martez和Jennifer Lee帮助我将这些信息汇总在一起。 他们将很快向Windows客户端网站添加更多内容,并提供有关开发人员如何打包和使用.NET客户端配置文件的更多详细信息。 他们还将发布有关ClickOnce和框架中部署改进的大量文档和详细信息。 亲爱的读者,我会尽我所能向您指出。

Related Links

相关链接

翻译自: https://www.hanselman.com/blog/firefox-clickonce-xbaps-and-net-35-sp1

clickonce

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值