This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Read Support File wizard bean
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 06, 2006
10:46 AM
Read Support File wizard bean
(also posted to ISU 10.5 forum)
Hello,
I am trying to create a wizard bean to cat a supportfile into the bean's value property. When I compile the code below I get a "cannot resolve symbol" error on the "WizardServices wServices = event.getServices();" line. I also get a "cannot access com.installshield.boot.CoreFileUtils" error but hopefully that will be fixed with the getServices fix. Would someone please tell me what I'm doing wrong? I used code stolen from the "Using Support Files" help, which was for a dialog.
Thanks for any help you can give me,
Jeff
- - - - -
package com.installshield.extras.wizard;
/**
* CatSupportFile.java
*
* @author JeffMorse
* @version 1.0
*
* Cats a support file using ID in "Behavior and Logic -> Support Files"
* and stores the result in the hidden property "value".
*
*/
import java.io.*;
import java.net.*;
import java.lang.*;
import com.installshield.event.*;
import com.installshield.event.ui.*;
import com.installshield.event.wizard.*;
import com.installshield.event.product.*;
import com.installshield.wizard.*;
import com.installshield.wizard.service.*;
import com.installshield.wizard.awt.*;
import com.installshield.wizard.swing.*;
import com.installshield.wizard.console.*;
import com.installshield.product.*;
import com.installshield.util.*;
import com.installshield.ui.controls.*;
import com.installshield.database.designtime.*;
public class CatSupportFile extends WizardAction {
private String supportFileId = "";
// hidden property where value is stored
private String value = "";
/**
* Retrieve the ini value from the specified file
*/
public void execute(WizardBeanEvent event) {
supportFileId = resolveString(supportFileId);
WizardServices wServices = event.getServices();
try {
ISSetupFileDef supportFile = wServices.getISDatabase().getDatabaseDef().getSetupFile(supportFileId);
if (supportFile != null) {
String filePath = event.getWizard().getRuntimeFileResourceLocation(supportFile.getStorageKey(),true,wServices);
value = FileUtils.readTextFromFile(filePath, null);
}
}
catch (ServiceException e) {
event.getServices().logEvent(this, Log.ERROR, e);
}
}
/**
* Validate properties
*/
public void build(WizardBuilderSupport support) {
// validate supportFileId property
if (supportFileId.equals("")) {
support.logEvent(this, Log.ERROR, "Support File ID field must be specified");
support.setBuildCanceled(true);
}
}
public String getSupportFileId() {
return supportFileId;
}
public void setSupportFileId(String supportFileId) {
this.supportFileId = supportFileId;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
Hello,
I am trying to create a wizard bean to cat a supportfile into the bean's value property. When I compile the code below I get a "cannot resolve symbol" error on the "WizardServices wServices = event.getServices();" line. I also get a "cannot access com.installshield.boot.CoreFileUtils" error but hopefully that will be fixed with the getServices fix. Would someone please tell me what I'm doing wrong? I used code stolen from the "Using Support Files" help, which was for a dialog.
Thanks for any help you can give me,
Jeff
- - - - -
package com.installshield.extras.wizard;
/**
* CatSupportFile.java
*
* @author JeffMorse
* @version 1.0
*
* Cats a support file using ID in "Behavior and Logic -> Support Files"
* and stores the result in the hidden property "value".
*
*/
import java.io.*;
import java.net.*;
import java.lang.*;
import com.installshield.event.*;
import com.installshield.event.ui.*;
import com.installshield.event.wizard.*;
import com.installshield.event.product.*;
import com.installshield.wizard.*;
import com.installshield.wizard.service.*;
import com.installshield.wizard.awt.*;
import com.installshield.wizard.swing.*;
import com.installshield.wizard.console.*;
import com.installshield.product.*;
import com.installshield.util.*;
import com.installshield.ui.controls.*;
import com.installshield.database.designtime.*;
public class CatSupportFile extends WizardAction {
private String supportFileId = "";
// hidden property where value is stored
private String value = "";
/**
* Retrieve the ini value from the specified file
*/
public void execute(WizardBeanEvent event) {
supportFileId = resolveString(supportFileId);
WizardServices wServices = event.getServices();
try {
ISSetupFileDef supportFile = wServices.getISDatabase().getDatabaseDef().getSetupFile(supportFileId);
if (supportFile != null) {
String filePath = event.getWizard().getRuntimeFileResourceLocation(supportFile.getStorageKey(),true,wServices);
value = FileUtils.readTextFromFile(filePath, null);
}
}
catch (ServiceException e) {
event.getServices().logEvent(this, Log.ERROR, e);
}
}
/**
* Validate properties
*/
public void build(WizardBuilderSupport support) {
// validate supportFileId property
if (supportFileId.equals("")) {
support.logEvent(this, Log.ERROR, "Support File ID field must be specified");
support.setBuildCanceled(true);
}
}
public String getSupportFileId() {
return supportFileId;
}
public void setSupportFileId(String supportFileId) {
this.supportFileId = supportFileId;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
(6) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 07, 2006
09:21 AM
Judging from the API help, perhaps try this:
WizardServices wServices = event.getWizard( ).getServices( );
WizardServices wServices = event.getWizard( ).getServices( );
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 07, 2006
11:54 AM
Thanks Robert, that fixed the 2 getServices () errors. Now I'm still getting the error:
CatSupportFile.java:53: cannot access com.installshield.boot.CoreFileUtils
file com\installshield\boot\CoreFileUtils.class not found
value = FileUtils.readTextFromFile(filePath, null);
^
I tried readFileToString as well and got the same error.
Please help!
Jeff
CatSupportFile.java:53: cannot access com.installshield.boot.CoreFileUtils
file com\installshield\boot\CoreFileUtils.class not found
value = FileUtils.readTextFromFile(filePath, null);
^
I tried readFileToString as well and got the same error.
Please help!
Jeff
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 07, 2006
12:50 PM
Hmmm... Is bootstrap.jar on the compiler's class path?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 07, 2006
01:06 PM
U da man! That was it. I added bootstrap.jar to my cp and voila. Now to see if the bean actually does what I want it too. On to step 2.
Thanks very much for your help Robert. Give yourself a raise!
Jeff
Thanks very much for your help Robert. Give yourself a raise!
Jeff
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 07, 2006
01:22 PM
Jeff Morse wrote:I will (in cups of coffee, at least)! Thanks!
Give yourself a raise!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 25, 2020
02:57 AM
Hi,
Can you please let me know where to find bootstrap.jar?
![](/skins/images/3B39CE851FDD5528C393F146EB70A2D0/responsive_peak/images/icon_anonymous_message.png)