Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Please try using the VBScript as an Installed custom action. Note that you need to include it your package in order to use this method.

Let me know if the problem persists.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
martosoler
Posts: 3
Joined: Tue Apr 17, 2007 3:29 pm

Re: Customs actions with .vbs files

Hi, i want a similar thing ...
I put this code in a InlineScript:

Code: Select all

const WindowStyleStealth  = &H20000000 : set WSO = createobject("WScript.Shell") : WSO.run cmd /c service.bat install", WindowStyleStealth, true
but when executes the script the installer throw a warning and rollback...
I'm facing that the problem is that it can't find the file 'service.bat'
Please help
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Customs actions with .vbs files

Hi,

You are encountering this behavior because the custom action cannot find the cmd file and the BAT file (you didn't specify paths for them). Note that the example used the ComSpec environment variable to get the path of the "cmd.exe" file:

Code: Select all

WSO.run "%comspec% /c CreateSchema.bat"
The "ComSpec" environment variable usually has the value "C:\Windows\System32\cmd.exe". Also, this command line is an example in which the path of the BAT file is relative. Note that you need to specify the actual path of the BAT file. For example:

Code: Select all

WSO.run "%comspec% /c C:\CreateSchema.bat"
Another approach is explained here:
http://www.advancedinstaller.com/forums ... 908#p14908

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”