This website uses cookies. By clicking OK, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Serial number validation dll
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
Nicolasb
Pilgrim
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎Sep 18, 2007
10:21 AM
Serial number validation dll
Hi,
I want to create my own dll to validate the serial number entered in the CustomerInformation dialog. Where should I put the dll in the project (SUPPORTDIR?) and how do I call it through a custom action ?
I searched the website about this problem and I only found information related to InstallShield 2008 Express (here) and I did not found the field the authors refers to.
Thanks,
I want to create my own dll to validate the serial number entered in the CustomerInformation dialog. Where should I put the dll in the project (SUPPORTDIR?) and how do I call it through a custom action ?
I searched the website about this problem and I only found information related to InstallShield 2008 Express (here) and I did not found the field the authors refers to.
Thanks,
17 Replies
gridman
Pilgrim
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎Sep 18, 2007
01:52 PM
Re: Serial number validation dll
Since a DLL is really an assembly, then it may need to be placed in its own component (with nothing else in the component).
I think what you are saying would work. You would want to create an InstallScript custom action and first load the DLL, call the serial number validation function, then unload the DLL.
I think some people place a Validate button in the CustomerInformation dialog. When the user clicks the button, you have a DoAction behavior on the Validate button that calls the custom action. You would also attach a condition to the Next button that the user can't move forward until he has validated the serial number. You could do this by checking if a property has been set (your validate function would set the property if the validation has passed).
I think what you are saying would work. You would want to create an InstallScript custom action and first load the DLL, call the serial number validation function, then unload the DLL.
I think some people place a Validate button in the CustomerInformation dialog. When the user clicks the button, you have a DoAction behavior on the Validate button that calls the custom action. You would also attach a condition to the Next button that the user can't move forward until he has validated the serial number. You could do this by checking if a property has been set (your validate function would set the property if the validation has passed).
Nicolasb
Pilgrim
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎Sep 18, 2007
02:00 PM
Re: Serial number validation dll
Thanks, I've already implemented something to validate the serial number on the next button event. About the idea of putting the DLL in a component I'll try it, but how would I acces it at run-time ? The components are not copied to disk yet at this moment during the installation.
gridman
Pilgrim
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎Sep 18, 2007
02:37 PM
Re: Serial number validation dll
I don't understand your question.
If you put the DLL in a component, and attach no conditions to it (the component), and point the component destination to say [INSTALLDIR], then there is no reason why it wouldn't be copied to your target folder upon installation.
If you put the DLL in a component, and attach no conditions to it (the component), and point the component destination to say [INSTALLDIR], then there is no reason why it wouldn't be copied to your target folder upon installation.
gridman
Pilgrim
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎Sep 18, 2007
03:26 PM
Re: Serial number validation dll
Pardon me, I made a mistake. What you said makes perfect sense.
So then, you are correct. You would need to place the DLL in the SupportFiles/Language Independent folder. That is where the files will be extracted to during the installation. Then in the custom action, you would build a path to the DLL using the SUPPORTDIR variable.
How about that?
So then, you are correct. You would need to place the DLL in the SupportFiles/Language Independent folder. That is where the files will be extracted to during the installation. Then in the custom action, you would build a path to the DLL using the SUPPORTDIR variable.
How about that?
Nicolasb
Pilgrim
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎Sep 18, 2007
03:33 PM
Re: Serial number validation dll
Ok Good! I should install the files in the SUPPORTDIR. That was my first question.
Now, the second part of my question. How may I call the DLL via a Custom Action ? I can launch a CA at the right moment during install, but I can't make that CA to launch a dll stored in SUPPORTDIR.
Now, the second part of my question. How may I call the DLL via a Custom Action ? I can launch a CA at the right moment during install, but I can't make that CA to launch a dll stored in SUPPORTDIR.
gridman
Pilgrim
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎Sep 18, 2007
03:41 PM
Re: Serial number validation dll
First I would probably create an InstallScript function in the InstallScript view. Call it something like ValidateSerialNumber. At this point you could make it an empty function. Just a frame so you could create the custom action.
Then create an InstallScript custom action that uses the ValidateSerialNumber function.
If you placed a Validate button in the CustomerInformation dialog, then you would need to go to the Dialogs view, expand the CustomerInformation dialog, click Behaviors, then click on the Validate button. Then create a DoAction event with the argument ValidateSerialNumber and a Condition of 1. So, when the user clicks the Validate button, the custom action will be called.
Now, go back to the ValidateSerialNumber InstallScript function, call UseDll() to load the DLL, then call the validate function in your DLL, then call UnUseDLL() to unload the DLL, and pass the result back to the installer. Maybe create a property and set the property based on the result of the validate function, then don't let the user go forward (when hitting Next), until the property is set to the correct value.
Something like that.
Then create an InstallScript custom action that uses the ValidateSerialNumber function.
If you placed a Validate button in the CustomerInformation dialog, then you would need to go to the Dialogs view, expand the CustomerInformation dialog, click Behaviors, then click on the Validate button. Then create a DoAction event with the argument ValidateSerialNumber and a Condition of 1. So, when the user clicks the Validate button, the custom action will be called.
Now, go back to the ValidateSerialNumber InstallScript function, call UseDll() to load the DLL, then call the validate function in your DLL, then call UnUseDLL() to unload the DLL, and pass the result back to the installer. Maybe create a property and set the property based on the result of the validate function, then don't let the user go forward (when hitting Next), until the property is set to the correct value.
Something like that.
gridman
Pilgrim
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎Sep 18, 2007
03:44 PM
Re: Serial number validation dll
I've thought about this a lot because I had to do the same thing for my own project. This seemed like the best way to go.
Other people may have other ideas.
Other people may have other ideas.
klacounte
Pilgrim
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎Sep 18, 2007
04:33 PM
Re: Serial number validation dll
Nicholasb, if you're using a Windows Installer based project you can just put the DLL in the Binary table then the Windows Installer will handle the extract & loading of your DLL.