cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
valdrich
Level 2

Difficulty creating jscript file for custom actions

Your product is a breath of fresh air compared to the VS 2008 deployment project that I have used in the past.

I want to use a JScript file to perform custom actions after initialization. I need to put up a MessageBox to the user to confirm or skip the action and if confirmed, use the file system to make backup copies of certain files.

I created a JScript file which runs fine with the Windows Script Host. I started to modify it to remove the use of the WScript object, but got error 1720 when I tried to use Popup. I could substitute the Session Object Message method, but it is pretty low level. The next hurdle will be how to create a FileSystem object. Can you point me to any examples of JScript files that work with the Windows Installer?
0 Kudos
(3) Replies
Madusree
Level 7

Hi,

Kindly take few moments to have a look at the following MSDN Articles which discusses on creating FileSystem Object using Jscript

http://msdn.microsoft.com/en-us/library/2z9ffy99%28VS.85%29.aspx

http://support.microsoft.com/kb/229693

http://msdn.microsoft.com/en-us/library/aa208404%28office.11%29.aspx

Also kindly refer the topic InstallShield Help Library that is installed with InstallShield Limited Edition “JScript Custom Action Settings”



Thanks,
Madusree
0 Kudos
valdrich
Level 2

Thank you for the references to documentation pages that have helped me get started. The file system object is working now in my JScript test.

I started with JScript because the syntax is familiar. Today I also started a VBScript test. I see now that VBScript is much easier to debug.

I found a large collection of Windows Scripting Examples in the Installer SDK, all in VBScript. Almost all examples in the Flexera Software Community forums are in VBScript.

VBScript has MessageBox, which conducts a professional looking dialog with the user.

Should I infer that JScript does not have the features and capability of VBScript for the purpose of writing custom action scripts?

Am I crazy to keep tring to use JScript for writing custom action scripts?


Thanks for advice.
0 Kudos
Madusree
Level 7

Hi,

VBScript does offer a number of useful features that JavaScript does not, such as MsgBox, InputBox and String. To make these available in JavaScript, you have to create a script that creates an object that works as a wrapper for these functions in JavaScript. The object should have a method for each VBScript function, which can be used to call these functions. This allows you to use them from JavaScript as if they were a normal part of JavaScript

Also kindly take a look on the following MSDN Article which discusses on Custom Action Types supporting JScript and VBScript

http://msdn.microsoft.com/en-us/library/aa371538%28v=vs.85%29.aspx

Thanks,
Madusree
0 Kudos