Page 1 of 1

How does the Serial Number in Setup and Deployment work? Setup and Deployment has a Serial Number that you can use, this will e Rate Topic: ***** 1 Votes

#1 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 290
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Post icon  Posted 10 November 2009 - 02:03 AM

In this Tutorial i will explain how the serial number in Setup and Deployment works.

I am using Visual Studio 2008 Professional but it's also applicable to Visual Studio 2005

This Tutorial is will not be applicable for Express Versions as they do not support Setup and Deployment

To start off with let me explain what it can do and what not.

The Serial number in Setup and Deployment projects allows you to add a serial number to your Setup and Deployment Project. The user is required to enter the Serial Number to complete the Setup. However a serial number can be given to another person and he can install the Application with the same serial number. You cannot have any non-numeric values in this Method.

How to begin

Start Visual Studio 2008 and Create a new Project, Call it "TestApplication".

Save the Project and Build it.

We will just have the "Form1" in our "TestApplication", since this tutorial is not about designing an application but rather creating a Setup for it.

Adding the Setup and Deployment Project

In your Solution Explorer, right click on the Solution (the very first item in the list) and select "Add" and "New Project".

Locate the "Other Project Types" in the "Project Types" list on the left and select "Setup and Deployment".

Select "Setup Project" in the Templates Window and call the Project "SetupTestApplication".

Save the Solution and Build the Solution.

Modify the Setup and Deployment Project

Right, now we should have 2 Projects in our Solution, the first one is the "TestApplication". This is the Project we want our Setup Program to Install.

In Order for the Setup Project to know what to install, we will have to add it to the "SetupTestApplication".

So, Locate the "SetupTestApplication" in the Solution Explorer and Right Click on it.

Select "Add" and "Project Output".

In the "Add Project Output Group" make sure the "TestApplication" is selected under "Project" and that "Primary Output" is Selected. Click on "Ok".

Now Click on the "SetupTestApplication" in the "Solution Explorer" window.

Now notice a few new icons just on top of the "Solution Explorer". If you hover your mouse over them, there is one that says "User Interface Editor". Click on it.

You will now see a window with a tree of actions that the Setup and Deployement project will take for the setup.

There are 2 Main Nodes ("Install" and "Administrative Install").

Now Right Click on "Start" under the "Install" Node.

Click on Add Dialog.

Now Select the "Customer Information" dialog and click on "Ok".

Next, we will have to make sure that the "Customer Information" will show just after the "Welcome" Screen. So if it's not located there, click and drag it to that it's just under the "Welcome" Node.

Next make sure that the "Customer Information" Node is seleced (click on it to select it).

Now let's have a look at the Properties of the "Customer Information" Node. You should see "BannerBitmap", "SerialNumberTemplate", "ShowOrganization" and "ShowSerialNumber".

Make sure that the "ShowSerialNumber" is set to "true".

Now let's analyze the "SerialNumberTemplate"

By default its set to "<###-%%%%%%%>". The hashes (#) are any value not being analyzed by the installer. The percentages (%) are analyzed by the installer.

So what does the installer do with the values at the (%) sign? The installer adds all the values of the "%" sign(s) position and devides them by 7. If the remainder is 0, it passes the test. The values for the "#" sign are ignored but are still a number/needs to be a number

So, say for instance a user types in the following serial number "111-1111111".

Add all the ones (1) together at the (%) sign and devide them by 7, the remainder is 0 and so it passes.

So let's change the "SerialNumberTemplate" to "<###-%##%-#%%#-####-%%%%>"
We now have 8 numbers that must be filled in (8x "%") and its a little bit more secure.

Testing

So now let's test the whole thing.

First Save the Solution and Build it.

Next Right Click the "SetupTestApplication" and select "Build".

Once its Finished, Right Click the "SetupTestApplication" and select "Install".

You will now be able to install the Application and should see the Welcome Screen, Click Next and the screen with the serial number will show.

To test, enter some rubbish number into the 5 Text Boxes for the Serail Numbers. Most likely it will fail.

But a number like 123-2342-8227-7643-2211 will pass. Interprated the number looks like this

###-2##2-#22#-####-2211

Add them together and you will get 14. Devide 14 by 7 and the remainder is 0.

Things to consider

This is not a very secure method as nubmer swopping can be done, someone even might paste his serial number on the net. You are not able to change the algorythm, just the sort order of the digits and adding/removing digits.

If you change the sort order, existing clients will not be able to use their serial number and thus can not install an update/upgrade and a new serail number needs to be issued.

This is the end for now.

Is This A Good Question/Topic? 0
  • +

Replies To: How does the Serial Number in Setup and Deployment work?

#2 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 290
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Posted 16 November 2009 - 06:55 AM

Hey Everyone,

Here are the rest of the "SerialNumberTemplates"

Character Meaning

# - Requires a digit that will not be included in the validation algorithm.

% - Requires a digit that will be included in the validation algorithm.

? - Requires an alphanumeric character that will not be included in the validation algorithm.

^ - Requires an uppercase or lowercase character. Numeric digits are not valid here.

< - Any characters to the left of this character will not be visible in the dialog box.

> - Any characters to the right of this character will not be visible in the dialog box. Required as a terminator if the < character is used.
Was This Post Helpful? 0
  • +
  • -

#3 Guest_david beckham*


Reputation:

Posted 19 April 2010 - 12:40 AM

is there any other way to add a serial number requirement window in setup & deployment project?
Was This Post Helpful? 0

#4 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 290
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Posted 21 April 2010 - 11:40 AM

Hi,

None that I know of, you might want to check out 3rd party software that can do that for you or, you can have the user activate you software once it opens... This way it will not ask for a serial key on the setup screen though...
Was This Post Helpful? 0
  • +
  • -

#5 clntnco  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 15-December 08

Posted 07 May 2010 - 04:32 PM

Does the setup program add needed reg keys or does the main program need to do that?
Was This Post Helpful? 0
  • +
  • -

#6 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 290
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Posted 09 May 2010 - 01:41 PM

Yes, the setup and deployment project can add registry keys, but most probably not related to the serial key you can define...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1