Home arrow C# arrow Page 12 - Creating a .NET Windows Installer Part 1
C#

Creating a .NET Windows Installer Part 1


In this article, Matthew MacDonald considers how to use VS.NET to build a simple setup program for a .NET desktop application.

Author Info:
By: Wrox Team
Rating: 4 stars4 stars4 stars4 stars4 stars / 118
March 06, 2003
TABLE OF CONTENTS:
  1. · Creating a .NET Windows Installer Part 1
  2. · Article
  3. · Introducing the Windows Installer Service
  4. · The Sample Project
  5. · Creating the Windows Installer Project
  6. · The Setup Designers
  7. · Adding Files, Project Outputs, and Shortcuts
  8. · Support Files and Project Outputs
  9. · Shortcuts
  10. · Customizing the User Interface
  11. · Abstract
  12. · Article
  13. · Introducing the Windows Installer Service
  14. · The Sample Project

print this article
SEARCH DEVARTICLES

Creating a .NET Windows Installer Part 1 - Article
(Page 12 of 14 )

You can use the serial number template (the SerialNumberTemplate property in the Customer Information window) to prevent a user from installing your application without a valid serial number. The template also determines how the serial number is formatted. However, you cannot directly validate serial numbers. Instead, you must use the template-based validation routines built into the Windows Installer product, which may not be adequate for all applications.

To start, the SerialNumberTemplate is bracketed by "greater than" and "less than" signs (< and >) so the characters do not appear directly in the text box. You can also use the dash character to separate the serial number into more than one text box.

In the template itself, you can use the following characters:

  • # requires a digit, but does not perform additional validation.
  • ? requires an alphanumeric character, but does not perform additional validation.
  • ^ requires an uppercase character or a digit, but does not perform additional validation.
  • % requires a digit that will be used by the built-in validation algorithm.
  • ? requires an alphanumeric character that will be used by the built-in validation algorithm.

Any other character is treated as a literal (required) constant. The validation algorithm (for % and ?) is built into the Windows Installer service. It adds up all the digits, and divides them by 7. If the remainder is 0 validation succeeds, otherwise it fails.

The FontViewer setup uses the template <%%D-##-##>, which uses three textboxes. The last four characters must be digits, the third character must be D, and the sum of the first two digits must be divisible by 7. (A valid code is 77D-00-00).


blog comments powered by Disqus
C# ARTICLES

- Introduction to Objects and Classes in C#, P...
- Visual C#.NET, Part 1: Introduction to Progr...
- C# - An Introduction
- Hotmail Exposed: Access Hotmail using C#
- Razor Sharp C#
- Introduction to Objects and Classes in C#
- Making Your Code CLS Compliant
- Programming with MySQL and .NET Technologies
- Socket Programming in C# - Part II
- Socket Programming in C# - Part I
- Creational Patterns in C#
- Type Conversions
- Creating Custom Delegates and Events in C#
- Inheritance and Polymorphism
- Understanding Properties in C#

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials