PDA

View Full Version : Serial Numbers



NewsArchive
02-24-1998, 01:00 AM
I wrote to Install Shield with the following questions:
My application needs to be configured to the specific customer. To do
this, I want to read the serial number that the customer enters, during
the "User Information" dialog, and:
1. Set the default path in the "Destination Location" dialog.
2. Set the default Folder Name in the "Select Program Folder" dialog.
3. Create an ini file based on some key embedded in the serial number.
4. I would also love to set the "Application Name", "Company", and
"Main Title" (in the Visual Design of the Setup Checklist) dynamically,
but I realize that these settings get used before the "User Information"
dialog is displayed and the user enters the serial number. Can the
"User Information" Dialog be displayed FIRST?!
5. I also have to be able to verify the serial number and abort the
program if it is not acceptable. I imagine I will need to use an
extension to do this.

Sudhir from Install Shield wrote me the following:
=================================================
I am afraid the flexibilty you need in your project is almost impossible
to achieve in your project . This is because Express does not support
scripting like IS3 and IS5 . You can use an extension to validate the
serial number entered by the user , which will be present in the
registry under the project name key / version key , created under HKLM /
SOFTWARE . But it is not possible to return a value from the extension ,
which Express can use .
======================================

**Now I have the following ADDITIONAL questions:
1. What is the point of having a serial number entry dialog, if there
is no way to validate it during the install program? It appears that an
extension can be used to validate it, but if it is invalid, how does the
IS Express program know whether to terminate the install if the
extension cannot return a value? Or do I misunderstand Sudhir?
2. Finally, how does my extension know whether the user is running win
3.x or 95 and whether to look in the registry or some ini file? What
inifile does it look into for the serial number entered in the Express
"User Information" diaolg?

Thanks. Please cc me directly with any advice.
----------------------
amukamal@ix.netcom.com
Alan Mukamal
----------------------

NewsArchive
02-24-1998, 01:00 AM
Hi Alan,
In response to your additional questions:
1. You cannot return a value to Express (i.e. a string containing the
default path), however, you can return 0 to Express telling the installation
to terminate.

2. I'm not sure what is the best way to figure out the OS, but you could use
GetSystemInfo. The values will be placed in win.ini.
--
Rich
InstallShield Software Corp.


P.S. Our website, http://www.installshield.com/, covers a wide range of
resources for your installation development. Read technical whitepapers,
view documentation or search the Knowledge Base to get support information
24 hours a day, 7 days a week.

Alan Mukamal wrote in message <34F31858.5FE8@ix.netcom.com>...
>I wrote to Install Shield with the following questions:
> My application needs to be configured to the specific customer. To do
>this, I want to read the serial number that the customer enters, during
>the "User Information" dialog, and:
> 1. Set the default path in the "Destination Location" dialog.
> 2. Set the default Folder Name in the "Select Program Folder" dialog.
> 3. Create an ini file based on some key embedded in the serial number.
> 4. I would also love to set the "Application Name", "Company", and
>"Main Title" (in the Visual Design of the Setup Checklist) dynamically,
>but I realize that these settings get used before the "User Information"
>dialog is displayed and the user enters the serial number. Can the
>"User Information" Dialog be displayed FIRST?!
> 5. I also have to be able to verify the serial number and abort the
>program if it is not acceptable. I imagine I will need to use an
>extension to do this.
>
>Sudhir from Install Shield wrote me the following:
>=================================================
>I am afraid the flexibilty you need in your project is almost impossible
>to achieve in your project . This is because Express does not support
>scripting like IS3 and IS5 . You can use an extension to validate the
>serial number entered by the user , which will be present in the
>registry under the project name key / version key , created under HKLM /
>SOFTWARE . But it is not possible to return a value from the extension ,
>which Express can use .
>======================================
>
>**Now I have the following ADDITIONAL questions:
> 1. What is the point of having a serial number entry dialog, if there
>is no way to validate it during the install program? It appears that an
>extension can be used to validate it, but if it is invalid, how does the
>IS Express program know whether to terminate the install if the
>extension cannot return a value? Or do I misunderstand Sudhir?
> 2. Finally, how does my extension know whether the user is running win
>3.x or 95 and whether to look in the registry or some ini file? What
>inifile does it look into for the serial number entered in the Express
>"User Information" diaolg?
>
>Thanks. Please cc me directly with any advice.
>----------------------
>amukamal@ix.netcom.com
>Alan Mukamal
>----------------------

