Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Creating a setup with expiry date ?

Creating a setup with expiry date ?

Scheduled Pinned Locked Moved C#
questioncsharptoolsworkspace
11 Posts 9 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S sarang_k

    Hi all, I am creating the setup for my windows application,i want to include the expiry date for it that means whenever the setup is installed it should run for the 30 days after installation. How can i do it ? Is there any script in c# ? Thanks in advance.

    P Offline
    P Offline
    Pete OHanlon
    wrote on last edited by
    #2

    The way you could tackle this requires quite a bit of infrastructure you probably haven't got in place yet. Basically, when your application starts for the first time you would register it on a remote server (use a web service for this, and generate a unique ID for the app). Using this ID, every time the application is run, compare the expiry date with the current date at the remote server and return whether or not the application is run. The advantage of this approach is that it takes into account the user resetting their system clock trying to circumvent the time check.

    Forgive your enemies - it messes with their heads

    "Mind bleach! Send me mind bleach!" - Nagy Vilmos

    My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

    S 1 Reply Last reply
    0
    • P Pete OHanlon

      The way you could tackle this requires quite a bit of infrastructure you probably haven't got in place yet. Basically, when your application starts for the first time you would register it on a remote server (use a web service for this, and generate a unique ID for the app). Using this ID, every time the application is run, compare the expiry date with the current date at the remote server and return whether or not the application is run. The advantage of this approach is that it takes into account the user resetting their system clock trying to circumvent the time check.

      Forgive your enemies - it messes with their heads

      "Mind bleach! Send me mind bleach!" - Nagy Vilmos

      My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

      S Offline
      S Offline
      Subin Mavunkal
      wrote on last edited by
      #3

      Disadvantage for this strategy is that user must have a network connection which is always connected.

      R 1 Reply Last reply
      0
      • S Subin Mavunkal

        Disadvantage for this strategy is that user must have a network connection which is always connected.

        R Offline
        R Offline
        Reiss
        wrote on last edited by
        #4

        or at a site that blocks it (corporate firewalls etc)

        L 1 Reply Last reply
        0
        • S sarang_k

          Hi all, I am creating the setup for my windows application,i want to include the expiry date for it that means whenever the setup is installed it should run for the 30 days after installation. How can i do it ? Is there any script in c# ? Thanks in advance.

          D Offline
          D Offline
          DaveyM69
          wrote on last edited by
          #5

          These may be a bit of overkill for your requirements but have a look at these articles of mine: DateValidator using SNTP[^] An SNTP Client for C# and VB.NET[^]

          Dave
          Binging is like googling, it just feels dirtier. Please take your VB.NET out of our nice case sensitive forum. Astonish us. Be exceptional. (Pete O'Hanlon)
          BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

          S 1 Reply Last reply
          0
          • R Reiss

            or at a site that blocks it (corporate firewalls etc)

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #6

            Or they wireshark the "it's ok, run" response from the server, redirect the server domain to localhost, and then run the program forever using a fake server. Or they'll just remove that check from the program, which is probably a lot simpler.

            P 1 Reply Last reply
            0
            • D DaveyM69

              These may be a bit of overkill for your requirements but have a look at these articles of mine: DateValidator using SNTP[^] An SNTP Client for C# and VB.NET[^]

              Dave
              Binging is like googling, it just feels dirtier. Please take your VB.NET out of our nice case sensitive forum. Astonish us. Be exceptional. (Pete O'Hanlon)
              BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

              S Offline
              S Offline
              Subin Mavunkal
              wrote on last edited by
              #7

              Better way is something like writing a hidden entry in registry or somewhere else.Keep updating the time at some events.Check whether the user is tampering with system Date , if he is doing some trick like this, expire the appln.Else run it for 30 days.

              K 1 Reply Last reply
              0
              • L Lost User

                Or they wireshark the "it's ok, run" response from the server, redirect the server domain to localhost, and then run the program forever using a fake server. Or they'll just remove that check from the program, which is probably a lot simpler.

                P Offline
                P Offline
                PIEBALDconsult
                wrote on last edited by
                #8

                Or share the ID amongst several installations.

                1 Reply Last reply
                0
                • S sarang_k

                  Hi all, I am creating the setup for my windows application,i want to include the expiry date for it that means whenever the setup is installed it should run for the 30 days after installation. How can i do it ? Is there any script in c# ? Thanks in advance.

                  P Offline
                  P Offline
                  PIEBALDconsult
                  wrote on last edited by
                  #9

                  It's not worth the trouble. Just write the first version of the application, give it away for free, and see whether or not anyone likes it. If it becomes popular, maybe see about adding such things for version two. If not, at least you didn't waste your time.

                  1 Reply Last reply
                  0
                  • S sarang_k

                    Hi all, I am creating the setup for my windows application,i want to include the expiry date for it that means whenever the setup is installed it should run for the 30 days after installation. How can i do it ? Is there any script in c# ? Thanks in advance.

                    B Offline
                    B Offline
                    BobJanova
                    wrote on last edited by
                    #10

                    I would write a registry value somewhere non-obvious on first use of the application with an encoded timestamp in it. You could also write an opaquely-named file into a system folder but since UAC it is not a given that you will be allowed to do that. Any check of this kind you put on your application, particularly if it's written in .Net, will be pretty easy to find and remove, so don't put a lot of effort into it. But this kind of simple check is sufficient to tell people you'd rather they paid, and to protect the app from the vast majority of lazy users. That said, you should strongly consider releasing software for free these days. Payware stands a good chance of turning people away, and the goodwill and potential future work you get from a quality free tool may well be worth more than the limited number of sales you'll get. And there's no need to try to protect free stuff.

                    1 Reply Last reply
                    0
                    • S Subin Mavunkal

                      Better way is something like writing a hidden entry in registry or somewhere else.Keep updating the time at some events.Check whether the user is tampering with system Date , if he is doing some trick like this, expire the appln.Else run it for 30 days.

                      K Offline
                      K Offline
                      Keith Barrow
                      wrote on last edited by
                      #11

                      This isn't a better way, just another way. It also isn't secure, it is possible to download free registry watchers to see what is being changed. Checking whether the system date has changed is a problem too, as this can be done via the BIOS. For .net apps there is no 100% way to secure against tampering, the best you can hope for is to stop the majority of users.

                      Sort of a cross between Lawrence of Arabia and Dilbert.[^]
                      -Or-
                      A Dead ringer for Kate Winslett[^]

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups