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

Running a Command Window

Short version:

Is it possible to run a command window after the installation, using Installscript?

Longer Version:

I want to run a commandwindow after the installation using Install script. In this commandwindow I need to register a service. Before you offer other sollutions: No I cannot use ServiceAddService or the Install NT Service options. If I install it with these functions it wont install correctly... :rolleyes:

So any help would be very nice, Thanks in advance.

Andurin
Labels (1)
0 Kudos

(3) Replies
RobertDickau
Flexera Alumni

It might be worth investigating why the service won't work with the normal MSI service tables (the Install NT Service part of the Component Wizard), since running an external command won't handle shared files, rollback, uninstallation, and so forth.

In any case, you might search these forums and the KB for "batch file custom action" to see some options.
0 Kudos
Andurin
Level 3

RobertDickau wrote:
It might be worth investigating why the service won't work with the normal MSI service tables (the Install NT Service part of the Component Wizard), since running an external command won't handle shared files, rollback, uninstallation, and so forth.

In any case, you might search these forums and the KB for "batch file custom action" to see some options.


When installing the service using the commandline option /install the service will get registered with some special parameters. This doesnt work while installing with the Install NT Services option in Installshield 2008.

Since the Forum search doesnt work for me, I`ll go looking trough the forum manually so It could take me some time to find it 😛 But thanks for the fast reply. I`ll let you know when I found the sollution.:)
0 Kudos
Andurin
Level 3

Finally, found something that works.

function MyFunction(hMSI)   

LONG Nmber;
begin


Nmber = LaunchAppAndWait("C:\\folder\\subfolder\\Servicetoinstall.exe", "/INSTALL ", WAIT);
if (Nmber != 0) then
MessageBox("Error installing", WARNING);
endif;
end;


Only problem is that it isnt really flexible... Couldn't get the PROGRAMFILES or INSTALLDIR function to work yet. But its a good start 😄 Hope it helps someone 🙂
0 Kudos