NewsArchive
02-25-1998, 01:00 AM
On Tue, 24 Feb 1998 10:58:32 -0800, Alan Mukamal <amukamal@ix.netcom.com>
wrote:
> 1. What is the point of having a serial number entry dialog, if there
>is no way to validate it during the install program? It appears that an
>extension can be used to validate it, but if it is invalid, how does the

You can actually validate that number after it has been written to the
registry. However it seems to me like your above requirements require you
to upgrade to InstallShield 5.1. The product is very expandable and is very
powerful.

>IS Express program know whether to terminate the install if the
>extension cannot return a value? Or do I misunderstand Sudhir?

Your extension can return a value. If the value is 0, Express aborts the
install, if it is 1, Express continues.

> 2. Finally, how does my extension know whether the user is running win
>3.x or 95 and whether to look in the registry or some ini file? What
>inifile does it look into for the serial number entered in the Express
>"User Information" diaolg?

The extension will not know what OS you are running. You will have to
launch the appropriate DLL. What I mean is this:

Your installation can only be 16-bit or 32-bit, but not both. If you are
running a 16-bit installation, your application (16-bit) will still use the
old style of ini-files, whether you are on Windows95/N or Windows 3.x. The
style doesn't change since a 16-bit application won't be able to use the
advanced features of the registry.

Stefan
ellipse data systems

NewsArchive
02-25-1998, 01:00 AM
Stefan wrote:

<The extension will not know what OS you are running. You will have to
launch the appropriate DLL. What I mean is this:

Your installation can only be 16-bit or 32-bit, but not both. If you are
running a 16-bit installation, your application (16-bit) will still use
the
old style of ini-files, whether you are on Windows95/N or Windows 3.x.
The
style doesn't change since a 16-bit application won't be able to use the
advanced features of the registry.>

Thanks. This explains a lot.

<raquino@installshield.com> wrote:

<In response to your additional questions:
1. You cannot return a value to Express (i.e. a string containing the
default path), however, you can return 0 to Express telling the
installation
to terminate.>

This also helps. I guess this is the best way to validate Serial
Numbers.

<2. I'm not sure what is the best way to figure out the OS, but you
could use
GetSystemInfo. The values will be placed in win.ini.>

According to Stefan above, Since my install app is 16bit, the pertainent
info will always be in the win.ini file, so knowing the OS is no longer
relevant.

Thanks for all the help, Alan

NewsArchive
02-26-1998, 01:00 AM
Alan Mukamal wrote:
>
> I wrote to Install Shield with the following questions:
> My application needs to be configured to the specific customer. To do
> this, I want to read the serial number that the customer enters, during
> the "User Information" dialog, and:
> 1. Set the default path in the "Destination Location" dialog.
> 2. Set the default Folder Name in the "Select Program Folder" dialog.
> 3. Create an ini file based on some key embedded in the serial number.
> 4. I would also love to set the "Application Name", "Company", and
> "Main Title" (in the Visual Design of the Setup Checklist) dynamically,
> but I realize that these settings get used before the "User Information"
> dialog is displayed and the user enters the serial number. Can the
> "User Information" Dialog be displayed FIRST?!
> 5. I also have to be able to verify the serial number and abort the
> program if it is not acceptable. I imagine I will need to use an
> extension to do this.

I don't think you can customize the installation at all based on the
serial number. What we do here for validating the serial number
is to use a DLL (written in Delphi) as an express extension.
This DLL asks the user for their serial number, instead of getting
ISX to do it. (This is because we need to ask the user for their
Name, School & Serial# (since it's educational software), not
their company.) If they enter their serial number correctly,
we write it to an INI file so the software can check it at runtime.
If not, we don't, and the software won't run. Unfortunately the
DLL from Delphi is quite big so it is run after the software
installation; this means that if they can't enter the serial
number and they hit cancel, they have to reinstall to try again.
But that's not so bad.


Hamish

