Testing software with different versions of IE and Windows

September 18, 2008

This post is not about profoundly new information, but it is so extremely valuable that I can’t image anyone not taking advantage of it.  And, its free!

Microsoft makes testing your software on various editions of Windows, and with various versions of IE so much easier by their continued support for making time-limited versions of their OS and other applications available for free.  They do this via their Virtual PC platform. 

At any time I have tried, I just go to their Virtual PC downloads section, and get a virtual hard disk copy of one of the available versions of the OS, download it, and within about 30 minutes, I am running my software on a completely clean installation of windows, and whatever browser I am targetting.

You first need a copy of the Virtual PC software, which MS has made available for free (!).

Get it at:

http://www.microsoft.com/windows/products/winfamily/virtualpc/default.mspx

Then you need to download an image of the OS.  At the time of this writing, there are 4 Operating System images available on the following page: http://www.microsoft.com/downloads/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&displaylang=en

The exact ones available changes, so just seach for “VPC Image”, and you’ll find a few.  I found TFC and SQL server images, which could also be useful for testing.

This has made testing Serial Key Maker a much more certain process.  I can install on clean systems, and muddy the water as much as I like and see how my installation process goes, and how my program runs.

For example, I develop on a beefy Vista machine.  However, I have just about all the security settings turned way down, and run as an administrator.  I forget all the things I have turned off to be able to develop efficiently.  So, to get a good sense of how my applications will run on a vanilla (a.k.a locked down) Vista install, I just fire up the VPC and run my new version.

I have found and fixed tons of unobvious but annoying bugs this way.  I’d honestly pay for the ability to do what Microsoft is (currently) giving out for free.


Show and Tell

September 10, 2008

I originally planned to have version 3.0.0.1 available by the end of August, and I have been reluctant to post about it in favor of getting it done.  (Also, it forces me to admit that I am late!)

Unfortunately I am still not done.  I underestimated the number of problems I would run in to, and how long it would take to fix them.  I will post about some of the issues I found and how I solved them in a later post.  This post is to provide some information on where I am, and what you can expect in the new version. 

I have finished the coding of the application and have fixed all known outstanding bugs.  I am now wrapping the application into a setup package which is proving to be a little more complicated that the previous versions.  This edition has some additional files that need to be deployed as part of my wrapper technology.

To recap, this version supports the ability to simply drag your file (any windows file – PDF, Word, Excel, EXE) onto my app, select a few customizations, and the app will generate a wrapper around your file.  My wrapper will handle the license key validation, so you need write no code!

Here it is in action:

4 steps to license key wrapping

4 steps to license key wrapping

Customizing the wrapper

Customizing the wrapper

The sample above takes a PDF document, wraps it with Serial Key Maker logic, and then produces an executeable (“How to Win at Amazon.exe”).  You then distribute this executeable to your paying customers, and provide them with a license key.  You do not need to write any code!

When they launch your application, the wrapper checks that they have a valid license, and if they do, opens the document.

User is presented with a screen to enter license key

User is presented with a screen to enter license key

 

I am very excited about this new feature.  I have had a lot of requests from people to implement this functionality, and I can’t wait to get it out there.

In addition to this change, I am revamping the Serial Key Maker web site.  It has a new look and I am going to add a message board so I can share answers with all users, and get more feedback on how to improve the product.

Here is a screenshot of what the front page will look like:

Click to see full

Click to see full

I am working furiously to get all this done…I’ll get it out as soon as I can, but I won’t release until I am confident it is good, so I don’t want to promise any more dates.

I’ll post here as soon as the new version is available.


Making it simpler…

August 11, 2008

One of my biggest design goals from the begining of Serial Key Maker was to make it as easy as possible to use.  I believe I got fairly close to that lofty goal.  However, some of the feedback I have been getting tells me I have more work to do.

The common theme in comments is that the user does not know where to start – or it is not as obvious as it could be.

To that end, I am making the following changes that will be implemented in the next release of Serial Key Maker:

Code Blocks: I am going to add code blocks to the VS IDE during installation.  These will be drag-n-drop blocks of code that the user will be able insert directly into their code that will give them a start in implementing Serial Key Maker.

No Code Option!  Starting with the next release of the Professional Version of Serial Key Maker, you will have the ability to implement license key protection and validation without writing a single line of code!

The way I am implementing this idea is via a “wrapper” that my application will create.  You will drag your application on to the Serial Key Maker client user interface, choose a few simple options, and click “Generate”.  Serial Key Maker will take your application and wrap it with the License Key Validation, and spit out a new EXE.You then distribute this new EXE to your users.  When it is launched, my wrapper will take care of looking for the license key, allowing the user to enter it and then validating that it is good.

