cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tjcemc
Level 4

Help? Execute Process Wizard Action does not resolve Path Variables - IO Exception

In my PreInstall Sequence, I have have the "Execute Process" Wizard Action which I want to make a call out to a batch file (Windows). I have a Path Variable definfed in IS called "RESOURCES" which points to a particular folder location. In the Execute Process "Command Property", I set the command to "$A(RESOURCES)/bin/go.bat" This should resolve to the real path to this go.bat but it I get errors at runtime saying that it can't find it!

At runtime when the install goes to execute this process I get this error in the console:

java.io.IOException: CreateProcess: $A(RESOURCES)/bin/go.bat error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.(Win32Process.java:66)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:566)
at com.installshield.util.Java2ProcessExec.processExec(Unknown Source)
at com.installshield.util.ProcessExec.executeProcess(Unknown Source)
at com.installshield.wizardx.actions.ExecWizardAction.executeProcess(Unk
nown Source)
at com.installshield.wizardx.actions.ExecWizardAction.run(Unknown Source
)
at java.lang.Thread.run(Thread.java:534)


Why can't it find it? I can use $RESOURCE/foo/bar in other wizard actions and customer beans....please help.

Thank you.
Labels (1)
0 Kudos
(4) Replies
enanrum
Level 9

Your trying to use a Path Variable to run a command!

Think of it this way - where is that path on my machine if I were to install your product!

If you have RESOURCES = C:\resources

Then after I install your product your trying to run:

C:\resources\bin\go.bat

I assume your installing go.bat so you need to do something like:

$P(absoluteInstallLocation)/bin/go.bat

or

$P(beanID_of_go.bat.absoluteInstallLocation)/go.bat

Regards,
Tom
0 Kudos
tjcemc
Level 4

Thanks for the reply.

I am trying to call go.bat which ultimately does NOT get installed on the user's machine. Is this type of file called a "Support File". I want to run a batch file during the PREINSTALL process which does some logic on their machine. The Command Property of the Execute Process lets me specify a Path Variable for the command (i.e. $A(RESOURCE/go.bat) - I figured this file would be available even before files were copied to the user's machine.

It seems like the resolveString logic is not even working though. I could see if the file does not exist on the target hard drive when it executes during the preinstall process, but I get an IOException saying it can't find $RESOURCE/go.bat Shouldn't the resolveString logic still replace the $RESOURCE with the "real" string defined in the Path Variables view? I would have expected IOException on ....\installtemp\bin\go.bat isn't the resolveString logic a simple string replacement at installtime?

Ultimately I am trying to temparily set the user's window's PATH variable to point to a location on their hardrive that has some DLLs which some of my custom beans are dependant on. I got the putResources() working when calling external jars (what a pain in the butt)....and now I want to do the same for some dependant DLLs. I found some info in online help on "Using Java Native Interface (JNI)" which seems like the steps I need to take to have the InstallShield runtime be "aware" of some dependant DLLs. These steps seem overkill!!! I cannot believe the InstallShield IDE does not have a screen that lets me tell it what jars and dlls I want to include in the project and to have those jars and dlls accessible at runtime. I have to write custom java classes to putArchive() and putResource() and then URL = getResource()...blah blah......THIS IS INSANE!!!! The IDE should do this for me! Imagine using Eclipse and having to write a class to tell it what Libraries you wanted to associate with project.
0 Kudos
enanrum
Level 9

I don't thnk this is the way that you use Supoort Files. Look it up in the help! I do not think you can reference a support file from an 'Execute Command' action! I may be wrong!

From looking at the Help for Support Files - you may be able to add the command to the Support files list in the 'Behavior and Logic'->'Supprotfiles'

Create a Custom action as shown in the help and set a variable to the command and use this variabe in the 'Execute Process' as the Command!

cmd = "whatever/go.bat"l
arg0.getServices().getISDatabase().setVariableValue("CMD", cmd);

in Execute Process -> Command = $V(CMD)

Hope this helps!
0 Kudos
wpeterson
Level 3

TJ - you can programmatically query the location of the support files (which will be one of the dynamically created directories within the TEMP directory. Look in the ISMP help section "Using Support Files." You'll see information there about using context.getWizard().getRuntimeFileResourceLocation() call and other APIs. This should allow you to pull the path for your support file based on it's file key. You can then store this in a property that's used to locate the target of your execute action.
0 Kudos