PC Review


Reply
Thread Tools Rating: Thread Rating: 5 votes, 3.40 average.

Re: How to Retrieve Install Serial Number

 
 
Wilson, Phil
Guest
Posts: n/a
 
      8th Jan 2010
Assuming Visual Studio installers do the standard thing, use
MsiGetProductInfo and ask for "ProductID", as here:

http://msdn.microsoft.com/en-us/library/aa370130(VS.85).aspx

Or (again assuming standard behavior) the key is associated with the PIDKEY
property, so you can write [PIDKEY] to the registry using the setup
project's IDE.

--
Phil Wilson
The Definitive Guide to Windows Installer
http://www.apress.com/book/view/1590592972


"John Whitworth" <sexyjw@g_EEEEEEEEEEEEEEEE_mail.com> wrote in message
news:4b475da7$0$2474$(E-Mail Removed)...
> Hi All,
>
> No - I'm not after a serial number to crack VS2008. I have a legit copy
> already working.
>
> What I want to know is whether I can get hold of the Serial Number that I
> can force a user to enter during setup (Customer Information screen on
> standard VS installer) from within my application, so that I can perform
> some simple validation upon it each time my application runs. I know it
> won't be very secure, but it's just a mild deterrent for a low-value piece
> of software.
>
> I searched on the obvious keywords, and just received tons of warez
> sites - not surprisingly!
>
> Cheers
>
> JW


 
Reply With Quote
 
 
 
 
Phil Wilson
Guest
Posts: n/a
 
      9th Jan 2010
I checked a VS 2008 setup project - the serial number does in fact use the
PIDKEY property, and goes through the validation as here:

http://msdn.microsoft.com/en-us/library/aa370826(VS.85).aspx

so that MsiGetProductInfo() should work. I just tried this on a test setup
and it worked fine, retrieving the entered serial, C++:

DWORD bLen=256;
WCHAR buf [256] = {0};
UINT res = MsiGetProductInfo (L"{05E6800C-619C-44FB-A5CE-B40677CFE5B8}", //
ProductCode
L"ProductID",
buf, &bLen);

--
Phil Wilson

"John Whitworth" <sexyjw@g_EEEEEEEEEEEEEEEE_mail.com> wrote in message
news:4b485d48$0$2529$(E-Mail Removed)...
>
>
> "Wilson, Phil" <(E-Mail Removed)> wrote in message
> news:5B236C0F-1020-4668-AABF-(E-Mail Removed)...
>> Assuming Visual Studio installers do the standard thing, use
>> MsiGetProductInfo and ask for "ProductID", as here:
>>
>> http://msdn.microsoft.com/en-us/library/aa370130(VS.85).aspx
>>
>> Or (again assuming standard behavior) the key is associated with the
>> PIDKEY property, so you can write [PIDKEY] to the registry using the
>> setup project's IDE.

>
> Thanks Phil. I tried to do both of those things last night, and got
> horribly lost. I will investigate further later on.
>
> JW



 
Reply With Quote
 
 
 
 
Jamesb
Guest
Posts: n/a
 
      10th Jan 2010
So one more
> question...can I get my application to be aware of when it's running
> within VS? So that when my validation is in place, I don't get 'invalid
> Product ID" every time I run?


You can use the System.Diagnostics.Debugger.IsAttached property:

http://msdn.microsoft.com/en-us/libr...sattached.aspx


Or use the DEBUG pre-compiler constant. e.g.

#If DEBUG Then
' Don't do your Product Id Check
#Else
' Do your Product Id Check Here
#End If

Both approaches come in useful.

Another handy thing is the Debug.Assert statement.

You can code something like:

Debug.Assert(DebugLogging())

The function DebugLogging will the only be called in debug mode. When
the code is built in release mode it won't be called.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How to Retrieve Install Serial Number Gregory A. Beamer Microsoft Dot NET 1 11th Jan 2010 06:41 PM
Determine USB HDD Serial Number (NOT Volume Serial!) Connah Storage Devices 5 21st Jun 2007 04:42 PM
Determine USB HDD Serial Number (NOT Volume Serial!) Matthew Connor Microsoft VB .NET 6 20th Jun 2007 05:40 PM
Determine USB HDD Serial Number (NOT Volume Serial!) Connah Windows XP Hardware 1 20th Jun 2007 08:02 AM
How to retrieve serial number of OS or CPU for copy protection? Klaus Bonadt Microsoft Dot NET Framework 84 26th Sep 2005 04:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:35 PM.