The side effect of this is now users can implement license key protection for ALL windows based applications!  It does not matter if the application is written and compiled in C++, Java, or is even a Word, Excel or PDF document.  All of these can now be protected with Serial Key Maker’s implementation of License Key protection.

As mentioned this will only be avilable in the professional version of Serial Key Maker.

I am really excited about this change.  It opens up new potential users to Serial Key Maker, but more importantly, it gets closer towards my goal of “very easy to implement”.  As a bonus, it also gives non-developers a very easy way to protect their electronic intelectual property too!

I expect to get the next version tested and out by the end of August.


Pricing Change with 2.1.0.1

July 11, 2008

 

I have decided to release 3 versions of Serial Key Maker.  I will sell a LITE version, a Standard Version and a Professional Version. 

The Lite version ($49) will be a stripped down version of Serial Key Maker with just the basic functionality.  The Standard version ($99) is pretty much the same as the current version and the Professional Version ($199) is the version that contains the new functionality. 

Here is the breakdown of the functionality of each Version:

DEMO Version

Price: Free, valid for 30 days.

  1. Can NOT create unlimited duration keys.
  2. Limited keys generated in the demo version can be valid for a maximum of 14 days.
  3. CAN create up to 10 keys when creating keys in bulk-create mode.
  4. CAN use the new “Limit Features” functionality.
  5. CAN create machine specific keys.
  6. CAN use the “Freeform Text” functionality
  7. Can NOT use the Encrypt Text utility.

LITE Version

Price: $49, 30 days free support
Upgrade Price: N/A
Support Fees: $5 per year

  1. Can create unlimited duration keys.
  2. Limited keys generated in the LITE version can be valid for a maximum of 14 days.
  3. Can only create 1 key at a time.  No bulk key functionality.
  4. Can NOT use the new “Limit Features” functionality.
  5. Can NOT create machine specific keys.
  6. Can NOT use the “Freeform Text” functionality
  7. Can NOT use the Encrypt Text utility.

STANDARD Version

Price: $99, 30 days free support
Upgrade Price: Upgrade from LITE is $69
Support Fees: $30 per year

  1. CAN create unlimited duration keys.
  2. Limited keys generated in the STANDARD version can be valid for a maximum of 360 days.
  3. Can create up to 500 keys when creating keys in bulk-create mode.
  4. Can NOT use the new “Limit Features” functionality.
  5. Can NOT create machine specific keys.
  6. Can NOT use the “Freeform Text” functionality
  7. CAN use the Encrypt Text utility.

PROFESSIONAL Version

Price: $199, 30 days free support
Upgrade Price: Upgrade from STANDARD is $110, and from LITE is $160
Support Fees: $45 per year $199

  1. CAN create unlimited duration keys.
  2. Limited keys generated in the PROFESSIONAL version can be valid for a maximum of 360 days.
  3. Can create 1000 keys when creating keys in bulk-create mode.
  4. CAN use the new “Limit Features” functionality.
  5. CAN create machine specific keys.
  6. CAN use the “Freeform Text” functionality
  7. CAN use the Encrypt Text utility.

I have also added some more robust descriptions in the application, and have added to the samples showing how to use the new functionality.

I am currently working on the changes to the website, and expect to release by 7/14/2008.


New Maintenance Policy

July 1, 2008

 

This is a reminder that effective July 1 2008 I have changed the maintenance policy pertaining to Serial Key Maker.  It works as follows:

  1. The purchase of Serial Key Maker comes with 30 days free email support.  This allows unlimited email correspondance in trouble shooting and implementing Serial Key Maker.  Additionally, if during that time a new version is released, the user may upgrade to the new version, and a new License Key will be issued and no additional charge.
  2. After the initial 30 day period, a yearly maintenance plan can be purchased for $30 per registered license per year.  Again, while under maintenance, email support is free as are software upgrades.

Bug fix patches are always free, regardless of maintenance status.

If you have any questions regarding the policy change, please do not hesitate to ask.


New Version (2.1.0.1) Coming!

July 1, 2008

 

Based on user feedback, I have implemented three new features in the next version of Serial Key Maker Professional.  I am finalizing the Beta and I expect have the new version ready for download by July 14th.  All users who have current maintenance pans are eligibile for a free upgrade!

