Link to home
Start Free TrialLog in
Avatar of Ben Santiardo
Ben SantiardoFlag for United States of America

asked on

Run VB Code In WISE 6.2

I am trying to create a Wise Installation routine using "Wise for Windows Installer 6.2". What I would like to do, is if the user selected a certain option for install, to display a screen asking for a Procudt ID, this part is fairly simple.  The next thing I would like to do, is "validate" the Product ID entered before allowing the user to continue.  In order to do this, I have to run VB Code using a custom class I created, but I have no clue how to run VB.Net Code inside the Wise Installation & return a "Pass/Fail" flag...

Can anyone help point me in the right direction?
Avatar of Vadim Rapp
Vadim Rapp
Flag of United States of America image

Did you read the article "Guidelines for Calling .DLLs " in WfWI Help?
Avatar of Ben Santiardo

ASKER

Thanks for responding, but that section (which was a pain to find BTW), doesn't really explain much.  It's extremely confusing and has no samples to look at to help explain what it's describing.
I am looking for a more detailed "How To"...
DLL must be C++-type one, that's where there are "functions" inside it, which you specify in the custom action. I don't think you can do it with VB.net.

I think it would be much easier to call executable instead of DLL. Or you can call vbscript that in turn will create an instance of your class, run it, and return the result.

See http://msdn.microsoft.com/en-us/library/aa368085(VS.85).aspx about what to specify. You can pass the the entered product key as parameter using Target column. The executable should return 0 if validation passed, non-zero if not.

I personally would use vbscript if possible. If you make the executable in .net, then you are opening a big can of worms with installed framework, its version, plus ton of various security issues, guaranteed.
This question stayed open because no truly useful and/or valid answer has come up.  This problem is still active.  I suppose since no one else has offered suggestions to this thread, it can be closed since apparently no one has an answer.  But accepting vadimrapp1's comment is not valid, since his comment was not an actual useful answer for my problem.
> no truly useful and/or valid answer has come up
> his comment was not an actual useful answer for my problem.

the question was:
"I have no clue how to run VB.Net Code inside the Wise Installation & return a "Pass/Fail" flag..."

I explained why DLL made by VB wouldn't work;
and then I suggested what will work instead.

Please clarify why this is not valid, and what you expected.
My apologies, no offence was intended.  
I need to know exactly how to incorporate this type of idea into the WFWI project.  I understand that a DLL could help, or an EXE.  I do not write in C++ so that type of DLL idea doesn't help my situation.  And although I could write another VB executable to recieve and return data, I still don't know how to incorporate it into WFWI.  Like I stated in my 2nd posting "I am looking for a more detailed "How To"... "
I need examples, it's makes it easier to understand and grasp.  I am new to using WFWI, I come from using Wise Installation System 9.0 where we had a great amount of control over the scripting directly within the installation routine.  WFWI is very....limited or rather locked down, in what you can access.  Or so it seems compared to what I am used to.  
hold on, let me create a sample for you.
here's the sample. Look at the button "next" on the dialog "user information" - it runs custom action "MyValidateProductId" - which is embedded vbscript. That vbscript extracts the property associated with the product id box on the dialog, analyzes it, and depending on the result sets another property MyValidationSuccess to 1 or 0. Following that, button "next" invokes the next dialog only when MyValidationSuccess =  1; there's also textbox "invalid key" that shows up or hides depending on the value of MyValidationSuccess.

This is simple implementation; in fact, the user can bypass UI alltogether by running the installation from command line with /qn , so you have to ensure that validation occurs in the immediate phase as well.
the sample can be downloaded from here:
http://rdpvr.polyscience.com/crm/testmsi.msi
Ok, thank you for the sample file.  Now where exactly is this Embedded VBScript?
Ok, I was able to trrack down the embedded code.  Sorry I found it a few minutes after I posted the previous comment.  
But one remaining question I do have, is it possible to use my own previously created class that will verify the ProductID?  If so, how can I add the class to the project to be able to instantiate it in the VBScript and use?
ASKER CERTIFIED SOLUTION
Avatar of Vadim Rapp
Vadim Rapp
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok, now I see and understand the situation better.  I think you are correct that a simply created EXE that takes parameters and returns a flag would be the best solution...  
Thank you very much for your help, I am going to try that senario now and post my progress.