Yep.  Ideally you'd have an Application.Current.Restart() method, so
elevated trust wasn't necessary though :).  You'd still have to use COM
Interop to find the user's Program Files folder though (the
System.Environment.GetFolderPath method won't return it), and then use COM
Interop to run sllauncher.exe.  Whether it matters that the app is still
running when the new instance is loaded, I don't know, but I think it would
be OK.  I assume the new version (if doing immediately after an update has
been downloaded) will have already been put in the right place, and not
waiting for the current instance of the app to close.  One of us might have
to give it a go as a proof of concept exercise and blog the results :).

Chris


On 5 October 2010 17:10, Miguel Madero <m...@miguelmadero.com> wrote:

> All of the options we mentioned required full trust, but this one at least
> doesn't require COM Interop to inspect the file system :)
>
>
>
> On Tue, Oct 5, 2010 at 4:09 PM, Chris Anderson <christheco...@gmail.com>wrote:
>
>> Ah, nice.  Will have to remember that one.  Of course you'll need elevated
>> trust to be able to do that, but looks like a good solution.  Thanks for
>> sharing Miguel.
>>
>> Chris
>>
>>
>> On 5 October 2010 15:26, Miguel Madero <m...@miguelmadero.com> wrote:
>>
>>>  Everyone,
>>>
>>> I remember a few months ago at an SDDN meeting we were talking about
>>> options to start an OOB App like looking at the shortcuts in the start menu
>>> or trying to guess based on the random paths that the app might get
>>> installed on. I found a nice option. Essentially we use the 'origin' as the
>>> key instead of trying to find the path to the xap.
>>>
>>>
>>> From Tim Heuer 
>>> blog<http://timheuer.com/blog/archive/2010/03/25/using-sllauncher-for-silent-install-silverlight-application.aspx>
>>>
>>>  Automatically Launching the App
>>>
>>> So what if you wanted to also automatically launch the app after
>>> installing (i.e., the CD/DVD ‘autorun’ scenario).  You again would use
>>> sllauncher.exe to do this for you *after you’ve installed the app*.
>>> Using our same sample above here would be the command:
>>>
>>>    1: "%ProgramFiles%\Microsoft Silverlight\sllauncher.exe"
>>>
>>>
>>>
>>>
>>>    2:     /emulate:"Silverface.xap"
>>>
>>>
>>>
>>>
>>>    3:     
>>> /origin:"http://www.silverlight.net/content/samples/apps/facebookclient/ClientBin/Silverface.xap";
>>>
>>>
>>>
>>>
>>>    4:     /overwrite
>>>
>>>  Notice the *emulate* command.  This is the launcher.  Now you’ll notice
>>> that this isn’t the same command-line options if you looked at an installed
>>> applications’ created shortcuts.  Because the folder where the XAP gets
>>> installed is pretty random, we use the origin as the hint to the
>>> sllauncher.exe program to find the right app for us and start it up.  I’ve
>>> found that using /overwrite will also give a more consistent behavior.
>>>
>>>
>>>
>>>
>>> --
>>> Miguel A. Madero Reyes
>>> www.miguelmadero.com (blog)
>>> m...@miguelmadero.com
>>>
>>> _______________________________________________
>>> ozsilverlight mailing list
>>> ozsilverlight@ozsilverlight.com
>>> http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
>>>
>>>
>>
>> _______________________________________________
>> ozsilverlight mailing list
>> ozsilverlight@ozsilverlight.com
>> http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
>>
>>
>
>
> --
> Miguel A. Madero Reyes
> www.miguelmadero.com (blog)
> m...@miguelmadero.com
>
> _______________________________________________
> ozsilverlight mailing list
> ozsilverlight@ozsilverlight.com
> http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
>
>
_______________________________________________
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight

Reply via email to