I am changing the pricing model in this version.  There will be a “Basic” version and a “Professional” version.  The basic version will retain the functionality of the current version of Serial Key Maker.  The Professional version will include the 3 new features. I will release pricing information details in the near future.

Feature Locking

The first feature I have added is the abilty to provide a more granular level of limitation to the license keys.  In version 2.1.0.1 (Pro), you will be able to lock out up to 5 features in your product. 

Feature Locking

So, if you want to release various levels of your product (for example, a basic version, and a professional version) you can use the License Key you generated with Serial Key Maker Pro to lock the “Basic” users from the “Professional” functionality of your application.

I have intentionally simplified the Feature Locking system.  A fundamental design goal of Serial Key Maker is simplicity.

The features are simply named Feature Lock 1 through 5 in the UI and in the code.  The features lock and unlock in sequence.  That means, if you have Feature 3 unlocked then Feature 1 and Feature 2 are unlocked too.  If Feature 4 is locked, then so is Feature 5.

Benefits of Feature Locking:

  1. can lock up to 5 descrete functions within your application
  2. provides ability to create tiered pricing levels for your software based on functionality that is unlocked by different license keys you generate
  3. can maintain and deploy one set of code for all levels of users
  4. your users do not have to re-install when they upgrade

Machine Specific Keys

Also new is the ability to lock a license key to a particular user’s machine.  A number of users have requested the ability to have the benefit of knowing their software is running on one machine only.

Machine Keys and Descriptions

This option is neccessarily a little more complex to implement, but some users have deemed the extra effort worth it. 

When the Serial Key Maker API is installed with your application, it now generates a machine specific key – a key that uniquely identifies the user’s machine running your Serial Key Maker implemented software. 

Your application, or your user, then sends you that Machine Key via email, “phoning home” or whatever method is appropriate.  You then use that key with the Serial Key Maker UI to generate a Machine Specific Licence Key, which you then give to your user to unlock your software.

This method of license key maintenance is obviously more labor intensive – you cannot simply generate multiple keys and upload them to your payment processor.  You can only generate one key at a time per intended user machine – it makes no sense to mass produce keys intended for one machine.  There is some user or application round-trip time required to get the machine key to you so that you generate a key for your user.

Benefits of Machine Specific Keys:

  1. can lock your software to one user’s machine
  2. more control on who has access to your software

Disadvantages:

  1. lose some automation ability – cannot generate multiple keys per user
  2. User Impact: if your user re-installs their machine, or replaces their computer, they will need to be re-issued with a new license key

Freeform Text

The final feature is the ability add freeform text.  Users have requested the ability to add user demographic and/or freeform information with the License Key.  To get this to work, I have had to adjust the structure of the key generated.  So, when you have this option on, the license key generated will no longer be in the XXXX-XXXXX-XXXXX-XXXXX format, but will rather be in a long encrypted string format.  You will thus need to handle that appropriately in your application.  (For example is would be unrealistic to have your user type in the encrypted string into a validation box. However, you could provider them with a license file that contains the string, and that your application reads to validate the license.)

Note:  This field is NOT used in license key validation directly.  Internally, there is no check to ensure that the text inside the free form field is “Joe Smith”.  However, there is nothing stopping you doing that validation inside your application after you have requested your user to enter the neccessary information.

Typical usage of this feature is to store user specific credentials for use within your application.  For example, you could display the registered user’s name and license details in your application’s “About” page.

Benefits of Freeform Text: 

  1. can store more detailed information pertaining to the license key
  2. provides flexibility for storing descrete data elements along with the license key

Disadvantages:

  1. The key generated is a long encrypted string and is not as user friendly as the default License Key generated by Serial Key Maker.

In a future post, I will share some details on implementing the new features in your code with some sample code.  I will also discuss the new pricing model.

Update: Press Release: Feature Locking and Machine Locking now available in Serial Key Maker 2.1.0.1!


Date Bug!

June 25, 2008

I’ve been taking some time to clear up any bugs I have found in the UI part of the application.  So far most have been insignificant issues…like a label slightly off, or a font incorrectly sized.

However, a user recently reported a nasty bug I had no idea existed.  What happened was that no matter what number of days was selected for the license to be valid, it always ended up being 30 days.  So choosing a key to be valid for 1 day, caused a license key to be created for 30 days!  It looked like the application was adding 1 MONTH instead of 1 day.

My initial thought was that I had somehow botched the way that international dates were handled in my code.  In the US we list dates as MM/DD/YYYY, but in Europe and other countries it is handled as DD/MM/YYYY by default.

I recall being very careful about date handling when creating the API – it’s a cornerstone of the application, so I was really worried when this issue was reported to me.

