gpt4 book ai didi

silverlight - 以编程方式从浏览器应用程序中启动 Silverlight

转载 作者:行者123 更新时间:2023-12-04 12:59:44 27 4
gpt4 key购买 nike

我正在尝试使用 SLLAUNCHER.EXE 启动已安装的 SL Out-of-Browser App。运行以下命令后,桌面上的 MyApp 启动图标就消失了。如果我在没有覆盖开关的情况下尝试它,则不会发生任何事情。

我使用这篇文章作为指南:

http://timheuer.com/blog/archive/2010/03/25/using-sllauncher-for-silent-install-silverlight-application.aspx

任何建议,将不胜感激。

    static void Main(string[] args)
{
string sllauncherPath = string.Format("{0}\\Microsoft Silverlight\\sllauncher.exe",
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles));

string originUri = @"http://localhost:52878/ClientBin/MyApp.xap";
string xap = "MyApp.xap";
string arg = string.Format(@"/emulate:""{0}"" /origin:""{1}"" /overwrite", xap, originUri);

var startInfo = new ProcessStartInfo
{
CreateNoWindow = false,
UseShellExecute = false,
RedirectStandardOutput = false,
FileName = sllauncherPath,
Arguments = arg
};

var process = Process.Start(startInfo))

}

最佳答案

您使用的是 64 位机器吗?
http://social.msdn.microsoft.com/Forums/en-US/silverlightcontrols/thread/abedb9dc-d471-4d82-8a20-45f98671cac9

也可以帮忙:
这是我在检测到更新完成后从我的 SL OOB 应用程序中重新启动的方式:

''put this in your App.xaml.vb[.cs] and call DoRestart
Public Shared Sub DoRestart()
StartAgain()
Application.Current.MainWindow.Close()
End Sub
Public Shared Sub StartAgain()
If Not [String].IsNullOrEmpty(GetSLLauncherCommand) Then
Using shell = AutomationFactory.CreateObject("WScript.Shell")
shell.Run(GetSLLauncherCommand)
End Using
End If
End Sub
Public Shared Function GetSLLauncherCommand() As String
Dim desktopPath As String
Dim SLLauncherCommand As String = ""
Using wShell As Object = AutomationFactory.CreateObject("WScript.Shell")
desktopPath = wShell.SpecialFolders("Desktop")
End Using
Using shell As Object = AutomationFactory.CreateObject("Shell.Application")
Dim DesktopFolder As Object = shell.[NameSpace](desktopPath)
Dim DesktopItems As Object = DesktopFolder.Items()
For Each item In DesktopItems
If item.IsLink Then 'this is a shurtcut
Dim fileName As String = item.Name.ToLower()

If fileName.Contains("!!!<PART OF YOUR SL APPS SHORCUT NAME>!!!!") Then
Dim link = item.GetLink()
SLLauncherCommand = """" & Convert.ToString(link.Path) & """ " & Convert.ToString(link.Arguments)
End If
End If
Next
End Using
Return SLLauncherCommand
End Function

您可以尝试为您的非 SL 应用调整代码!

THT

关于silverlight - 以编程方式从浏览器应用程序中启动 Silverlight,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7155826/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com