We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

adamdc78
Posts: 76
Joined: Wed Mar 19, 2014 7:42 pm

VBS issue (resolved)

I'm trying to configure the NetTcpPortSharing service to start automatically as well as start it from a VBS script but I've run in to some difficulty. It seems that AI doesn't handle VBScript the way Windows does, so I've had to modify the script to run the second script in the correct context; "." instead of

Code: Select all

FSO.GetParentFolderName(WScript.ScriptFullName)
. In any case, the service is being started but the command to configure the startup type isn't having any effect.

runUpdate.VBS:

Code: Select all

Set objShell = CreateObject("Shell.Application")
set FSO = CreateObject("Scripting.FileSystemObject")
scriptName = ".\UpdateService.VBS"

If FSO.FileExists(scriptName) Then
		objShell.ShellExecute "wscript.exe", _
			Chr(34) & scriptName & Chr(34), "", "runas", 1
End If
UpdateService.VBS:

Code: Select all

Dim objShell
Set objShell = CreateObject("WScript.Shell")

objShell.Run "sc config NetTcpPortSharing start= auto"
objShell.Run "sc start NetTcpPortSharing"

Set objShell = Nothing
If I change the path in scriptName to be "FSO.GetParentFolderName(WScript.ScriptFullName)" then I can run it from the command line and the config command does what I'm asking it to do.

Any help would be most appreciated as I'd rather not leave it up to my users to configure the service.
Last edited by adamdc78 on Fri Apr 04, 2014 12:29 am, edited 1 time in total.
adamdc78
Posts: 76
Joined: Wed Mar 19, 2014 7:42 pm

Re: VBS issue

Turns out there's a better way to do what I was trying to accomplish; using the CreateExeProcess custom action from the aicustact.dll. Much easier!
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: VBS issue (resolved)

Hello Adam,

I'm glad you got this working. If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”