I went through the date handling code in the API, and sure enough it looked to be done just right – no chance of any issues.  I verified this by running my unit tests, and by manually setting my PC to different timezones and regions.  I could not reproduce the problem.  However, this kind user sent me screenshots as proof, so I knew there was a real problem, and not some misunderstanding.

Then it occurred to me that I was testing this all in a *Registered* version of my UI and API.  Sure enough, when I switched to a DEMO version, I was able to reproduce the bug.  All License Keys generated were created for 30 days, no matter the UI “days valid” selection.

After this insight I very quickly found the offending code.  At some point in the recent past, I moved some code around that deals with the DEMO version of the application.  In DEMO mode, you cannot create unlimited keys, or keys that last more than 14 days.  In a previous iteration that limitation was 30 days.  By moving the code around, I inadvertently hard-coded the date range to be 30 days while in DEMO mode.

Very bad.  I apologize to all my potential users who were confused or frustrated by this.

I have fixed this bug, and released an updated install to my website.


Video Demonstrations

June 8, 2008

I created two video demonstrations on how to use Serial Key Maker.  They are located on my website, and I uploaded them to YouTube:

 

and

They are also available from my website: http://www.serialkeymaker.com/


Embedding

May 29, 2008

A huge concern for me when creating the install application for Serial Key Maker was making the installation process as error proof as possible.

If the installation process fails, or is clunky, my potential clients are never going to see the benefits my application has, and won’t trust it enough to hand over their money for it.

It thus became important for me to reduce the number of dependencies in the project. I wanted to reduce the complexity involved in getting the application working, and in referencing the API from their applications.

Recall, Serial Key Maker is made up of two related products. The GUI which allows the developer to generate product keys and the API which they use in their code to validate the product keys.

I had a logging object that encapsualtes error trapping and general logging functionality. It is used in both the GUI and in the API. I didn’t want to duplicate the logic in both places, so I made a separate DLL that both projects referenced.

+1 for code reuse

-2 for complexity

To reference my API to validate product keys, the developer had to include the logging DLL AND the API DLL into the project. A small thing, but I obcess on making this product SIMPLE to implement, and referencing TWO DLL’s feels like over-complication when one will suffice.

I explored various options:

  1. Duplicate the code in both places
  2. Embed the logging DLL into the GUI and the API projects.

There are trade off’s with each solution: duplication makes it more difficult to maintain the code. Using an embedded DLL, while elegant, turns out to be fairly slow performing.

I eventually decided to put the logic for logging into a separate class and use that class in each project. The duplication requires me to be carefull, but I figured it was more important to affect the user less.

I did learn by figuring out how to embed a DLL and get access to its methods, so the effort was not wasted. 

This post is a description of how to embed a DLL into a compiled application and then reference it via the application’s resource manifest.

To show how to use an embedded DLL, I have created a project that demonstrates the technique. [Download Embedding Sample Code]

Note: The sample solution was created with VS2008, and is written in VB.Net.

The Code Explained

 I have encapsulated most of the code we need to handle
Embedded DLL’s into a shared class. [EmbeddedAssemblyHelper.vb]

Step 1 – Embedd the DLL

The first thing to do is to embed the DLL into your project, and flag it to reside in the application’s resource data. Do the following:

  1. Right click on your project, and select “Add” and then “Exisiting Item”. Note: Do NOT use the “Add Reference” option
  2. Navigate to, and select, the DLL you want to embed. The DLL will show up in the file list of your application.
  3. Select the DLL in Solution Explorer, and open the property page for the DLL.
  4. The first property is “Build Action”. Change the drop down option to be “Embedded Resource”

 
Selecting the Build Action to Embed a DLL
Now when you compile your project, the DLL will be built into your binary file for use within your application

Step 2 – Initialize the Event Handler

When we reference the embedded DLL within the project, the framework will go through its regular discovery process to try find the DLL, and it will raise an error – it is not in any of its search locations (GAC, local etc).

We need to set up a handler to intercept this error.  To do that, make a call to the “Initialize” method.

Note: You need to call “Initialize” as early in your application’s startup as possible. Also, you cannot reference the embedded DLL in the same method you make the call to “Initialize”.

Initialize the event handler.

 Add a handler for the raised error.  Call the LoadEmbeddedAssembly method.

When the framework raises an error, we intercept it and run the “LoadEmbeddedAssembly” method.

The framework passes the name of the assembly it failed to resolve. We use that name (our Embedded Assembly) and load it manually.

