Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Run VB Code In WISE 6.2

Posted on 2009-07-09
15
Medium Priority
?
825 Views
Last Modified: 2013-11-13
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?
0
Comment
Question by:Ben Santiardo
  • 7
  • 6
13 Comments
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 24819921
Did you read the article "Guidelines for Calling .DLLs " in WfWI Help?
0
 

Author Comment

by:Ben Santiardo
ID: 24822904
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"...
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 24825868
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.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:Ben Santiardo
ID: 25032903
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.
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 25032992
> 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.
0
 

Author Comment

by:Ben Santiardo
ID: 25033089
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.  
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 25033499
hold on, let me create a sample for you.
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 25034807
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.
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 25034869
the sample can be downloaded from here:
http://rdpvr.polyscience.com/crm/testmsi.msi
0
 

Author Comment

by:Ben Santiardo
ID: 25035778
Ok, thank you for the sample file.  Now where exactly is this Embedded VBScript?
0
 

Author Comment

by:Ben Santiardo
ID: 25035817
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?
0
 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 2000 total points
ID: 25035992
I don't think it's possible. The binaries for custom actions are stored in the installation in the table Binaries, and are extracted just for running custom action, and then deleted. They are extracted with temporary name. In case of your class, the dll would have to be not only extracted, but also registered in the system as COM object, prior to running the vbscript. Which Installer obviously won't do. That's why it allows C++ dll's, because their entry points can be addressed directly by name without any registration in the system.

The only way I can imagine would be by vbscript reaching inside the installation, extracting the binary dll, storing it on the hard drive, running regsvr32, then calling, then unregistering and removing - but as you can see, it's closer to sci-fi than to reality.

Instead of vbscript, you can call an executable - "execute program from installation". Note however the last paragraph from my prior comment 24825868 .
0
 

Author Comment

by:Ben Santiardo
ID: 25036017
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.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question