none
How to get the DateTime of first instance of installation from the store?

    Question

  • One of my apps I've been letting the user have no time limit trial with limited features.  Now, I want to give the user 3 days of unlimited features before going into limited features. I just wrote the code to install a "keep count" file in the roaming folder.  Basically, it keeps track of the DateTime of when the app is first opened. 

    That said, I realized this morning that all I have to do is go into the roaming folder in the explorer and delete the file every 3 days.  Heck, I can write a script that would do this, and just double click it every 3 days.

    Is there a way I can get the TimeDate of the very first instance the app was installed from the metro store? 

    Sunday, July 27, 2014 3:32 PM

All replies

  • Hey there Pete,

    I think there are a couple of ways to do that :

    • Using environment variables.
    • Storing the account time limit on a server or remote location (safest).
    • Hashing your account time limit (Not ideal because the key used for the hash needs to be stored aswell).

    I hope that answers your question if not, please do ask me for help ;)

    Regards Bram Sinke



    • Edited by B. Sinke Sunday, July 27, 2014 3:48 PM
    Sunday, July 27, 2014 3:42 PM
  • I really don't want to maintain a server... don't know how. I'm not a real programmer. 

    What is environment variable and how do I use it?

    Sunday, July 27, 2014 4:06 PM
  • In the sample Verifying purchases through receipts.  It shows you how to get the application purchase receipt which includes the date the app was purchased.

    http://msdn.microsoft.com/en-us/library/windows/apps/jj649137.aspx

    Sunday, July 27, 2014 4:18 PM
  • Forgive me for my ignorance, but how will knowing the purchase date help me with this case?  The point is for me to know when the initial datetime of installation, trial or not.  During the trial, I want to give the user full access for 3 days before applying limited features mode.  If I store the original date of installation in the data folder or roaming or where ever, the user could simply go in and delete that file every 3 days. 

    I'm thinking there has got to be a way to know the datetime of original installation.  If you select a time limit, the app knows when to stop functioning no matter how many times the user tries to reinstall.

    Sunday, July 27, 2014 4:40 PM
  • My assumption is the app is free and you will be selling additional functions as in app purchases. The user will have full access to the additional functions for the first 3 days.  

    When you buy an app through the windows store it is installed right after it is purchased.   

    Sunday, July 27, 2014 5:03 PM
  • My assumption is the app is free and you will be selling additional functions as in app purchases. The user will have full access to the additional functions for the first 3 days.  

    When you buy an app through the windows store it is installed right after it is purchased.   

    No.

    The app is not free.  It does, however, have a free trial.  There is no time limit for the trial.  The trial itself has limited features.  In order to unlock all the features, the user need to buy the app.

    Recently, there's been a few people requesting me to make the trial full feature so they could try it out before they buy.  Ignoring the fact that they spend more in a coffee shop, I want to give them 3 days of full features while in trial mode.  After 3 days, I want the app to lock down certain features.

    The problem is I need to tell when they first installed the trial version.  Because if I store the info anywhere on their computer, all they have to do is go into the appdata folder and delete the stored info.  In other words, they could get full access forever without having to buy the app.

    People are so cheap nowadays.  I've had several people emailing me asking for me to make the app free.  It costs less than what you spend at starbucks.  Don't they care about quality?

    Sunday, July 27, 2014 8:18 PM
  • Hi Pete,

    Application settings allow you to store and retrieve property's and other information for your application dynamically basiclly you can store values that will be availalbe at next run. How to use environment variables :

    1. Right click your project 
    2. Then click properties 
    3. And go to the tab Settings
    4. If the project doesn't contain a default settings file create one :)
    5. Done! Create values and use them in your project. Accesing them is done by the class Settings, here's a example :
    Properties.Settings.Default.yourSetting /// You can acces your value by using the settings class
    
    ///Example of usage
    
    if(Properties.Settings.Default.AccountTimeLimitExpireDate < DateTime.Today)
    {
    Console.WriteLine("Your Account trial has expired.");
    }
    else
    {
    Console.WriteLine("Welcome to your still running trail.");
    }

    I hope i answered your questions :). If you need more help there's a full tutorial on the usbject on the msdn site. On the following page : "http://msdn.microsoft.com/en-us/library/aa730869%28v=vs.80%29.aspx". Sorry i couldn't add a link to the reply because my account isn't verifyed yet.

    Regards Bram Sinke

    P.S. Sorry for my late reaction :P






    Monday, July 28, 2014 12:39 PM