获取 Silverlight 浏览器外应用程序 ID
我正在尝试从 Web 浏览器启动 SL4 OOB 应用程序。我目前正在尝试通过将文件类型与 sllauncher.exe 关联,然后添加 SL4 OOB 应用程序 ID 作为参数来实现此目的。从浏览器下载特定文件类型时,会启动 SL4 OOB 应用程序,但为了创建安装程序,我需要能够检索应用程序 ID,以便可以更新文件类型关联的注册表项。有人知道应用程序 ID 是如何生成的,或者是否可以强制使用特定的应用程序 ID?
I'm trying to launch a SL4 OOB application from the web browser. I'm currently trying to achieve this by associating a file type with sllauncher.exe and then adding the SL4 OOB application id as a parameter. The SL4 OOB application is launched when the specific file type is downloaded from the browser, but in order for me to create an installer I need to be able to retrieve the application id so I can update the registry entry for the file type association.Does anyone know how the application id is generated or if it's possible to force a specific application id to be used?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我担心这并不容易......
有一个方法Deployment.GetAppIdForUri,听起来它完全符合您的需要,但不幸的是它被标记为SecurityCritical,因此您无法使用它。
一个可能有效的技巧是这样的:
当应用程序安装为 OOB 时,您可以使用 Application.Current.Host.Source 或类似的东西加上一些子字符串魔术来获取应用程序 ID。不幸的是,我现在无法测试它,因为我现在正在这台机器上卸载 VS2010 RC ;-)
无论如何,如果可行,您可以获取 ID 并将其写入 IsoStore 供以后使用。
强制应用程序使用特定的 ID 会很好,但我认为这是不可能的。
干杯,亚历克斯
I fear that this won't be easy...
There's a method Deployment.GetAppIdForUri which sounds like it does exactly what you need, but unfortunately it is marked SecurityCritical so you can't use it.
A hack that might work is this:
When the app is installed OOB, you might use Application.Current.Host.Source or something like that plus a bit of substring magic to get the app ID. Unfortunately, I'm not able to test that right now because I'm uninstalling the VS2010 RC on this machine right now ;-)
Anyway, if that works, you might take the ID and write it into IsoStore for later use.
Forcing a specific ID for the app would be nice, but I think it's not possible.
Cheers, Alex
Silverlight OOB 应用程序的快捷方式文件包含应用程序 ID。从快捷方式文件中检索应用程序 ID 对我来说很重要。
The shortcut file of Silverlight OOB application includes the application id. Retrieving the application id from the shortcut file is work to me.