c# - Windows 10: differentiate between preinstalled app and downloaded app -


one of clients has deal oem. app x preinstalled on number of laptops. app receive updates windows 10 store. app x available download in windows 10 store other users. users using preinstalled version should receive free 3-month trial.

unfortunately, oem not providing device ids, , users not getting unlock codes trial. came following initial "solution":

  • use version 1.0.1.0 preinstalled app.
  • upload 1.0.0.0 store.

when app starts , version 1.0.1.0, identified preinstalled version, @ point can make server call send device id client's server recognize device after app deletions.

i can update store app without losing knowledge of preinstalled apps since can update version below 1.0.1.0. means preinstalled version not overwritten auto update store version (since installed version number greater store version). however, if serious bug detected in preinstalled version, cannot update app or class of users not receive free trial. namely, users have not started app on device yet before windows 10 updates app new version (1.0.1.1 example).

this sounds unnecessarily complicated, , hope is. can think of easier way distinguish between preinstalled , downloaded version that's foolproof?

thanks!

as thinking offering 2 different versions, 1 might better solution, can deploy 2 times version 1.0.0.0.

instead of using versions differ between state, use build symbols. create 2 differnt builds, 1 oem client, , 1 store deployment.

for oem, want allow trial, use following - example:

private bool canusetrial() { #if oem     return true; #else     return false; #endif } 

doing way allow maintain same code base clients, differing between case oem , case store deployment, without logic needed.

edit #1:

to address problem of oem clients updating non-oem clients, can still go approach (as long app runs @ least once #oem build):

private async task<bool> canusetrial() {     var clientcode = generateclientcode(); // you're going  #if oem             webservicexyz.registeroemclient(clientcode);     return true; #else     try     {         return await webservicexyz.isregisteredoemclient(clientcode);     }     catch     {         return false;     } #endif } 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -