cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
msaponaro
Level 3

Run a vbs or exe during the setup

In the InstallScript Project I'm have modify the function OnFirstUIBefore().
...
...
Dlg_SelectInstance:
nResult = SQLServerSelect(szMessage,szserver);
if (nResult = BACK) goto Dlg_Start;

if (szserver != "New instance") then
nResult = SQLServerSelectLogin
(szserver,szuser,szpassword,bAuth);
if (nResult = BACK) goto Dlg_SelectInstance;
else
//run VBS or EXE
endif;

if the user select a valid instance in SQLServerSelect Dialog, I show SQLServerSelectLogin Dialog and run an SQL SCRIPT
else I have to run SQLEXPR.EXE in command line for install a new instance of SQL EXPRESS.

I don't know if it is possible.
Do you have any ideas to help me?

Thanks!!!
Labels (1)
0 Kudos
(3) Replies
Christopher_Pai
Level 16

You could call LaunchAppAndWait but instead of going out of process, have you considered just porting the VBScript to InstallScript? The languages are very similar in the COM support syntax and translation is pretty straight forward. This should make it more reliable and easier to handle errors and pass data back and forth.
0 Kudos
ChristopheOce
Level 7

Hi,

For your problem, in your else code


if (nResult = BACK) goto Dlg_SelectInstance;
else
//run VBS or EXE
endif;


you can use the launchapp or launchappAndWait function of installscript.
these function start an exe and can receive some parameters.
it simply to use and work fine.

Now if you want to start a vbs in your else i don't know if it's possible in installscript !!!!
perhpas create a custom action and stored vbs in this custom action and try to run in your code but i've never seen how to call a custom action in installscript !!!

Have a nice day
Christophe
0 Kudos
Christopher_Pai
Level 16

ChristopheOce wrote:
Now if you want to start a vbs in your else i don't know if it's possible in installscript !!!!


You can, it's just a question of `why?`. Use LaunchAppAndWait to call wscript with /B for batch /NOLOGO and the name of your script.

Still, you can read the VBScript which means you can port it native for a better experience.
0 Kudos