NewsArchive
11-17-2000, 01:00 AM
Carol,
Don't feel bad. I do use C and trying to get this installation program
working makes me feel like an idiot.
You probably changed the length of the serial number string. If that is so
then edit the file "ValidateSN.h" and change this line
#define SERIALNUMBER_LENGTH 22
to the new length.

good luck.

Dave
"Carole Wulster" <cwulster@home.com> wrote in message
news:3a159a63@12.41.20.38...
> I am a Delphi Programmer. C is Greek. However I did get ValidateSN to work
> for one program installation. I cannot get it to work for a second
program.
> I have it compiled in C++ Debug Mode.
> I deleted the all the debug messages except for the ones for each field,
> therefore there is a message box regarding entry errors. I do not know how
> to write code for Dialog Boxes in C.
> I changed Field1, Field2 and Field3 successfully.
> The Installation recognizes the export and functions perfectly.
> For the second program, I changed Field1 and left the remainder the same.
I
> cannot get a Validation_Success...return of 1. I have no idea of what I am
> doing wrong.
> This can't be so hard.
> 24 hours on 'what' 40 lines of code? I am starting to feel pretty dense.
> Can someone help both me and the person who started this topic.
> Carole Wulster
>
>
> "David K" <koeberle@lucent.com> wrote in message
> news:3a1467e3@12.41.20.38...
> > I am using InstallShield Express 3.01
> >
> > I cannot get the next button to work after entering the serial number.
The
> > validate serial number function is now:
> >
> > return VALIDATION_SUCCESS;
> >
> > what am I doing wrong?
> >
> > Dave
> > koeberle@lucent.com
> >
> >
>
>

NewsArchive
11-17-2000, 01:00 AM
David,
I have both of them working now. I don't even know how. I didn't change the
lenght in either one. I did change the Field1 to another set of letter but
kept the 6 characters.
I also changed the way Field 2 and Field 3 are controlled but kept the same
number of characters.
My problem when I first started yesterday, was that I couldn't get past the
screen displayed the input.
Once I rem those lines, it works. This works in both debug and release.
I have no idea why. It really makes me nervous that I don't know why.

// #ifdef _DEBUG //Display Debug information
// CHAR szTmp[1024];
// wsprintf(szTmp, "szSerialNum=%s. \nField #1=%s \nField #2=%s \nField
#3=%s", szSerialNum, szField1, szField2, szField3);
// MessageBox(GetFocus(), szTmp, "Serial Number Debug Window", MB_OK);
// #endif
But then I couldn't get it to work for my second program Installation.
I finally had to change the Success to 1 Fail to 0 on the second ValidateSn.
I have no idea why it worked. I was looking for a 0 to begin with in my
second setup as a Success. I changed it to 1 and changed the 0 in the dll to
1 and the -1 to 0.
I hope this helps some. I think I am rambling at this point.
Let me know if you know why any of this is working. It really is scary not
knowing why.
Carole Wulster


"David K" <koeberle@lucent.com> wrote in message
news:3a15bafd$1@12.41.20.38...
> Carol,
> Don't feel bad. I do use C and trying to get this installation program
> working makes me feel like an idiot.
> You probably changed the length of the serial number string. If that is so
> then edit the file "ValidateSN.h" and change this line
> #define SERIALNUMBER_LENGTH 22
> to the new length.
>
> good luck.
>
> Dave
> "Carole Wulster" <cwulster@home.com> wrote in message
> news:3a159a63@12.41.20.38...
> > I am a Delphi Programmer. C is Greek. However I did get ValidateSN to
work
> > for one program installation. I cannot get it to work for a second
> program.
> > I have it compiled in C++ Debug Mode.
> > I deleted the all the debug messages except for the ones for each field,
> > therefore there is a message box regarding entry errors. I do not know
how
> > to write code for Dialog Boxes in C.
> > I changed Field1, Field2 and Field3 successfully.
> > The Installation recognizes the export and functions perfectly.
> > For the second program, I changed Field1 and left the remainder the
same.
> I
> > cannot get a Validation_Success...return of 1. I have no idea of what I
am
> > doing wrong.
> > This can't be so hard.
> > 24 hours on 'what' 40 lines of code? I am starting to feel pretty dense.
> > Can someone help both me and the person who started this topic.
> > Carole Wulster
> >
> >
> > "David K" <koeberle@lucent.com> wrote in message
> > news:3a1467e3@12.41.20.38...
> > > I am using InstallShield Express 3.01
> > >
> > > I cannot get the next button to work after entering the serial number.
> The
> > > validate serial number function is now:
> > >
> > > return VALIDATION_SUCCESS;
> > >
> > > what am I doing wrong?
> > >
> > > Dave
> > > koeberle@lucent.com
> > >
> > >
> >
> >
>
>

