buildup
Posts: 13
Joined: Tue Jan 02, 2007 2:40 pm

How to include a VBS into an installation

Hello,

I would like to call VBS code which looks like this:

Set WshShell = WScript.CreateObject("WScript.Shell")
Result = WshShell.Run("net stop BuildupServer", 0, True)

How can I bind this code to our AdvancedInstaller script?

Thanks very much!

Bye,
Jürgen Bauer, Germany
ps
Posts: 14
Joined: Wed Mar 14, 2007 2:25 pm

Jürgen,

I'm pretty sure this won't work, I've tried similar without success and there are other posts which mention that this does not work.

I believe you have two options;

(a) Write a batch script and call it as a custom action with viewer.exe

or

(b) Stop the service using the "services" section under "project details".

Both work well for me although I have recently migrated to (b) as the preferred approach.

Regards,

ps.
buildup
Posts: 13
Joined: Tue Jan 02, 2007 2:40 pm

Hi,

I already wrote a line of code line "sc stop BuildupServer" which stops our service. Unfortunately, a dos box pops up which does not look very professional.
The aim I want to archieve is to update our service. So I need to stop it before I can update the suitable EXE.
Maybe, there is another solution ...

Thanks and bye,
Jürgen Bauer, Germany
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Jürgen,

Check the "Services" page under "Project Details", you can specify control operations (start/stop) for your service:
http://www.advancedinstaller.com/user-g ... vices.html

Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
buildup
Posts: 13
Joined: Tue Jan 02, 2007 2:40 pm

Hi,
thanks for your tip. I already tried to implement such a solution. But I did not succeed to stop the service before I updated the EXE file and to start it again.
Maybe you can give me hint how I can update an installed service.

Bye,
Jürgen Bauer, Germany
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Jürgen,

Have you tried to put a control operation (in the "Services" page) with Start for "Event On Install" and Stop for "Event On Uninstall"?

Note that you must do this for both old and new version of your package.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”