This website uses cookies. By clicking Accept, 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
- :
- Re: Basic MSI reading registry
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 25, 2011
11:23 AM
Basic MSI reading registry
Hi,
I am new to using Installshield 2011. I have been tasked to create an install project that verifies a serial key based on mac address of the computer. Since I am not too good at scripting I chose to use Basic MSI project. Since I had a C# application that checks for mac address and verifies a key, I chose to try to use this inside of the install project. So upon a "next" button in a dialog I am opening my C# exe. With this I can now verify the key based on mac of the computer and it wiorks fine. The last problem I now have is that how do I get the installshield bsic MSI project to realize if my external exe was successful in verifying the key or not? Right now it just continues with the next screen weather it fails or not. So I read somewhere I should "pass" the message to the next dialog through the registry. I have no problems writing the registry from my C# program, but HOW DO I READ THAT REGISRTY VALUE TO MAKE MY NEXT DIALOG TO NOT OPEN IF THE KEY VERIFICATION FAILED? This is my question.
Thanks!
Catheryne
I am new to using Installshield 2011. I have been tasked to create an install project that verifies a serial key based on mac address of the computer. Since I am not too good at scripting I chose to use Basic MSI project. Since I had a C# application that checks for mac address and verifies a key, I chose to try to use this inside of the install project. So upon a "next" button in a dialog I am opening my C# exe. With this I can now verify the key based on mac of the computer and it wiorks fine. The last problem I now have is that how do I get the installshield bsic MSI project to realize if my external exe was successful in verifying the key or not? Right now it just continues with the next screen weather it fails or not. So I read somewhere I should "pass" the message to the next dialog through the registry. I have no problems writing the registry from my C# program, but HOW DO I READ THAT REGISRTY VALUE TO MAKE MY NEXT DIALOG TO NOT OPEN IF THE KEY VERIFICATION FAILED? This is my question.
Thanks!
Catheryne
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 25, 2011
11:52 AM
You would have to create another CustomAction, perhaps InstallScript, to read the value you would write in from your C# program which would be called after your C# CA withing the Next button.
Try looking at: RegDBGetKeyValueEx
Try looking at: RegDBGetKeyValueEx
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 25, 2011
12:17 PM
I was hoping there would be another solution that would stick with basic MSI only since I am not comfortable with the scripting. I can probably figure out the actual reading of register value though by reading the RegDBGetKeyValueEx examples as you suggest.
The hard part for me may be to actually get to that point in my installsheild project. Can you give me some basic step by step how I would be able to add this custom installscript action into my basic msi and how it would be called after my external c# program finishes? I have figured out how to call the C# funtion with "doaction" on the next button, but I am opening the next screen following the C# program at the same time as the C# function. I don't know how to get this new customaction to start after the C# exe and break out or fail to open if the registry value is unsuccessful. Hope I am making sence.
The hard part for me may be to actually get to that point in my installsheild project. Can you give me some basic step by step how I would be able to add this custom installscript action into my basic msi and how it would be called after my external c# program finishes? I have figured out how to call the C# funtion with "doaction" on the next button, but I am opening the next screen following the C# program at the same time as the C# function. I don't know how to get this new customaction to start after the C# exe and break out or fail to open if the registry value is unsuccessful. Hope I am making sence.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 26, 2011
04:10 AM
If possible, use DLL custom action instead of EXE custom action. Your C# DLL custom action can communicate with the running installer by setting a property, which can then be used to control Next button's ControlEvent. You may find this thread useful.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 26, 2011
07:58 AM
OK, maybe I should try that. So I will call a function in the dll from the dialog? How do I do that?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 26, 2011
09:15 PM
Similar to what you did to call EXE custom action, use DoAction ControlEvent to invoke your DLL custom action.