NewsArchive
12-07-2000, 01:00 AM
In the sample code header file, change the value of SUCCESS_RETURN to 2 (or
some other non zero value). Make sure you specify 2 as the expected return
value in IDE too.

"Carole Wulster" <cwulster@home.com> wrote in message
news:3a15dc8a$1@12.41.20.38...
> David,
> I have both of them working now. I don't even know how. I didn't change
the
> lenght in either one. I did change the Field1 to another set of letter but
> kept the 6 characters.
> I also changed the way Field 2 and Field 3 are controlled but kept the
same
> number of characters.
> My problem when I first started yesterday, was that I couldn't get past
the
> screen displayed the input.
> Once I rem those lines, it works. This works in both debug and release.
> I have no idea why. It really makes me nervous that I don't know why.
>
> // #ifdef _DEBUG file://Display Debug information
> // CHAR szTmp[1024];
> // wsprintf(szTmp, "szSerialNum=%s. \nField #1=%s \nField #2=%s \nField
> #3=%s", szSerialNum, szField1, szField2, szField3);
> // MessageBox(GetFocus(), szTmp, "Serial Number Debug Window", MB_OK);
> // #endif
> But then I couldn't get it to work for my second program Installation.
> I finally had to change the Success to 1 Fail to 0 on the second
ValidateSn.
> I have no idea why it worked. I was looking for a 0 to begin with in my
> second setup as a Success. I changed it to 1 and changed the 0 in the dll
to
> 1 and the -1 to 0.
> I hope this helps some. I think I am rambling at this point.
> Let me know if you know why any of this is working. It really is scary not
> knowing why.
> Carole Wulster
>
>
> "David K" <koeberle@lucent.com> wrote in message
> news:3a15bafd$1@12.41.20.38...
> > Carol,
> > Don't feel bad. I do use C and trying to get this installation program
> > working makes me feel like an idiot.
> > You probably changed the length of the serial number string. If that is
so
> > then edit the file "ValidateSN.h" and change this line
> > #define SERIALNUMBER_LENGTH 22
> > to the new length.
> >
> > good luck.
> >
> > Dave
> > "Carole Wulster" <cwulster@home.com> wrote in message
> > news:3a159a63@12.41.20.38...
> > > I am a Delphi Programmer. C is Greek. However I did get ValidateSN to
> work
> > > for one program installation. I cannot get it to work for a second
> > program.
> > > I have it compiled in C++ Debug Mode.
> > > I deleted the all the debug messages except for the ones for each
field,
> > > therefore there is a message box regarding entry errors. I do not know
> how
> > > to write code for Dialog Boxes in C.
> > > I changed Field1, Field2 and Field3 successfully.
> > > The Installation recognizes the export and functions perfectly.
> > > For the second program, I changed Field1 and left the remainder the
> same.
> > I
> > > cannot get a Validation_Success...return of 1. I have no idea of what
I
> am
> > > doing wrong.
> > > This can't be so hard.
> > > 24 hours on 'what' 40 lines of code? I am starting to feel pretty
dense.
> > > Can someone help both me and the person who started this topic.
> > > Carole Wulster
> > >
> > >
> > > "David K" <koeberle@lucent.com> wrote in message
> > > news:3a1467e3@12.41.20.38...
> > > > I am using InstallShield Express 3.01
> > > >
> > > > I cannot get the next button to work after entering the serial
number.
> > The
> > > > validate serial number function is now:
> > > >
> > > > return VALIDATION_SUCCESS;
> > > >
> > > > what am I doing wrong?
> > > >
> > > > Dave
> > > > koeberle@lucent.com
> > > >
> > > >
> > >
> > >
> >
> >
>
>