您的位置:首页 > 其它

How to debug scripts using Wise Installer script debugger

2008-05-26 11:34 609 查看
Article ID: 17555

How to debug scripts using Wise Installer script debugger

Applies To

• Wise for Windows Installer 4.21, 5.21, 6.x
Question

How do I debug scripts using Wise Installer Script Debugger?
Answer

(Note: This article was originally published in the December 2001 TechInfo! Newsletter. The information contained in this article is accurate for the products referenced, and has not been updated for later product releases.)

Have you ever wondered why you received error messages such as could not register DLL or variable not set during your installation? Have you wondered how you could find out where the error messages were coming from and how to correct them? The Wise Installation System Debugger gives you the ability to identify a problem in your script. This means that you can spend more of your time fixing the problem rather than trying to find it.

The Debugger, available in the Debug menu in Script Editor, lets you pinpoint the exact script line that's causing the problem. You can choose to run the Debugger in one of three ways:

Go. Go runs through the installation script from start to finish. It stops at any pauses (breakpoints) you set and repeats this process until it reaches the end of your script.

Set Breakpoints. Breakpoints enable you to set pauses as the Debug runs through your script. The Debug tool temporarily halts execution at each breakpoint, then resumes when you select the Go command.

Single Step. This process lets you run through the installation line by line from start to finish.

When you debug your installation (using any of the debug methods), a yellow arrow appears next to the line that is currently being executed in the Installation Script area. The Actions area displays all of the variables for your script. This gives you the opportunity to view the value of your variables at runtime. You can edit a variable's value while debugging by double-clicking it.

The Set Breakpoints option is the best way to run the Debugger when you are unsure which line in your script is problematic. To set a breakpoint, click the script action where you want the installation to stop, then select Set Breakpoint from the Debug menu. A red dot appears next to the script action and will stop when the Debugger reaches that point. Once you have the breakpoints set, select Go from the Debug menu to start the debugging process. The Single Step debug option is the best choice when you want to review each script line in your installation. To use this option, select Single Step from the Debug menu.

Suppose you receive a variable not defined error message. The Debugger gives you two methods of finding this error in your script. You can single step through your installation until you locate the line of code where this error occurs. You can go through the entire script once using the Go option. When the error occurs, the Debugger will halt execution and the yellow arrow will display the line of the script where the error occurred. When you are finished debugging, exit the installation and resume normal Script Editor operation by selecting Stop Debugging from the Debug menu.

The Debugger in Wise Installation System not only enables you to debug your script, but also lets you see exactly what the script is doing at any time and the values for variables that have been set. The Debugger is an ideal tool for locating the cause of errors that arise during an installation. It is also a useful way to confirm in a step-by-step manner that your installation executes as designed.

The information contained in the Altiris Knowledgebase is subject to the Terms of Use as outlined at http://www.altiris.com/legal/termsofuse.asp.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: