locked
How do I can change the publish location? RRS feed

  • Question

  • Basically I've deployed a Lightswitch desktop application on web server (i.e. www.firstsite.com), now I must move the application to another server with another address (i.e. www.secondsite.com).

    How do I can change the publish location making the installed clients to automatically detect the address change?

    Thank you.

    Bye

      Andrew

    Wednesday, December 19, 2012 2:22 PM

Answers

  • I did some playing around a bit and it looks like the app_id supplied to sllauncher.exe just references the folder in the ...\AppData\Local\Microsoft\Silverlight\OutOfBrowser directory that files that were downloaded when the app was initially installed.  One file in the app_id folder is named "metadata".  If you open this in a text editor, you will see it contains various properties about the application.  I tried switching an app between 2 Azure Web Sites (published to website A, installed the app on a client, published to website B, deleted website A).  When I launched the shortcut on the client, it failed to launch (expected).  I then updated the OriginalSourceUri and FinalAppUri properties in the metadata file to point to website B.  After I did this, I was able to launch the app with the original shortcut.  So it might be possible to update this file programatically on shutdown with the original app (if you have already deployed to the new site, tell the shortcut to open from website B from now on).

    Another option could be to update the original app to have a start up form that instructs the user to install the app from the new location (not as good, but something).

    For the future, the thing to remember is that the client needs to be served the .xap file from the URI that it was served from during initial installation.  So basically the public URL needs to remain the same.


    David Kidder | Senior SDET | Microsoft | LightSwitch

    • Proposed as answer by Yann DuranModerator Saturday, December 29, 2012 4:45 AM
    • Marked as answer by Angie Xu Friday, January 4, 2013 5:45 AM
    Saturday, December 29, 2012 2:07 AM
    Moderator

All replies

  • for this scenario I would publish to a package rather than direct publish from visual studio.

    The same package can be imported in IIS1, IIS2, IIS3, ....

    All this can be automated from the command line :web deploy


    paul van bladel

    Wednesday, December 19, 2012 5:30 PM
  • I don't think that it is possible for the clients to be automatically updated if you change the public facing URL because the shortcut that is used to launch the sllauncher.exe passes in the app_id of the application, which includes the URL of the website.

    David Kidder | Senior SDET | Microsoft | LightSwitch

    Wednesday, December 19, 2012 7:32 PM
    Moderator
  • Dave, thanks for the answer...

    Your reply confirms my initial idea and doesn't sound good for me... I must change our publishing location and we have hundreds installations over the country, do you have any suggestion?

    Customers must reinstall from the new location?

    What about dynamic dns to avoid similar problems in future? There are know problems with this solution?

    Thursday, December 20, 2012 8:21 AM
  • I did some playing around a bit and it looks like the app_id supplied to sllauncher.exe just references the folder in the ...\AppData\Local\Microsoft\Silverlight\OutOfBrowser directory that files that were downloaded when the app was initially installed.  One file in the app_id folder is named "metadata".  If you open this in a text editor, you will see it contains various properties about the application.  I tried switching an app between 2 Azure Web Sites (published to website A, installed the app on a client, published to website B, deleted website A).  When I launched the shortcut on the client, it failed to launch (expected).  I then updated the OriginalSourceUri and FinalAppUri properties in the metadata file to point to website B.  After I did this, I was able to launch the app with the original shortcut.  So it might be possible to update this file programatically on shutdown with the original app (if you have already deployed to the new site, tell the shortcut to open from website B from now on).

    Another option could be to update the original app to have a start up form that instructs the user to install the app from the new location (not as good, but something).

    For the future, the thing to remember is that the client needs to be served the .xap file from the URI that it was served from during initial installation.  So basically the public URL needs to remain the same.


    David Kidder | Senior SDET | Microsoft | LightSwitch

    • Proposed as answer by Yann DuranModerator Saturday, December 29, 2012 4:45 AM
    • Marked as answer by Angie Xu Friday, January 4, 2013 5:45 AM
    Saturday, December 29, 2012 2:07 AM
    Moderator
  • Thank you Dave.

    The server change wasn't in our original plan but after a year the company strategy is changed and we are migrating all of our servers to an external hosting, so... this is a matter I must deal to...

    At the moment I found two ways to handle this:

    1. Use your suggestion to modify the application

    2. Migrate the server name to the new address, but this will take about 2 days for the dns to update..

    Anyway I think that a server change must be handled by LightSwitch in the same way ClickOnce do...

    Bye,

      Andrew

    Monday, January 7, 2013 12:10 PM