sevenalive
Posts: 4
Joined: Mon Oct 24, 2005 12:47 am

JS HELP!!!

I have done a custom action, sing an installed file logonui.js

the contents:
var WindowStyle_Hidden = 0
var objShell = WScript.CreateObject("WScript.Shell")
var result = objShell.Run("cmd.exe /c logonui.bat", WindowStyle_Hidden)



when the installer goes to that action, it says
a script required for the install to complete cannot be ran.

help!
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Hi,

The problem resides in the fact that not all scripts that run from Explorer also run from Windows Installer and vice-versa.

For example:

Code: Select all

var objShell = WScript.CreateObject("WScript.Shell")
works in Explorer but in Windows Installer you must use:

Code: Select all

var objShell = CreateObject("WScript.Shell") 


So your script should be:

Code: Select all

var WindowStyle_Hidden = 0 
var objShell = CreateObject("WScript.Shell") 
var result = objShell.Run("cmd.exe /c logonui.bat", WindowStyle_Hidden)
Best regards,
Ciprian
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com
sevenalive
Posts: 4
Joined: Mon Oct 24, 2005 12:47 am

what do i put in as the function

It still has the error, i notcied the function name box, it says your function, what do i put in there???
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Hi,

In the "Function Name" field you can specify the name of the function to be executed. That is if your script contains more that one functions in that field you can specify it.

If your script doesn't contain a function that field must be empty.

Best regards,
Ciprian
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com
sevenalive
Posts: 4
Joined: Mon Oct 24, 2005 12:47 am

it wont let me

that is the problem, it wont let me, it says i must have a name their, it wont let me have it blank
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

You are right, there must be specified a function name in that field.

All you have to do is place those script lines inside a function and edit the field to the function name.

Best regards,
Ciprian
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”