Search Unity

Windows store application auto udpate - mandatory best practice ?

Discussion in 'Windows' started by starmindfr, Oct 19, 2018.

  1. starmindfr

    starmindfr

    Joined:
    Nov 7, 2016
    Posts:
    38
    Hello all

    Basic question but could not find any specific answer :

    I have now a game made with Unity published on Windows Store, all is fine.

    Now i start to add "updates" / new releases on the windows store, but i then see this "mandatory update" checkbox on store submit page, that request to use an ingame script to check and auto update - force update and code is obviously not compatible. (private StoreContext > no such sdk)

    So what is the "official" way / plugin or method in order to make the updates mandatory, from Unity releases on windows store ?

    Thanks
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Could you elaborate on this?
     
  3. starmindfr

    starmindfr

    Joined:
    Nov 7, 2016
    Posts:
    38
    Hello so when i add "update" on Microsoft store i have a checkbox "mandatory update"

    And below its written :

    "...assuming you have used the Windows.Services.Store APIs to allow your app to programmatically check for package updates and download and install the updated packages."

    So obviously i need this "Windows.Services.Store APIs" in the unity project

    and when reviewing the code details :

    Code (CSharp):
    1.  
    2. private StoreContext context = null;
    3.  
    4. public async Task DownloadAndInstallAllUpdatesInBackgroundAsync()
    5. {
    6.     if (context == null)
    7.     {
    8.         context = StoreContext.GetDefault();
    9.     }
    Edit : seems i understand better the whole system now so i have to exclude the current scripts from editor and just use from build as unity editor will not run windows store code online
     
    Last edited: Oct 20, 2018
  4. MDoelle

    MDoelle

    Joined:
    Nov 23, 2016
    Posts:
    10
    You don't need that.

    If you tick the force update box, it will force the app on the user's device (most of the time...).