We call out to the EmbeddedAssembly_LoadManually method, which then uses the “GetManifestResourceStream” method to extract the data embedded in our application’s resource data.

We then use that stream to create an Assembly by calling “System.Reflection.Emit.AssemblyBuilder.Load”

Make an Assembly.

Referencing the Embedded DLL

In the sample provided, I made a DLL (“GP_EmbeddedTestDLL”) that has a worker class (“classWorkerTest”). The class contains 3 complex methods that I will use to show the various ways to access the methods ont his embedded DLL

The code examples I found on the web that address this issue only showed the most basic way to call a method – methods that had no parameters, and returned no data.

I have made methods that contain parameters, and in one case returns a user defined data type (“GetPersonObject”).

Step 3.1 – Creating a Reference to the Embedded Assembly

Using reflection we do an Assembly load:

Load Assembly.

This triggers our event and returns our embedded assembly reference.

Step 3.2 – Create an Instance of the Assembly

Use the CreateInstance method on our assembly to create an instance of our object:

Create Instance of our Assembly.

Step 3.3 – Invoke the Method

3.3.1 The first example of a method to call has no paramters and returns a string (“GetCurrentTime”):

How to call GetCurrentTime - no parameters.

3.3.2 The second example of a method to call has a paramter (diameter) and returns a string (“CalculateCircumference”):

How to call CalculateCircumference - takes diameter as a parameter.

3.3.3 The last example of a method to call has multiple paramters and returns a user defined class. I made a “Person” object which is a class inside the “GP_EmbeddedTestDLL” object we embedded in our application. 

It is a class that has properties about the person, and is returned by the function call “GetPersonObject”.

  1. We invoke the method as usual, passing in the array of parameters.
  2. We then use the “GetProperty” on the type to get at the property values of the class returned.

How to access the properties on a returned class.

As mentioned, I decided not to use embedding in Serial Key Maker due to performance concerns I had, however, I think this is a powefult technique and will use it when it makes sense to do so.
I’d love to hear from anyone who is using this technique in their applications. Please email me at
grant@serialkeymaker.com

Thank you for reading,

Grant


Why do you need License Key Protection?

May 29, 2008

Do you want license key protection to stop hackers using your software for free? Or is it perhaps to stop competitors from reverse engineering your algorithms?

While understandable, these goals are futile for us developers.  .Net and its IL compiler makes it even more futile. No matter how much time and money you spend on obfuscation and License Key protection, there will always be someone with enough time and skill to bash and crack through it. If a computer can make sense of your code, so can a human.

My suggestion is that you should refocus your energy and redefine what you need out of License Key Protection.

As with all aspects of development, it becomes an issue of balancing cost versus benefit. You can spend many thousands (literally) of dollars on a Licensing System, and have
very very very good protection, making it very very very difficult to crack and reverse engineer, or obviously, you can do nothing, and make it easy to crack.

Somewhere in the middle is a solution for you and your software. As a Micro-ISV (my intended audience) you do not have a huge budget (or even a large one), you likely have a relatively in-expensive product (in the 20-100 dollar price range) and you are selling to regular (non-IT) people.

Your target users will find your product useful and will pay for it if asked. Unfortunately, most people will use it for free if allowed to do so. For the most part they won’t necessarily search hacker sites for a cracked version, but if they get a non-limited copy they will use it.

My opinion is that you do not need to spend hundreds (thousands) of dollars on a license key solution with all the bells and whistles. What you need is a solution that limits some of the juicy features of the product, and limits their usage for a certain amount of time. This becomes an opportunity to show your product to users, and get them hooked on its functionality, and then incent them to purchase it.

Your licensing solution should, therefore, be a marketing tool, not an anti-hacking tool. You are using it to put your product in front of people and make a sale.

You may be thinking that if this is all you need out of a licensing solution that you may as well roll your own solution. We all think like this. It’s how we became developers in the first place. However, as business people, we need to consider the real cost involved and weigh that against the benefits.

How long would it take to make a robust, error free license key solution? 20 hours is the absolute minimum, in my opinion – and I doubt it could be done even that quickly.

If your time is worth 65 to 150 dollars per hour ($1300-$3000), buying a robust solution in the price range of 100 to 200 dollars on the other hand seems like a great investment – one which would include support and maintenance, I might add. (Something to consider when your license solution breaks or needs to evolve)

Summary

  • you indeed need some form of licensing solution
  • you cannot get one that is uncrackable
  • you do not have to make it yourself
  • it does not have to be ultra expensive to be good

Thank you for reading,

Grant