Reset Serial Number

  • Thread starter Thread starter Thom Little
  • Start date Start date
T

Thom Little

While developing the MSI setup for my C# winforms application in Visual
Studio .NET 2003 I experimented with the Serial Number and it now contains a
bogus value on my test machine.

This bogus serial number is faithfully being maintained on this test
machine.

How can I change or delete the serial number associated with this
application on this machine?

Is it as simple as am Orca tweak of the .msi file?
 
Hi Thom,

Thanks for posting.

To remove the serial number, we can uninstall the product. Apart from that,
I don't think we have any good way to change it using Windows Installer
APIs and it is not recommended to do so.

If you insist on changing it, you can try modifying the registry directly.
After the installation, the product ID, user name, company name will be
stored in Windows Installer's registry:

For per-machine installation, the information will be under the following
key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserD
ata\S-1-5-18\Products\<hash>\InstallProperties

For per-user installation:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserD
ata\<user's SID>\Products\<hash>\InstallProperties

Note that modifying the registry directly is not documented or supported.
You may use the approach at your own risk.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Felix:

Thank you for the (as usual) very helpful information.

Under the heading of "but the light is so much better over here" ...

The information is not being maintained across an uninstall as I originally
thought. The uninstall deletes the Registry key and validation is again
permitted.

What was happening was that I had a %%%%%% field and the test key I was
using was not passing the validation test. This gave the appearance of
retaining the key when in fact it was simply caused by my selection of
arbitrary serial numbers.

Is there an easy way to determine the "<hash>"?
 
Hi Thom,

As I mentioned in another post under the "csharp" newsgroup, you may have
some misunderstanding here. Please refer to the following link:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/ht
ml/vxgrfserialnumbertemplateproperty.asp?frame=true

"For example, setting the SerialNumberTemplate property to "<### - %%%%>"
creates two text boxes separated by a dash surrounded by spaces. Validation
for the first box (###) simply verifies that the user has entered three
digits. The second box (%%%%) is validated by an algorithm that adds the
digits together and divides the sum by 7.If the remainder is 0, validation
succeeds; otherwise, it fails."


Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Felix:

Yes I attempted to tell you exactly that in my last response. It is
operating correctly for me and I understand it.

Do you know of an easy way to get the value for the <hash>?
 
Hi Thom,

I am sorry that the information regarding the hash value is undocumented. I
can only say it is derived from the Product Code of the MSI here.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Hi Thom,

Please feel free to post here if you have any further concerns.

Have a nice day.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top